programming:python:clcheck
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
programming:python:clcheck [2009/06/15 18:11] – created crustymonkey | programming:python:clcheck [2011/03/29 20:15] (current) – [What is it?] jay | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Craigslist Search and Notify Script ====== | ====== Craigslist Search and Notify Script ====== | ||
+ | ===== NO LONGER MAINTAINED ===== | ||
+ | Sorry to anyone who has arrived here, but I'm no longer maintaining this script. | ||
+ | |||
+ | It's not the most complicated of scripts, so anyone with some Python chops should be able to still take the base and do some tweaking (mainly of the regular expressions) and get this to work. I just don't have the large amount of time to sink into supporting something that is broken by the whims of others. | ||
+ | |||
===== What is it? ===== | ===== What is it? ===== | ||
A friend of mine asked me recently if I knew of a script that would perform a search on [[http:// | A friend of mine asked me recently if I knew of a script that would perform a search on [[http:// | ||
Line 6: | Line 11: | ||
===== The Script and Config File ===== | ===== The Script and Config File ===== | ||
- | Setting this up is a piece of cake. All you have to do is get the script and the example config file, edit the config and run the script. | + | Setting this up is a piece of cake. All you have to do is get the script and the example config file, edit the config and run the script. |
==== Getting the Files ==== | ==== Getting the Files ==== | ||
+ | === Subversion === | ||
You can check out the latest script and example config from [[http:// | You can check out the latest script and example config from [[http:// | ||
Line 16: | Line 21: | ||
If you don't have [[http:// | If you don't have [[http:// | ||
+ | === Download the Package === | ||
+ | The package can be downloaded directly by {{: | ||
==== The Example Config ==== | ==== The Example Config ==== | ||
Line 237: | Line 244: | ||
===== Usage ===== | ===== Usage ===== | ||
As you can see in the above config file example, the configuration is actually pretty simple. | As you can see in the above config file example, the configuration is actually pretty simple. | ||
+ | |||
+ | Listed in order of importance, 1. being the most important, here is how '' | ||
+ | |||
+ | - '' | ||
+ | - '' | ||
+ | - ''/ | ||
+ | - ''/ | ||
+ | - '' | ||
After the '' | After the '' | ||
Line 242: | Line 257: | ||
As noted in the example config, if you do **NOT** define an smtpServer, the output will be printed to STDOUT. | As noted in the example config, if you do **NOT** define an smtpServer, the output will be printed to STDOUT. | ||
- | Here would be a more "real world" example of config file with comments describing what is going on: | + | Here would be a more "real world" example of config file named '' |
< | < | ||
[DEFAULT] | [DEFAULT] | ||
- | # I live in minneapolis so I want to search the minneapolis craigslist by default | + | # I live in minneapolis so I want to search the |
+ | # minneapolis craigslist by default | ||
clBase = minneapolis.craigslist.org | clBase = minneapolis.craigslist.org | ||
- | # I'm usually looking for things that are in the general "for sale" category so I'll just set that as the default | + | # I'm usually looking for things that are in the |
+ | # general "for sale" category so I'll just set | ||
+ | # that as the default | ||
clCat = for sale | clCat = for sale | ||
- | # I just want to use one db file (sqlite3 storage) so I'll set it to live in my home directory | + | # I just want to use one db file (sqlite3 storage) |
+ | # so I'll set it to live in my home directory | ||
dbLoc = / | dbLoc = / | ||
# I want emails to go to me by default | # I want emails to go to me by default | ||
Line 256: | Line 275: | ||
# I'll use my local outbound mail server | # I'll use my local outbound mail server | ||
smtpServer = mail.splitstreams.com | smtpServer = mail.splitstreams.com | ||
- | #smtpPort = 25 | + | # I'm just using the standard port 25 |
- | #smtpUser = myuser | + | smtpPort = 25 |
- | #smtpPass = awesomePassword | + | # My SMTP username (this is obviously optional and |
- | #smtpSSL = false | + | # dependent upon your setup) |
- | #smtpUseTLS = true | + | smtpUser = myuser |
- | # | + | # My SMTP user password (again, obviously optional) |
- | # | + | smtpPass = awesomePassword |
- | #[I want a cat] | + | # I'm going to make sure everything is encrypted |
- | #search = fuzzy cat | + | smtpUseTLS = true |
- | # | + | |
- | #[Time for a new house] | + | # My first search is for spam and eggs. I'm just going to |
- | #search = houses that don't suck | + | # let this run as a standard "for sale" search |
- | #clCat = real estate - all | + | [spam and eggs] |
- | # | + | search = spam eggs |
- | #[Find a new girlfriend and send to alternate email] | + | |
- | #search = hot women | + | # This second search is for a new house. |
- | #clCat = men seeking women | + | # to San Francisco so I'm going to search that location |
- | #alertTo = mysecretemail@somewhere.com | + | [Time for a new house] |
+ | search = houses that don't suck | ||
+ | clCat = real estate - all | ||
+ | # I only want results in the bay area | ||
+ | clBase = sfbay.craigslist.org | ||
+ | |||
+ | # I'm a sleazy bastard looking for a new girlfriend, but I haven' | ||
+ | # got the gonads to break up my current girlfriend. | ||
+ | # going to search the general " | ||
+ | [Find a new girlfriend and send to alternate email] | ||
+ | search = hot women | ||
+ | clCat = personals | ||
+ | alertTo = mysecretemail@somewhere.com | ||
</ | </ | ||
+ | |||
+ | Now that my '' | ||
+ | |||
+ | < | ||
+ | $ ./ | ||
+ | Usage: Usage clcheck.py [options] | ||
+ | |||
+ | Options: | ||
+ | -h, --help | ||
+ | -c FILE, --config=FILE | ||
+ | The path to the config file [default: ./ | ||
+ | -d, --debug | ||
+ | </ | ||
+ | |||
+ | By default, the script looks for your config file in the same directory that you run the script from. I'm going to move my script to ''/ | ||
+ | |||
+ | < | ||
+ | $ ./ | ||
+ | </ | ||
+ | |||
+ | The first time you run this (and there is no db file), you will get no output since the script assumes you have already checked craigslist for the things you are searching for. Every run after this, however, will send you one email (or output everything to STDOUT) for each configured search if there are new items posted on craigslist. | ||
+ | |||
+ | ===== Any Further Questions ===== | ||
+ | If you have any further questions or suggestions, | ||
+ | |||
+ | If you run into any bugs, you can either email me or open a bug report at https:// |
programming/python/clcheck.1245089505.txt.gz · Last modified: 2009/06/15 18:11 by crustymonkey