This project twitter bot (https://twitter.com/GoogleNfl) scrapes Google News for articles related to "NFL" in the last 12 hours. Then selects a random article from that time period to create and send tweet from a user specified Twitter account.
Tweepyenables communication with the Twitter API to create and send tweetsGoogleNewsscrape and read articles from the Google News featurerandomtell program to pick a random article from Google Newstimeto signal how long the script should "sleep" before running again
Most importantly, any user will need to create a Twitter Developer account (https://developer.twitter.com/en/support/twitter-api/developer-account). From there, you can retrieve personal access tokens to link your twitter account. Now just open your favorite editor and install/import the packages listed above.
Customizable options:
GoogleNews(period='x')user can change which time period to scrape Google Newsgn.get_news('x')change which category of articles to scrapeelement_info = {change which items to actually pull from the scraped articletweet_textformat how the tweet looks and what is included- An infinite while loop is used to continously run the script.
time.sleep()can be adjusted to change the interval on how long to wait until running the script again