/hermes

A tool to get Slack notifications for new Craigslist postings

Primary LanguageJavaScript

hermes

A tool to get notifications for new Craigslist postings

Requirements

  • Node 7.6+ for async/await functionality

Setup

  • Clone the master branch of the repo
  • Update config.js with a Slack webhook
  • Modify search object as desired
  • Run node search.js to be notified of new items

Creating a Slack webhook

See this documentation by Slack for a helpful guide on webhooks. Once you add one to a channel and copy the webhook URL, paste that into config.js and you're set!

Search support

A search object has the following attributes:

  • city: The site to search, see here for options, then extract from [city].craigslist.org.
  • category: The category to search in for sale postings, extracted from [city].craigslist.org/search/[category]. See constants.js for some readable mappings.
  • parameters: An object that contains the search options that can be encoded into a query parameter, with support for the following options:
    • query: A string indicating the search
    • searchTitle: A boolean indicating to only search titles
    • hasImage: A boolean indicating that the listing must have an image
    • postedToday: A boolean indicating that the listing must have been posted today
    • distance: A string indicating the search radius from zipCode
    • zipCode: A string indicating the zip code to search in
    • minPrice: A string indicating the minimum price
    • maxPrice: A string indicating the maximum price

Additional configuration

  • The refreshRate in constants.js indicates how often (in seconds) the search will be polled for new items.
  • The cache in constants.js indicates the number of posting IDs to save, in order to prevent previously seen postings that were updated from sending another notification.