feat: Tweeper

parent abd741fe
......@@ -132,4 +132,5 @@ dmypy.json
.idea/
# Outputs
output/*.txt
output/
import os
import tweepy
from didyoumean3.didyoumean import did_you_mean
class Tweeper(object):
def __init__(self):
auth = tweepy.OAuthHandler(
os.environ["ZOO_DAWA_KEY"],
os.environ["ZOO_DAWA_KEY_SECRET"])
auth.set_access_token(
os.environ["ZOO_DAWA_TOKEN"],
os.environ["ZOO_DAWA_TOKEN_SECRET"])
self.api = tweepy.API(auth)
def tweet(self, message):
"""Tweets a message after spellchecking it."""
message = did_you_mean(message)
self.api.update_status(message)
def main():
Tweeper().tweet("tête daffiche comme la cannelle")
# Authenticate to Twitter
if __name__ == '__main__':
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment