Advertise here: Contact FM.
window.addEventListener('load',init()); to run your script on page load, as opposed to simply calling init() somewhere in your script. This was the problem that caused Mefi Navigator not to work with an Asynchronous Flagging script. I had to get people to make this change to their local copy of the Async Flagging script, which is a less than ideal way of bug-fixing, especially as the number of MeFi greasemonkey scripts increases.div would deselect it. Also, perhaps consider making a little diagram (something like this) to indicate what it all does before installing it.class='author' or class='link' to the links, respectively. You wouldn't have to add anything to stylesheets or anything, since these class attributes just act as flags, in a way, that enable scripts to pick up the right link even if other scripts have already been run. Currently, the method us script-writers have of working out the name of the user who wrote a comment is very fragile and likely to break when multiple scripts run, and there's not much we can do about that. I sympathise with your desire to work on the site for users, not scripters, though.
My script can append the underlying HTML of part of somebody's comment to the reply box – i.e. it preserves formatting HTML and A links. With this ability, the best way to quote this HTML is to wrap it in something like <div style='padding-left: .4em; border-left: thin solid;'>…</div>. This gives clean displays of quoting quotes of quotes. This wrapper works fine in live preview, but doesn’t make it into the real preview. Since you may have some qualms about passing arbitrary HTML into a comment, could you at least update the HTML filters and stylesheet so that <div class='quote'> can make it into a comment?
Second the HTML class issue:
I thought my script would have problems with MeFi Navigator because that script alters the shape of the DOM. I was lucky that that script obeyed Natural Motherhood principles (e.g. it only used appendChild) so that no absolute paths were affected.
The problem is that without class signposts one has to resort to absolute (numerical index, e.g. '[1]') DOM position to scrape out the necessary info. My current XPaths are:
If some script I want to cohabite with changes the shape of that part of the DOM then such absolute paths would be off.
Could you add some class so the paths could be something like:
or whatever class names you like?
In addition, why does www.metafilter.com and ask.metafilter.com have comment pages that include a <div class=’page’> while metatalk.metafilter.com does not? Not only does my script have to special case this, but my scheme generates things like <a href="/mefi/11372#page">drpynchon</a> to link to the starting post. This link doesn't work in metatalk.metafilter.com.
Finally, since I am asking for class additions, I have another (not ready for prime time) script that scrapes the front pages of blue, green, and brown. Will you please class the things under smallcopy? I currently have to resort to an XPath like:
Adding some more class to your HTML would make it easier to write scripts and may make them more resilient to site HTML changes and cohabitating with other scripts.
PS: anybody that wants to understand and use Xpath should install the Xpather extension.
posted by MonkeySaltedNuts at 10:46 AM on March 18, 2006