I’ve released an update to my Craigslist Spam Buttons greasemonkey script. (If you don’t know what this is about, see my original post).
This new version works completely differently, it flags items in the background using a hidden iframe. This should fix the problems people were having with the old version. Special thanks to Steve Sweet for his help on this version.
I’m not 100% sure this is working perfectly yet, so please try it out and let me know what you think.
Update 10/29/2008 – this is now working great! And it keeps the [spam] links marked as visited, even after reloading the page, so you can see which posts you’ve already marked.
The latest version can always be downloaded from http://userscripts.org/scripts/show/7399

Dan says:
Thanks for updating it! It definitely works differently now; when I click the ‘spam’ link it sends me to the ‘thanks for flagging’ page; however, I tested it on a few job spam postings on the pennstate.craigslist.org site, and after I hit the script ‘spam’ link, got the thank-you page, and clicked on the ad again, it was still there, but when I used the regular ‘spam/overpost’ link and refreshed, it showed the ‘flagged for removal’ page :/
So it doesn’t work for me under XP and Firefox 3.0.1… but thanks for updating it and working so hard on it! I wish CL worked as hard as you on getting rid of spam and making it easier for us to do our jobs as flaggers.
14 October 2008, 12:25 amRyan Stille says:
Ok, I just updated it again (v1.3.5), this time pulling out all the work I did on fixing the back button. Let me know if it works any better. The downside is, when you hit your back button its going to appear like you’re not going anywhere, because you are actually stepping back through the pages in the hidden iframe. I had that problem fixed, but I think that caused the actual flagging not to work!
14 October 2008, 8:06 amRyan Stille says:
The newest version (1.3.8) is working great, please grab it and use it!
29 October 2008, 9:16 pmPip says:
Your script does not work. I have greasemonkey and the latest script. No “spam” buttons pop up.
13 November 2008, 4:21 pmSqueak says:
Ditto Pip above me… no special buttons showing up anywhere.
19 November 2008, 2:39 pmDJ Jazzy says:
Hi, this doesn’t work in FF3. I’ve confirmed on several different machines. Have a look, pretty please?
22 November 2008, 9:26 pmJustin says:
Confirmed, the current version is not working for me on Firefox 2.0.0.14. Also not working on my home box with current version of Firefox 3. Both with latest version of greasemonkey. Other than that, it’s been a valuable tool and I enjoy using it when it works! =)
25 November 2008, 5:46 pmSteve says:
I use it every day. Are you sure you removed the older versions? Any special security settings you may have set in FF? I’m using FF 3.0.4.
27 November 2008, 11:27 amSteve says:
You also might try opening Firefox Error Console, clear messages, then refresh a craigslist page and see if there are any JS errors that might be hanging it up.
27 November 2008, 11:30 amDJ Jazzy says:
Success!
OK, this is interesting. I’m using FF 3.0.4 on OSX 10.5.5 and GM 0.8.20080609.0 . After turning off other extensions like adblock & linky, and then several reinstall/uninstall cycles for the script, it still wasn’t behaving.
I took your advice and looked at the error console. That’s when I started seeing syntax errors due to what must be some weird text wrapping in the actual script file. I opened up the craigslist_spam_buttons_.user.js file in textedit, and removed spaces and line breaks, saving and reloading a CL page each time. I found 11 lines with odd breaks, and now with my corrected version, the script works again!
I wonder if this is GM or FF3 introducing the line breaks?
I’ll also compare your script source to my edited copy to make sure I caught all the wrapping errors. Even though it loads OK now, there were other blocks of text that looked incorrectly wrapped. I’ll also try another script to see how/if this affects it.
29 November 2008, 12:14 pmSteve says:
This may be a mac/pc linebreak issue. It may also be the way the file was saved by Ryan for download. There are no strange characters or linebreaks in my original code.
29 November 2008, 12:23 pmSteve says:
I just downloaded the file and checked it, and also viewed the source on greasemonkey, and the file has some problems in formatting.
Probably when Ryan saved the file his editor had auto line-wrapping turned on or something like that.
29 November 2008, 12:28 pmSteve says:
I’ve corrected the formatting and put the file on my server for anyone who want’s do download it directly:
http://74.52.232.203/7399.user.js
29 November 2008, 12:36 pmDJ Jazzy says:
Hmm, now I’m thinking it’s the actual source as hosted on userscripts. That has the line wraps that I ended up removing to make mine work. Previous versions of the script don’t have breaks like 1.3.8.
On another note, if I open a CL posting in another tab, the button changes to strikeout text, whether or not I’ve actually clicked it?
Thanks very much!
29 November 2008, 12:47 pmDJ Jazzy says:
Ah, you posted your reply while I was composing mine! Yes, the alternate source seems to load OK.
BUT… I still get the button changing to strikeout when opening in a new tab. I guess that isn’t being caused by the formatting.
29 November 2008, 12:52 pmRyan Stille says:
Ok, I updated the official source on userscripts.org with the version that Steve provided (thanks Steve!). Hopefully that fixes the linebreak issue. I reinstalled from that source and it seems to work ok, no errors. But I wasn’t able to successfully flag anything. But that doesn’t necessarily mean its not working. So please let us know how it works for you.
http://userscripts.org/scripts/show/7399
29 November 2008, 1:02 pmSteve says:
DJ,
The reason the button changes to strikeout is because it changes when you visit the post and not when you actually flag. The post is visited in the iframe when you click the spam link, or if you actually visit the post. This was the only way I could figure out how to do it, and after using it for awhile I found it to actually help, because sometimes I go visit a post to double check if it really needs flagging, then flag it there. Also it shows me what I’ve already visited, so I don’t need to think about that post again. I know it’s a little misleading, but you’ll get used to it.
Steve
29 November 2008, 1:25 pmamonotod says:
I made a derivative work of this script, simpler. It is available at http://userscripts.org/scripts/show/39972.
Thank you for the original, Ryan!
7 January 2009, 2:01 pmamonotod
Susan says:
Ryan, could you please email me and tell me how to do this? I did manage to get greasemonkey, but am not sure where to put the script… I'm a technotard. Thanks! Susan
7 March 2009, 8:48 pmSteve says:
It only turns red because the link has been visited, but does not actually flag the item unless you click on the spam link. I found it useful to have the ones marked that I'd visited already so I didn't have to look at them again, even if I hadn't flagged them at the time.
26 March 2009, 6:24 pmSteve says:
Well, I wrote the script, and I promise it's not a bug. Here's the way it works. I use the visited style and alter it dynamically to change it to red. This way when you come back to a page that you've clicked those flag links, they remain red.
When you click the flag link, it actually opens the post in an invisible iframe (which causes the page to be visited), then it finds the actual spam report link and clicks it.
It's also true that if you actually visit a post, then the link is visited as well, so it's still red.
At first I attempted to correct that, but the fact is that once I started using it I found that I liked it that it showed pages I'd visited or pages I'd flagged. Since there was no easy way to change the behavior, I left it like that.
The code is available for you to modify to your hearts desire if you want it to behave a different way.
26 March 2009, 8:31 pmSteevo says:
Steve,
One thing I noticed, some pages take a while to flag. I looked into it and it seems those are pages where there a large number of remote loaded pictures.
It's not clear whether if you click another spam link when the script is saying "flagging please wait" is doing anything or not. Both spam links turn red.
Can you think of a way to improve performance when flagging by not loading the pictures, or setting the size to 1×1 in the iframe?
I think your script is great, I did make a couple minor changes to my own taste.
31 March 2009, 11:28 amSteevo says:
BTW, though both spam links do turn red, very often subsequently visiting the page does not show either a visited "SPAM" link in the box at the top, and clicking it does result in it saying "Thanks for flagging", as expected.
I think if I click the script "spam" link and it is working the box on the cl page should say "Thanks for flagging" but it doesn't seem to, at least for me.
I am just not completely sure this is all working, or maybe not all the time. Hmm.
Also, the new "nearby results" that CL is returning now if you have few local results, though they do have the script's "spam" link that link does not work. It's a different city and thus a different URL. The script does not take that into account. This is a bug introduced by CL, not a bug in the script. But the script perhaps should take this new result in account.
1 April 2009, 2:28 pmSteevo says:
One more issue I noticed, cl now returns nearby results, results from other areas if there are few results from the cl area you are looking in.
The script uses the domain name at the top to make it's flag link, and that fails on the nearby results, since they are in a different area.
// get city out of domain name
var regex = new RegExp(/^([^\.]*)\./);
var retval = regex.exec(domain);
var city = retval[1];
Should be changed to use the city the post being flagged is in, but this will likely result in performance problems. But I don't know how to change it. Steve, do you? Or will that result in too much of a performance hit?
The other thing I noticed was if you flag a post with remote loaded graphics, like from photobucker which the spammers seem to like to use, that takes time to load in the invisible iframe. Is there a way to fake the loading of those graphics in the iframe?
5 April 2009, 11:42 amSteve says:
About taking awhile to flag some posts, I see that problem too, but can't think of a way to speed it up. When I go on a flagging binge, and want to move really fast, I actually turn off images in the browser settings, and it goes instantaneously.
I've also seen the behavior where the spam link on the posting is sometimes already clicked, and sometimes not. I'm not sure what's going on there. I'll check it out.
I also noticed that Ryan had made the iframe 0 width and 0 height in his version, whereas I actually show the iframe. I'm not entirely sure that iframes work if they have no dimensions, so I'd try setting it to something.
I hadn't seen the nearby results thing. Maybe it's only in certain areas. I'll check it out.
5 April 2009, 12:16 pmSteve says:
If you display the iframe, and enlarge it enough to see what's going on, then you will notice that when you click the spam link and look at the iframe, it will have say thanks for flagging.
Even if I go to a post and flag it, then come back to that post, it doesn't retain the flagged status. It does in IE but not in FireFox.
5 April 2009, 1:07 pmSteevo says:
<i>Even if I go to a post and flag it, then come back to that post, it doesn't retain the flagged status. It does in IE but not in FireFox.</i>
I've noticed that, I always thought that was a defect in firefox. I have reported so many things like that on bugzilla.mozilla.org and they languish there for years.
I was going to look at that flagging thing with firebug and see if it's actually working.
About the graphics, can't you set the graphics size in the iframe?
As to the nearby results, pick an obscure search results, like in cars for a model t. You might get some non local results then, with mismatched script spam links and the post link.
5 April 2009, 8:23 pmSteevo says:
Apparently something has changed today.
Craigslist has changed something, I should say.
The link under the SPAM and the link in the list of posts are now the same.
I tried both the 1.3.9 version on the userscripts site and I have my own with a couple changes. Both work the same. Or don't work anymore.
9 April 2009, 11:45 amSteve says:
The links have always been the same. The only difference is that there's a little javascript onclick script on the spam link, and when clicked it opens the url in a hidden iframe and clicks the spam link on the post.
Occasionally I've found something gets messed up, and the spam link just takes you to the post. Probably some javascript error that causes the script to fail. Just close the browser and reopen it and all will be well
9 April 2009, 12:21 pmSteevo says:
Hm. I did close the browser and reopen it, and I tried both script versions.
However it does seem to work now.
I have no explanation.
One thing I did notice today is if I visit a post, the spam link does turn red with a line through it. It's still a link but visiting it does cause that behavior, even though I didn't flag it. This is with the script from userscripts, not the one I modified.
I still have no explanation.
Heh. Weirder and weirder….
9 April 2009, 12:38 pmSteve says:
The red link with the line is the way it works, whether you flag it or just visit the post. I think I discussed this behavior above.
9 April 2009, 1:49 pmSteevo says:
Steve,
As I said before, I suspected this flagging thing wasn't really working in every case.
Now I notice some more evidence that this is the case.
I have a spammer who posts hundreds of messages a day, and I sometimes go through and flag all his posts.
Sometimes, I got back to flag again, and the script says "Post already flagged". I know if there were posts done by this guy on that day I would have flagged them all, but the "Post already flagged" indication seems to occur in about half or less of the posts. Since all these posts existed as of that date and my search term is the same, I am sure I had flagged them all before.
But some were apparently not successfully flagged by the script.
This is the guy with remote loading graphics from photobucket, which I have been waiting until the flagging completes before I go on to the next one.
So I think this scrips only flaggs successfully about half the time.
10 August 2009, 2:33 pmCornfield says:
great post, thanks for providing so much. Keep up the good posts.! http://www.hoover-f5914900.com
22 August 2009, 11:16 pmnomad says:
1.3.9 version when you click on a post and use the back button to return to list it automatically marks that post as spam.
28 April 2010, 12:51 pmsynthia herrera says:
is this still working it worked at first and dosent anymore? what am i doing wrong?
23 June 2010, 11:47 pmsynthia herrera says:
is there a new version?
23 June 2010, 11:47 pmRyan says:
Craigslist often changes how their flagging system works. If the script has stopped working they may have made some changes again. I'll try to take a look at it in the next few weeks and get it updated.
24 June 2010, 6:58 amSteevo says:
Synthia, why do you say it doesn't work?
What does it do or not do?
AFAICT it's still working, both I and Steve have verified that.
Ryan, Steve says it's possible a zero pixel Iframe might not work, or they may have done something to disable it.
I changed the iframe to 640×200 and visible and it is clearly working in testing. As to when it was zero size, it's hard to tell.
8 July 2010, 12:23 amSteevo says:
By the way,
"Update 10/29/2008 – this is now working great! And it keeps the [spam] links marked as visited, even after reloading the page, so you can see which posts you’ve already marked."
That part is not working for me. If I reload the page all the spam links turn back to blue.
8 July 2010, 8:35 pmI MUST FLAG says:
READING POSTS IS THE CURRENT VERISION WORKING?
10 August 2010, 12:03 pmRyan says:
As far as we know, yes.
There is a known issue on pages that return "nearby" results, I have heard it freezes on pages that have these links.
10 August 2010, 12:06 pmSteevo says:
It's working.
As to pages with nearby results, I haven't seen freezing but I the link opens the wrong area. The script doesn't allow for those out of area results so tries to flag in the area denoted in the page url.
Which for the nearby results is wrong. That could probably be fixed but it hasn't been.
22 August 2010, 11:54 amJay says:
Is this site like Craigslist? lol.. I posted on here earlier asking for help and my post got flagged/deleted! I sell my products on CL and I have a competitor who keeps flagging me! My post gets removed within minutes and for some reason I can't remove his post. Even after flagging his post using proxies and several ip's hundreds of times it has no effect on his post! I need to know if someone knows how his ad is not removed but why mine comes down in minutes? Is there some type of anti flag code I can use to keep my ads up? Is there a way I can flag his ad and remove it? Someone please help me! I have a family to provide for and CL helps alot but I can't even keep my ad up for 20 mins because he targets me and flags until my ad comes down! I'll gladly pay someone top dollar for your help!!! Thank you!
25 August 2010, 4:47 amSteevo says:
Well, it just gets more and more complicated.
1. Ryan, your userscripts page says version 1.4 but the version there is 1.39. If there is actually a version 1.4 it has not been posted. Kind of a waste. So that should be corrected.
2. I started using the CL Pics addon. That extension puts thumbnails of each picture inline in search results. It's very helpful but it's not usable with the spam buttons script running. If spam buttons is running all the pictures are duplicated, some up to 4x. It's ridiculous.
Can one of you smart guys do a little maintenance on this script? Thanks!
17 June 2011, 4:08 pmSteevo says:
Is anyone there?
I am having some trouble with the craigslist flagging script.
5 July 2011, 1:44 pmRyan says:
Hi Steevo. I'll see if I can take a look at the version mismatch sometime this week. I'm guessing the file just wasn't updated to reflect the new version number.
As far as working with the pics add on – the pics add on modifies the underlying HTML, making it difficult or impossible for the spam buttons script to find the HTML elements it needs to work with. At this point I have no plans to make it compatible with the pics add on.
5 July 2011, 1:51 pmSteevo says:
It's actually worse than that, as far as I can tell the pics addon causes multiple other problems.
One thing I did notice is even with the clpics disabled now, I notice if I click the spam button the script starts, the flagging box appears and stalls, and then the cl ad opens.
I click back to the list and the flagging box is still there. So not completing.
I just updated to the latest Firefox 3.6.18, but the problem remains. Even with the clpics disabled.
I have to say the script that you and Steve worked on is by far the strongest solution to it's problem. Sad to have it become broken.
5 July 2011, 1:57 pmSteevo says:
Well, I reloaded it from the userscrips site, the stalling is resolved. Something crept in.
5 July 2011, 2:04 pmSteevo says:
With the reloaded script the clpics doesn't seem to work at all. Hmm.
5 July 2011, 2:20 pmNow this is getting interesting.