https://github.com/xdevplatform/plot-bookmarks
Plot your Bookmarks with Python
https://github.com/xdevplatform/plot-bookmarks
Last synced: 11 months ago
JSON representation
Plot your Bookmarks with Python
- Host: GitHub
- URL: https://github.com/xdevplatform/plot-bookmarks
- Owner: xdevplatform
- License: apache-2.0
- Created: 2022-06-30T01:04:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-30T01:27:17.000Z (over 3 years ago)
- Last Synced: 2025-02-15T07:51:42.847Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 12
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Plot Bookmarks
A [demo application](https://plot-bookmarks.onrender.com/) built in Python using [Flask](https://flask.palletsprojects.com/en/2.1.x/). This sample code will build an application that will authorize your account using the [OAuth 2.0 Authorization Code Flow with PKCE](https://developer.twitter.com/en/docs/authentication/oauth-2-0/authorization-code) and plot up to your last 100 Bookmarked Tweets.
## Getting set up with the Twitter API
If you don’t already have access to the Twitter API, [you can sign up for a developer account.](http://t.co/signup) Once you have an approved developer account, you must create a Project in the [developer portal](https://developer.twitter.com/en/portal/dashboard). Each Project contains an [App](https://developer.twitter.com/en/docs/basics/apps/overview) with which you can generate the credentials required to use the Twitter API. You will also need to have OAuth 2.0 turned on in your App’s settings. In our [platform overview](https://developer.twitter.com/en/docs/platform-overview), you can learn more about getting started with the Twitter API.
## Setting up your environment
To install all the packages in your requirements.txt file, in your terminal, run the following command:
```bash
pip install -r requirements.txt
```
You will also set up environment variables to ensure you aren’t passing in your secrets directory. To achieve this, you will define environment variables. In your terminal, run the following command:
```bash
export CLIENT_ID=’xxxxxxxxxxxxxx’
export CLIENT_SECRET=’xxxxxxxxxxx’
export REDIRECT_URI=’http://127.0.0.1:5000/oauth/callback’
```
You can obtain your own OAuth 2.0 Client ID and Secret inside of your App’s settings in the developer portal. Use your Client ID and Secret instead of the `xxxxxxxxxxxxxx`.
### Run the file
To run the file, run the following line in your terminal:
```bash
python app.py
```