Created
March 4, 2015 14:33
-
-
Save yrsegal/153aca5141744835a0f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shitpost | |
import tweepy | |
import time | |
import json | |
import os | |
import sys | |
TWITTER_CONSUMER_KEY = "" | |
TWITTER_CONSUMER_SECRET = "" | |
TWITTER_ACCESS_KEY = "" | |
TWITTER_ACCESS_SECRET = "" | |
auth = tweepy.OAuthHandler(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET) | |
auth.set_access_token(TWITTER_ACCESS_KEY, TWITTER_ACCESS_SECRET) | |
api = tweepy.API(auth) | |
def main(): | |
path = os.path.dirname(sys.argv[0]) | |
while True: | |
config = json.load(open(os.path.join(path, "shitpostconfig.json"))) | |
text = shitpost.generate(debug=True) | |
print(text) | |
print(" ") | |
api.update_status(text) | |
slept = 0 | |
while slept < config["time"]: | |
config = json.load(open(os.path.join(path, "shitpostconfig.json"))) | |
if not slept % config["notifytime"] and slept != 0: print("Slept "+str(slept)+" seconds.") | |
time.sleep(1) | |
slept += 1 | |
if __name__ == "__main__": main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment