Last active
December 16, 2015 16:19
-
-
Save chrishunt/5462643 to your computer and use it in GitHub Desktop.
Be notified when a new house matching your criteria is posted to Craigslist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Be notified when a new house matching your criteria is posted to Craigslist | |
require 'snoop' | |
MAX_RENT = 1900 | |
BEDROOMS = 2 | |
CITY = 'portland' | |
CATS = true | |
DOGS = true | |
snoop = Snoop::HttpNotifier.new url: begin | |
url = [ | |
"http://#{CITY}.craigslist.org/search", | |
"/apa?zoomToPosting=&query=&srchType=A", | |
"&maxAsk=#{RENT}", | |
"&bedrooms=#{BEDROOMS}" | |
].join | |
url += "&addTwo=purrr" if CATS | |
url += "&addThree=wooof" if DOGS | |
end | |
snoop.notify while: -> { true }, delay: 300 do | |
`terminal-notifier -message "New listing!"` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment