Vinnie Tesla (vinnie_tesla) wrote in greasemonkies,
Vinnie Tesla
vinnie_tesla
greasemonkies

Two questions for the Monkeys

I'm working on an LJ script, and two questions have come up, one LJ-specific, and the other GM-specific.

1) Is there any straightforward way for a script to tell what layout it's looking at? I'm sure some unique characteristic could be found for the markup of each one, but, damn, is that an ugly, unreliable, and labor-intensive approach.

1½) Why the flaming hell isn't there consistent use of class names across LJ layouts? It would make this stuff much, much easier.

2) Is there a way for a script to access all of its GM_setValue() data, preferably as an array? I know the user can see it through about:config, but I want my script to be able to access it.
Subscribe
  • Post a new comment

    Error

    default userpic
  • 2 comments
1) not AFAIK. When I did LJ New Comments, I just said "it'll work for common layouts, anything else is your own problem".

1.5) because LJ didn't intend to make this easier :-) (It's not clear that they intended to make this harder, they probably just didn't think about it).

2) not AFAIK. Obvious workaround: store a key which contains a list of the other keys.
Re: 1: I'm not sure my script is generalizable enough for that. I'll do a big announcement/release in a couple days when I've prettied it up, but I have all the basic functionality as of first thing this morning.

The deal is that it removes entries from the user's friendslist according to tags she's specified, so it needs to find its way up from the tags list to the top single-entry container and then plonk it. A quick comparison of A Sturdy Gesture (which is what I developed it on) and Generator suggests that this is easy to port, but hard to generalize.

2: You're right--that is obvious. My bad.