This script posts tweets to twitter in order to share the most recent racing results from Stafford Motor Speedway's SK Modified Feature Events. The tweet includes the date of the race, the race title, the top 5 finishers and the link to the full article on the tracks website.
- See the docs: python-dotenv.
- Change the below variables in '.env'. Using environment variables to secure api keys.
- API calls using Tweepy.
- To create and use the twitter API apply for a Twitter Developer Account.
API_ACCESS_SECRET: <API_ACCESS_SECRET_base64_encoded>
API_ACCESS_TOKEN: <API_ACCESS_TOKEN_base64_encoded>
API_KEY: <API_KEY_base64_encoded>
API_SECRET: <API_SECRET_base64_encoded>
The twitter account username used in the API.
TWITTER_ACCOUNT: <TWITTER_ACCOUNT_base64_encoded>
The webhook URL if you want to send messages using webhooks.
WEBHOOK_DISCORD: <WEBHOOK_DISCORD_base64_encoded>
The URL that contains a list of posts.
ARCHIVE_WEBSITE: <ARCHIVE_WEBSITE_base64_encoded>
- tweepyThread - Function using tweepy in order to send multiple tweets in a thread fashion.
- discordMessage - Function using requests to send messages over webhooks, this one is used mainly for discord.
- staffordResults - The main part of this script