THIS TOOL HAS BEEN MOVED HERE:
https://zentastic.me/blog/zenclsh/
One of the tasks that I do in maintaining the kit car blog is searching Craigslist for interesting finds. Problem is, there’s no good way to search for multiple terms, let alone multiple cities — so in a single day, I’d have about 1,200 searches to do. So I wrote this quick little bot to do it for me.
harvestcl.zip (30k)
This contains a few files:
- harvestcl.exe – This is the actual executable. You should run it from the command line, although you can just click on it as well, as long as the support files are in the directory you’re running it from.
- clcities.txt – This is a list of all the cities to search. Blank lines are ignored, as are lines beginning with “#” (so you can comment out cities by putting a “#” in front of them rather than deleting the line). The file is currently seeded with all cities in the US, Canada, the UK, Australia, and New Zealand.
- clsearch.txt – This tells the program what searches you’d like to do. There should be one search per line, in the format “section,term”, where section is the short form name of the section as defined by Craigslist (ie. “sss” for all, “car” for cars and trucks, “clt” for collectibles, and so on), and the term is the search term. If the search term has a space in it, make sure you surround it by quotes. As with the cities file, you can comment out lines with the “#” character. The file currently contains the search that I do for the kit car site.
- harvestcl.bas – For those that want it, this is the PB/CC 4 source code. Feel free to modify it or use parts of it for other projects — it includes some simple parsing code and http get code with support for 302 redirects (used here to redirect requests to country-specific Craigslist sites). This can be deleted.
When the program runs, it will search all the sites and create (and try and display) a file called harvestcl.html. Search matches will be listed by description (with a link) and split by the date they were posted. Every time you run it, new entries will be added to the same file, with the new ones being tagged with “NEW” so you don’t miss them. It maxes out at 15,000 matches, although you can change this in the code.
Hope this is useful for someone… If you’re looking for specialty items, it’s an effective tool that can be run daily to make sure you don’t miss something, no matter where in the world/country it is posted. Feel free to email me about this program at snowrail@gmail.com or post here if you have questions.