args = sys.argv loginType = "propFile" r = praw.Reddit(user_agent='/u/gfy_mirror by /u/pandanomic') log("Retrieving login credentials", Color.BOLD) loginInfo = retrieve_login_credentials() try: r.login(loginInfo[0], loginInfo[1], disable_warning=True) log("--Login successful", Color.GREEN) except praw.errors: log("LOGIN FAILURE", Color.RED) exit_bot() imgur_client = ImgurClient(loginInfo[3], loginInfo[4]) counter = 0 if running_on_heroku: log("Heroku run", Color.BOLD) bot() else: log("Looping", Color.BOLD) while True: bot() counter += 1 log('Looped - ' + str(counter), Color.BOLD) if notify: notify_mac("Looped") time.sleep(60)
"top_liked_posts_counter": top_liked_posts_counter, "top_liked_comments_counter": top_liked_comments_counter, "total_posts_counter": total_posts_counter, "total_comments_counter": total_comments_counter, "most_active_day_counter": most_active_day_counter, "most_common_people": most_common_people, "top_posts": top_posts, "top_comments": top_comments, "total_posts": total_posts, "total_comments": total_comments, "most_active_days": most_active_days}) exportData(dataDict) args = sys.argv extend_key = False # boolean for if we want to extend token access if len(args) > 1: if "--extend" in args: # Pass in flag extend_key = True if "test" in args: test() sys.exit() else: log('No args specified') count_group_likes() notify_mac()
r = praw.Reddit(user_agent='/u/gfy_mirror by /u/pandanomic') try: log("Retrieving login credentials", Color.BOLD) loginInfo = retrieve_login_credentials() r.login(loginInfo[0], loginInfo[1]) log("--Login successful", Color.GREEN) except praw.errors: log("LOGIN FAILURE", Color.RED) exit_bot() # read off /r/soccer soccer_subreddit = r.get_subreddit('all') load_caches() counter = 0 if running_on_heroku: log("Heroku run", Color.BOLD) bot() else: log("Looping", Color.BOLD) while True: bot() counter += 1 log('Looped - ' + str(counter), Color.BOLD) if notify: notify_mac("Looped") time.sleep(60)
def __str__(self): result = "" for i in range(len(self.data) - 1): if i == 1: result += "\t\"" + str(self.schema[i]) + "\":" + "\"" + str( self.data[i]) + "\",\n" else: result += "\t\"" + str(self.schema[i]) + "\":" + str( self.data[i]) + ",\n" result += "\t\"" + str(self.schema[8]) + "\":" + "\"" + str( self.data[8]) + "\"\n" return result args = sys.argv extend_key = False # boolean for if we want to extend token access if len(args) > 1: if "--extend" in args: # Pass in flag extend_key = True if "test" in args: test() sys.exit() else: log('No args specified') count_group_likes() notify_mac()