I simply used the Python Schedule API to run my Beempy random image script on a timer!
I just set to post a random image post once every 10 minutes, I am writing this post while I wait with my fingers crossed, and it worked. Don't worry, I won't leave it on forever, just shifts. I will set the timer to every 6 hours possibly?? What do you think?? I don't want repeats, at least too many so I still need to feed the machine with my original pics, housekeeping/ bot maintenance is still a lotta work!
Here's the script:
#!/usr/local/bin/python3
from beem.imageuploader import ImageUploader
from beem import Steem
import random, os
import schedule
import time
def job():
if name == "main":
stm = Steem()
author = "honusurf"
path = "/Users/nick/random-surf"
random_filename = random.choice([
x for x in os.listdir(path)
if os.path.isfile(os.path.join(path, x))
])
image_path = random_filename
image_uploader = ImageUploader(steem_instance=stm)
img_link = image_uploader.upload(image_path, author, image_name=":)")
title = "Random SURF by @honusurf!!"
body = "Original Maui Surf Pics by @honusurf. "\
"Random photo uploaded with beempy image:
schedule.every(10).minutes.do(job)
while True:
schedule.run_pending()
time.sleep(1)
This little script is helpful, I just launched it and
already did one post on it's own! = Success! = Makes my life easier!
There's still a lot I need to do to make the script better. I.E. delete image after posting so I don't get repeats!! The image folder is just used organize the groups, and the beempy still reads the images from the home directory, so that could be tweaked a bit. I also need to throw the hyperlink in to the large image! Also optimizing my image, getting AI to comment on the image and describe it, lol! Tons of work too do! If anyone has any suggestions and or additions please post in the comments below!
Then I had to shut it down!
All tests worked out well, now for adding some more images and getting this set up for my other accounts! Wow I really like this Python stuff a lot!