def tweet(): message = generate(dirty=False) consumer_key = os.environ.get("TWITTER_CONSUMER_KEY") consumer_secret = os.environ.get("TWITTER_CONSUMER_SECRET") access_token = os.environ.get("TWITTER_ACCESS_TOKEN") access_token_secret = os.environ.get("TWITTER_ACCESS_TOKEN_SECRET") auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) api.update_status(message)
def get_horoscope(): return render_template("horoscope.html", horoscope=horoscope.generate())
def get_dirty_horoscope(): return render_template("horoscope.html", horoscope=horoscope.generate(dirty=True))
from bullshit.horoscope import generate message = generate(dirty=False) print(message)