Skip to content

spandan13/nasa-twitter-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


TheNasaBot
The Nasa Images Bot

A Twitter bot using the NASA API

my website
Twitter

AboutHow To UseSet-UpRelatedContact


About :

A twitter bot that replies to requests with random images from NASA's Image Gallery fetched using NASA's Open API. It also posts daily NASA's Astronomy Picture of the Day(APOD). You can also request the bot for APOD of a specific date and it will respond accordingly.

Some Features:

  • Does not repeat images.
  • Supports banning images
  • Supports blocking specific users.
  • All config done using separete settings file.
Twitter

How To Use :


Set Up :

  • Requirements:

  • Files setup:

    • Rename all sample-filename files to filename
    • Complete the settings/settings file with appropriate details
      (Detailed explaination below)
    • Finally setup a cron job to run twitterbot.py
      Eg. * * * * * python3 /path/to/bot/twitterbot.py
  • Monitoring:

    • You can use a service like Cronitor to monitor the bot and get notified in case of any errors.

Settings file config:

  • twt_api_key - Twitter consumer key
  • twt_secret_key - Twitter consumer key secret
  • twt_token - Twitter access key
  • twt_secret_token - Twitter access key secret
  • nasa_api_key - NASA API key (Get it here.)
  • allow_repeat_after - After how many images the bot is allowed to repeat an image
  • apod_time - Time in HH:MM format (24 hours) when the bot should post the daily APOD
  • bot_account - @Username of the bot account
  • master_account - @Username of the bot manager/owner account
  • temp_downloads - Full path to a folder where bot can download images temporarily
  • search_terms - [list] of search terms the bot should use when looking for images. (The bot will choose a random image from the search results)
  • ban_command - Keyword that the manager/owner can tweet under any reply from the bot. This will result in the bot deleting that reply and it will not post that image again.
  • request_commands - Keyword/s that the users can use when requesting an image from the bot. For multiple keywords, add each on a new line.
  • time_tolerance - Time (in minutes) for how old a request tweet should be for it to be ignored.
  • tweet_text - Optional text which will be added to the begining of every tweet by the bot

Related :


Contact :

my website
Twitter

About

A twitter bot that replies to requests with images from NASA's Image Gallery. Also posts daily Astronomy Picture of the Day and can respond to specific date requests.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages