You can access Twitter data for your projects using the Twitter API. To begin, you'll need to apply for a developer account with your Twitter account at https://developer.twitter.com/en/apply-for-access
Once you click apply, you'll be prompted to select your use case. Under Hobbyist, select Exploring the API.
After confirming your contact details, you'll be asked to describe how you'll be using the Twitter API. Enter in information as applicable. If you're planning to use the API for other projects beyond this one, you may want to include that information here for the future.
After confirming your information and agreeing to terms of service, you'll click Submit Application. Applications are usually approved fairly quickly, usually within a few minutes.
When you log into the developer portal, you'll see your developer dashboard. Here you can access all of your account information and documentation.
In order to pull from the Twitter API, you need to create a Project. At the bottom of the Dashboard page, click on New Project and then complete the information about your Project.
Each Project has an App, which stores your API keys and access points.
Add an App to the Project your just created. Enter your desired name for your App and then click Complete.
After you've created the Project and App, you can access the Project page which supplies Usage stats and allows access to your App.
If you click on the App Settings button (the cog wheel), you can adjust access settings for the App and access your Authentication tokens.
The project's code needs access to your Twitter API Authorization tokens. To keep this information secret, but still accessible, you can enter this information into a file called secrets.py.
secrets = { 'ssid' : 'insert your network name here', 'password' : 'insert your network password here', 'timezone' : "America/New_York", # http://worldtimeapi.org/timezones 'twitter_api_key' : 'insert your twitter api key here', 'twitter_secret_key' : 'insert your twitter secret key here', 'bearer_token' : 'insert your bearer token here' }
Page last edited March 08, 2024
Text editor powered by tinymce.