Reddit Bot built with Python and PRAW along with other libraries.
This program will post NASA's daily APOD(Astronomy Picture of the Day) at 12 p.m. each day and will post 3 random APODs at 5 p.m. each day. The pictures are requested from NASA's API. The requested pictures are downloaded, posted, and deleted 2 minutes after posting so no storage is required.
This program is built following the PRAW documentation
the purpose of this bot is to post and share space-related pictures
I've always been interested in space and love looking at pictures and articles about it. Making this bot that posts a space picture and has an explanation on the bottom is a way to share my interest with like-minded people since this is posted only in a subreddit about space.
These are the libraries you'll have to install
pip install praw
pip install requests
This bot is currently deployed on Python Anywhere (https://www.pythonanywhere.com)
Example: With these lines inside main(), the program will check every 40 sec if it's time to execute the 4 functions that run this bot
def main():
print("BOT STARTED")
# daily single post
schedule.every().day.at("12:00").do(reddit_post_daily)
# deleting the image after posting
schedule.every().day.at("12:02").do(remove_pic)
# daily gallery post
schedule.every().day.at("17:00").do(reddit_post_rand)
# deleting the image after posting
schedule.every().day.at("17:02").do(remove_gal)
while True:
schedule.run_pending()
time.sleep(40)