Twitter handle : @mytrashcode
It automatically posts random images with some hashtags on twitter to build social media presence for my blog Mytrashcode
You can find the setup instruction on the original repo here if you also want to build one.
I scrap them in one shot from popular programming meme subreddits and uploaded to an static folder on a linux instance running all time.
No. I run a lifetime free linux instance on GCP. It does the job for me.
No. I have scheduled a cron job to trigger randomly 3 times a day.
0 0,8,16 * * * sleep $(( RANDOM \% 14400 )); /usr/bin/python3 /home/kshitij.singh/twitterImgBot/twitterbot.py --tweet
It runs the python script and does the job.
In folder twitterImgBot/images/reddit_sub_ProgrammerHumor/
This is a one time job, which i achieved with tool called ripme.
SSH to box and run
java -jar ripme.jar --url https://www.reddit.com/r/ProgrammerHumor/top/?t=year --ripsdirectory ./twitterImgBot/images/
Remove videos or other non image files that could have been scraped also by running these commands :
ls | wc -l
find . -type f ! \( -name '*.jpg' -o -name "*.png" \) -delete
ls | wc -l