3 Commits
v1.6 ... master

Author SHA1 Message Date
  Dryusdan fa1550e26a Merge branch 'improve-randomness' of framasky/masto-image-bot into master 1 year ago
  Luc Didry e5e4938479
Improve local images randomness by using random.SystemRandom() 1 year ago
  Dryusdan 67849b7f9f Remove quote for unsplash_client_id 1 year ago
2 changed files with 3 additions and 2 deletions
Split View
  1. +2
    -1
      bot.py
  2. +1
    -1
      config.sample.txt

+ 2
- 1
bot.py View File

@ -32,7 +32,8 @@ def post_img_local(mastodon, text, log, config):
continu = True;
while continu:
file = random.choice(os.listdir(img_path+"/"))
secure_random = random.SystemRandom()
file = secure_random.choice(os.listdir(img_path+"/"))
if os.path.isdir(img_path+file):
img_path = img_path+file+"/"
else:


+ 1
- 1
config.sample.txt View File

@ -10,4 +10,4 @@ spoiler_text: some text here
limit: 2
limit_hour: 10
collection_url: https://source.unsplash.com/collection/<collection>/
unsplash_client_id: "03ad5bfbaa0acd6c96a728d425e533683ec25e5fb7fcf99f6461720b3d0d75a1"
unsplash_client_id: 03ad5bfbaa0acd6c96a728d425e533683ec25e5fb7fcf99f6461720b3d0d75a1

Loading…
Cancel
Save