Created
November 21, 2012 18:20
-
-
Save ryanpitts/4126646 to your computer and use it in GitHub Desktop.
A Python script using FuzzyWuzzy to find the recent @andymboyle tweet that most resembles random mashing on a keyboard.
This file contains hidden or 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
#!/usr/bin/python | |
import random | |
import string | |
import twitter | |
from fuzzywuzzy import process | |
api = twitter.Api() | |
recent_tweets = api.GetUserTimeline('andymboyle') | |
tweet_list = [tweet.text for tweet in recent_tweets] | |
random_string = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for x in range(140)) | |
best_match = process.extractOne(random_string, tweet_list) | |
print best_match |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment