Twitter bot that posts a daily photo of the sunset from my camera live stream on YouTube
- Sunwait - install from source or use the Ubuntu snap or MacPorts
- Python Twitter API
- youtube-dl
- ffmpeg
- Set up a camera pointing out of your window towards the sunset, and livestream it on YouTube
- Set up Twitter: Sign up for Twitter account for your bot, apply for Twitter Developer account using your new Twitter account, create an application and get the keys
- Clone repository to your server
- Rename
twitter_secrets_template.py
totwitter_secrets.py
and add the keys you got from Twitter - Edit
sunsetbot.py
to update your location (lat
,long
- must be in a format recognisable bysunwait
), and the URL to your YouTube livestream (youtube_link
) - Keep
Debug
set toTrue
(to avoid a long wait) and run the script (python3 sunsetbot.py
) to check that the image has been captured an posted on Twitter - Set
Debug
toFalse
and getcron
to run your script once a day, around mid-day.sunsetwait
will cause the script to pause until sunset, at which point the image will be captured and posted on Twitter. The script will then quit and will get to run again next day usingcron