A couple changes to make making Greasemonkey scripts more straightforward, please? November 22, 2011 10:37 PM   Subscribe

A couple changes to make making Greasemonkey scripts more straightforward, please?

(1) It would be nice if there were a real class to denote that something is a comment. There is a "comments" class, and it is applied to comments, but it is also applied to things that are not comments. At least the following two non-comment things are in the "comments" class:
  • The "<< Older Something something ... | Something something ... Newer >>" line near the bottom of the page;
  • "You are not currently logged in. Log in or create a new account to post comments."
(2) Within an actual comment of the "comments" class, there are potentially a bunch of direct child nodes, the first bunch-minus-one of which are the... well... comment, and the last of which is the stuff like "posted at 12:34 by Somebody". It would be nice if the "comments" div had two and only two direct child nodes, the first being the comment and the second being the "posted at" stuff. Within that first child node would be all of the "bunch-minus-one" stuff from today.

I'm not sure if that second one was clear or not, so here's a little example. Today we might have:

<div class="comments">Hey, blah, <a href="http://example.com">thingy!</a><span class="smallcopy"> posted at 12:34 by somebody</span></div>

Whereas it would be nice to have:

<div class="comments"><span class="commentText">Hey, blah, <a href="http://example.com">thingy!</a></span><span class="smallcopy"> posted at 12:34 by somebody</span></div>

I think that both of these changes would make making Greasemonkey scripts that deal with comments easier.

Thanks in advance for any consideration to these ideas.
posted by Flunkie to Feature Requests at 10:37 PM (8 comments total)

It would be nice if the "comments" div had two and only two direct child nodes
Or, more specifically, it doesn't really matter (with respect to what I'm suggesting) that there are two and only two; rather, what I really mean here is that it would be nice if the "bunch-minus-one" stuff would all be put into a span (or something), and that span given a class that indicates that it is the meat of the comment.
posted by Flunkie at 10:50 PM on November 22, 2011


I'm sorry, we're not likely to change things on this scale for the sole purpose of making Greasemonkey scripts easier to code. I feel your pain—I remix the Web quite a bit to get things working the way I want. Sometimes selecting just the right thing is a challenge.

Unlike a uniform machine with interchangeable parts, MetaFilter has grown organically over the years. You'll find subtle differences between all of the subsites. Classes are used oddly here and not-so-oddly there. Inline styles abound.

In a perfect world we'd come up with a MetaFilter style guide for HTML and have distinct classes for every distinct piece of information on the page. But we're not there yet. We're kind of a mess behind the scenes and we're ok with that. I know that makes working with MeFi in this way a bit of a challenge, and I can sympathize, but we're not ready to be this organized.
posted by pb (staff) at 10:54 PM on November 22, 2011 [3 favorites]


we're not ready to be this organized.

Man, I use this line with my boss almost every day, and she never reacts well!
posted by OmieWise at 3:59 AM on November 23, 2011 [4 favorites]


Ooh, now I've got a Thanksgiving-weekend project: to fully understand this post.

Then, maybe, over Christmas, I can write that Greasemonkey script that replaces the names of animals with cutesy pictures of 'em.
posted by box at 7:03 AM on November 23, 2011


Metafilter: we're not ready to be this organized
posted by chavenet at 12:50 PM on November 23, 2011 [3 favorites]


I noticed recently that the "posted by" attribution stuff for posts is either inside or outside the div.copy depending on whether or not there's [more inside]. fun.

so yeah, I'd really like the markup to be more clean and consistent, but without a big push to make MeFi more parser-friendly it's not going to happen. and I accept that that means it's not going to happen.

so how about http://foo.metafilter.com/nnnnn.xml returning a nice structured representation of the post? no? yeah, no.
posted by russm at 5:43 PM on November 23, 2011


russm, have you seen http://foo.metafilter.com/[id]/[title]/rss?
posted by pb (staff) at 6:08 PM on November 23, 2011


metafilter: <span class="comment">Not ready.<htMl /> To be organized, we are</div>
posted by blue_beetle at 5:34 AM on November 25, 2011


« Older Pony request: option to disable editor shortcuts   |   Are drive-by questioners becoming a problem? Newer »

You are not logged in, either login or create an account to post comments