Random Bot Post by @coininstant!!

in #python6 years ago (edited)

Random Picture Included! This post created with beem by @coininstant. Here is a random image uploaded with beempy image:x

Here is the source code that generated this post.

#!/usr/local/bin/python3 from beem.imageuploader import ImageUploader from beem import Steem import random, os if name == "main": stm = Steem() author = "coininstant" path = "/Users/nick/randompics" 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="@coininstant)") title = "Random Bot Post by @coininstant!!" body = "Random Picture Included! This post created with beem by @coininstant. "\ "Here is a random image uploaded with beempy image:![x]("\ "%s" % img_link["url"] parse_body = True self_vote = False tags = ["python", "random", "this", "beem", "just", "a", "post"] stm.post(title, body, author=author, tags=tags, parse_body=parse_body, self_vote=self_vote) Follow @coininstant for more!

Sort:  
 6 years ago  Reveal Comment