Skip to content

Instantly share code, notes, and snippets.

@chrishunt
Last active December 16, 2015 16:19
Show Gist options
  • Select an option

  • Save chrishunt/5462643 to your computer and use it in GitHub Desktop.

Select an option

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
require 'snoop'
MAX_RENT = 1900
BEDROOMS = 2
CITY = 'portland'
CATS = true
DOGS = true
def url
url = [
"http://#{CITY}.craigslist.org/search",
"/apa?zoomToPosting=&query=&srchType=A",
"&maxAsk=#{MAX_RENT}",
"&bedrooms=#{BEDROOMS}"
].join
url += "&addTwo=purrr" if CATS
url += "&addThree=wooof" if DOGS
end
snoop = Snoop::HttpNotifier.new url: url
snoop.notify while: -> { true }, delay: 5 do |content|
`terminal-notifier -message "New listing!"`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment