Tonight I published an update to my Craigslist Spam Buttons greasemonkey script. (If you don’t know what this is about, see my earlier post). I’ve had some feedback on the script, and I was able to incorporate those requests. Now the [spam] buttons are displayed at the front of item link. And when you click on the link, a request is made in the background to mark the item as spam. You no longer have to jump to the flag-spam page, then click the continue browsing button to get back to where you were. Instead the [spam] button changes to a red check mark to indicate that it has been marked.
This is more difficult than you would think, you can’t just do a simple AJAX request because your browser will only make requests to the same site you are on. In this case you are browsing on yourcity.craigslist.org, but the flag-spam page is on flag.craigslist.org.
The greasemonkey extension does provide a built in method to make http calls to external sites, but that would break my Opera compatibility. So instead I load the flag-spam page as the src of a JavaScript-created image object.
It was fun to figure out, I really enjoy programming in JavaScript.
You can get the script from userscripts.org. Here is a screen shot:
