diff --git a/CHANGELOG.md b/CHANGELOG.md index 43986b08fb7009899e5d4a73a18e86a7613faa0e..ceca741edd67be1a05830e3aa1e4592bfe02332f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## 20 aout 2019 **Ajout:** - shitpostbot5000 latest post every 30' --trigger coucou coucou -> coucoucou +- trigger coucou coucou -> coucoucou +- can send a random image from a insta hashtag page ## 19 aout 2019 **Ajout:** diff --git a/useless/shitpostbot5k.py b/useless/shitpostbot5k.py index 7995bfb3878a495d49aba8abd3dac2a069579cc2..b271167b4a74812c9112e72eb16c7411b49a1073 100755 --- a/useless/shitpostbot5k.py +++ b/useless/shitpostbot5k.py @@ -58,7 +58,11 @@ class Shitpostbot5000(object): return links @classmethod - def random(self, hashtag=random.choice(['shitpostmeme', 'shitpost', 'shitposts', 'memes', 'climbingmemes', 'rockclimbingmemes', 'climbingmemesaredank', 'climbingmemesofinstagram'])): + def random(self, hashtag=''): + if hashtag.strip() == '': + hashtag = random.choice(['shitpostmeme', 'shitpost', 'shitposts', 'memes']) + elif hashtag.strip() == 'climbing': + hashtag = random.choice(['climbingmemes', 'rockclimbingmemes', 'climbingmemesaredank', 'climbingmemesofinstagram']) self.ctx = ssl.create_default_context() self.ctx.check_hostname = False self.ctx.verify_mode = ssl.CERT_NONE