Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xdevplatform/dog-facts
A repository of sample code designed to help you Tweet random dog facts
https://github.com/xdevplatform/dog-facts
dogfacts oauth pkce-oauth twitter-api-v2 twitterbot
Last synced: 3 days ago
JSON representation
A repository of sample code designed to help you Tweet random dog facts
- Host: GitHub
- URL: https://github.com/xdevplatform/dog-facts
- Owner: xdevplatform
- License: apache-2.0
- Created: 2022-09-14T16:09:03.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-23T17:24:16.000Z (about 2 years ago)
- Last Synced: 2024-04-22T01:00:31.921Z (7 months ago)
- Topics: dogfacts, oauth, pkce-oauth, twitter-api-v2, twitterbot
- Language: Python
- Homepage: https://tweet-a-dog-fact.glitch.me
- Size: 16.6 KB
- Stars: 10
- Watchers: 12
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Tweet a dog fact
Allows you to Tweet a fact about dogs once! Try it out at [tweet-a-dog-fact.glitch.me](https://tweet-a-dog-fact.glitch.me).
This site walks you through the OAuth 2.0 Authorization Code Flow with PKCE for authentication and makes a call to the Twitter API's manage Tweets endpoint.
## A framework
This code sample can be a starting point to make a bot similar to [@Factual\_\_Dog](https://twitter.com/Factual__Dog), a bot that Tweets dogs facts twice daily. This can be remixed to make your own bot, if you do you will need to add in your own logic to determine how often your bot will Tweet.
## Prerequisites
In order to remix this code sample you will need the following:
- A developer account.
- If you don’t already have access to the Twitter API, [you can sign up for a developer account.](http://t.co/signup)
- A Project in the [developer portal](https://developer.twitter.com/en/portal/dashboard)
- An App containing the credentials required to use the Twitter API
- OAuth 2.0 turned on in your App’s authentication settings
- You will also need to update your `.env` file to include your client ID, client secret and redirect URI. You can obtain your client ID and secret from your App's authentication settings and your redirect URI should be `your-glitch-project.glitch.me/oauth/callback`. This must match the redirect URI in your App's authentication settings.