friendlyreminderbot icon indicating copy to clipboard operation
friendlyreminderbot copied to clipboard

refactor main to use YAML parser and test with personal twitter bot

Open erikkristoferanderson opened this issue 2 years ago • 3 comments

👨‍💻 Changes proposed

factor main and load_env plus just print for now

We can't use tweepy.API, because the twitter bot account is only allowed to use twitter API v2, which is compatible with tweepy.Client(). Also the loadenv file needed to be refactored because it wasn't working. Also changed the logic in main.py to suit the new reminders.txt format. Also created an example .env-example file to show the shape of what the .env files needs to be, and added .env to .gitignore.

mentions #40

✔️ Check List (Check all the applicable boxes)

  • [x] My code follows the code style of this project.
  • [x] This PR does not contain plagiarized content.
  • [x] The title of my pull request is a short description of the requested changes.

📄 Note to reviewers

We need a bearer-token to authenticate with the V2 Twitter API.

📷 Screenshots

erikkristoferanderson avatar May 21 '22 20:05 erikkristoferanderson

With bearer token, I attempted to run this, and the error was: tweepy.errors.Forbidden: 403 Forbidden

erikkristoferanderson avatar May 21 '22 21:05 erikkristoferanderson

I will refactor this using the Python yaml parser.

erikkristoferanderson avatar May 23 '22 19:05 erikkristoferanderson

The bot does send tweets, with my personal bot credentials. See here: https://twitter.com/odes_erik_bot/status/1528828488878284800

erikkristoferanderson avatar May 23 '22 20:05 erikkristoferanderson