Skip to content

A twitter bot backend to fetch URLs from google alerts and push them out as tweets.

License

Notifications You must be signed in to change notification settings

dipanshunagar/galerts-twitterbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Google Alerts based TwitterBot

A twitter bot backend to fetch URLs from google alerts and push them out as tweets with zero infra cost.

How to use:

  1. Set up your google alert with the Deliver to field as RSS Feed. If this field is disabled, try this: while you are on the Google Alerts page, you will have the Settings (Gear) icon in the My alerts section. Please click on that and uncheck the option Digest and then click on Save.

    Remember to copy the RSS Feed URL once the GAlert is saved, using the RSS icon in the list of you set alerts.

  2. Sign up for a twitter dev account (using the bot's twitter account for simplicity), create an application and enter the api connection credentials in main.py

  3. Set up a heroku application and push these files into it.

  4. Visit <your app name>.herokuapp.com/news/autotweet (without a trailing slash) in a browser to test. It should give a JSON response with a status and tweet count.

  5. Now we need to call this endpoint in regular intervals. Go to script.google.com, create a new project. Enter the following code and plug in your heroku app URL:

function tweetbot_timer() {
  Logger.log(UrlFetchApp.fetch("https://<your app name>.herokuapp.com/news/autotweet"));
}
  1. Set up a new trigger for this script as per your preference, and you're done.

About

A twitter bot backend to fetch URLs from google alerts and push them out as tweets.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages