Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 2.6 KB

readme.md

File metadata and controls

61 lines (47 loc) · 2.6 KB

Tweeter Basic

Send tweets (with optional images) and authenticates through the Twitter v2 API (OAuth 2.0) using Python.

Quick Start

Send a test tweet with the following steps:

  • generate and set the following environment variables:
    • TWITTER_CONSUMER_API_KEY
    • TWITTER_CONSUMER_API_KEY_SECRET
    • TWITTER_ACCESS_TOKEN
    • TWITTER_ACCESS_TOKEN_SECRET
    • TWITTER_CLIENT_ID
    • TWITTER_CLIENT_SECRET
    • TWITTER_CALLBACK_URI <- (ie. http://localhost/callback to match the route in server.py)
  • authorize the application (1 time only) to generate the seed token.json with the following:
    • run the token generation server by executing Authenticate/authenticate.sh (Docker) or python3 -m Authenticate.src.server (Python3)
    • navigate with a browser to http://localhost/auth
  • send a test tweet by executing example/test.sh (Docker) or python3 -m example.test (Python3)

Prerequisites

  • either:
    • Docker engine or
    • Python3 with flask requests requests-oauthlib
  • Twitter project with:
    • v1.1 API read & write access (for attaching images to tweets)
    • v2 API access

2do

  • write separate PyPI instructions
  • document interfaces
  • give a more verbose explanation of the steps

future

related projects

resources used