🐈 A Twitter bot posting random adoptable pets from the SPA.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
spa
README.md
requirements.txt
scrapy.cfg

README.md

@Adoptez_moi

A twitter bot that posts a random adoptable pet from the SPA.

Heavily inspired by CutePetsAustin.

Tweeting at @Adoptez_moi.

Quickstart

  1. Configure credentials.py
  2. Install the dependencies pip install -r requirements.txt
  3. (optional) Crawl the SPA website rm pets_data.csv && scrapy crawl spa-crawler -o pets_data.csv
  4. Tweet a random adoptable pet python bot.py

Setup

Installation

  • Clone the repo git clone https://github.com/dataforgoodfr/batch1_adoptez-moi.git
  • Configure credentials.py with your Twitter API Key and Access Token:
twitter_api_key = 'XXXXX'
twitter_api_secret = 'XXXXX'
twitter_access_token = 'XXXXX'
twitter_access_token_secret = 'XXXXX'
  • Optionally, create and activate a virtual environment
  • Install the python dependencies with pip install -r requirements.txt
  • Tweet a random adoptable pet with python bot.py
  • Optionally, schedule a cron job to execute cp pets_data.csv{,.bak} && rm pets_data.csv && scrapy crawl spa-crawler -o pets_data.csv every few days
  • Optionally, schedule a cron job to execute bot.py every few hours

Twitter

  1. Create a new Twitter app.
  2. On the Keys and Access Tokens tab in Twitter for the app, click Create my access token.
  3. Copy the API Key and Access Token into credentials.py

License

The MIT License (MIT)