Giter Club home page Giter Club logo

planter-ropot's Introduction

Table of contents

About

Blog Post

Video

Utilizes Python Requests and Beautiful Soup libraries to scrape Craigslist postings by keyword search. Listings are written to CSV, and posted to a Slack channel with Slack’s API. A text message is sent using Twilio's REST API if the listing is located in the user's city. Deployed on Heroku’s Cloud service. Note: Per my conversation with Slack's support team, there is a bug where Slackbot posts with unfurled images show as "edited". Their team is currently working on getting this fixed.

External Setup

  • Slack workspace
  • An App on workspace
  • Add chat:write links:write OAuth Token scopes under Add Features and Functionality --> Permissions:
  • Install App to workspace
  • Create Channel for bot to post into
  • Add bot to channel:
  • Store Slack API in secrets.sh file:
    • export SLACK_API_TOKEN='INSERT-TOKEN-HERE'
  • Twilio REST API

Running Planter-Ropot locally on your computer

  1. Clone repository:
$ git clone https://github.com/sshantel/Planter-Ropot
  1. Install dependencies:
$ pip install -r requirements.txt
  1. For a scraping of items outside of planters in the SF Bay Area, region and term in line 204 of scraper.py will need to be updated to fit your desired needs. The URL in line 62 can be adjusted according to the Craigslist link you wish to scrape.

  2. Source the Slackbot and Twilio API by running the following command:

$ source secrets.sh
  1. Final command to run Planter-Ropot locally:
$ python3 scraper.py

Listings will post on the desired Slack channel if such listings in your Craigslist region with keywords exist.

Deployment

  1. Download and Install Heroku

  2. Create Heroku app

  3. Store the Slack and Twilio API using the following commands

heroku config:set SLACK_API_TOKEN='INSERT-TOKEN-BETWEEN-THESE-SINGLE-QUOTES'
heroku config:set twilio_api='INSERT-TOKEN-BETWEEN-THESE-SINGLE-QUOTES'
heroku config:set twilio_auth='INSERT-TOKEN-BETWEEN-THESE-SINGLE-QUOTES'
  1. Store personal phone number
heroku config:set my_phone_number='INSERT-PHONE-NUMBER-BETWEEN-THESE-SINGLE-QUOTES'
  1. Adjust Heroku timezone according to your location(otherwise it defaults to UTC)
$ heroku config:add TZ="America/Los_Angeles"
  1. Add and commit files
$ git add .
  1. Scale worker dyno
$ heroku ps:scale worker=1

planter-ropot's People

Contributors

sshantel avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.