def boost_post(self, votes): for i in tqdm(range(votes)): tmpClient = RESTClient(self.location, None) tmpClient.upvote(self.last_post) tmpClient.close()
var = str(raw_input("[ up / down / exit ] : ")) commands = {'up', 'down', 'exit'} if var == 'exit': break id = post['post_id'] if var not in commands: continue elif var =='exit': break else: amount = int(raw_input('# Wie viel ? ')) for i in tqdm(range(amount)): rc = RESTClient(uni, None) try: if var == "up": rc.upvote(id) elif var == "down": rc.downvote(id) except ValueError: print "! Vote Fehler !" rc.close() continue rc.close() print '\n\n----------------------------\n'
continue elif var == 'exit': break elif var == 'comment': comment = str(raw_input('# Comment ? ')) rc.post_comment(id, comment) print '\n\n----------------------------\n' elif var == 'view': if 'children' not in post: print "No comments ! \n\n----------------------------\n" continue for comment in post['children']: print "[%s] %s\n" % (comment['vote_count'], comment['message'].encode('UTF-8')) else: amount = int(raw_input('# Wie viel ? ')) for i in tqdm(range(amount)): rc = RESTClient(uni, None) try: if var == "up": rc.upvote(id) elif var == "down": rc.downvote(id) except ValueError: print "! Vote Fehler !" rc.close() continue rc.close() print '\n\n----------------------------\n'