Skip to content

Instantly share code, notes, and snippets.

@gagejustins
Last active April 5, 2018 13:35
Show Gist options
  • Save gagejustins/7561854e1b3d5b5759285d064b10ffd8 to your computer and use it in GitHub Desktop.
Save gagejustins/7561854e1b3d5b5759285d064b10ffd8 to your computer and use it in GitHub Desktop.
Code for Twitter algorithm spotlight
import Algorithmia
input = {
"username": "elonmusk",
"auth": {
"app_key": "xxxxxxxxxx",
"app_secret": "xxxxxxxxxx",
"oauth_token": "xxxxxxxxxx",
"oauth_token_secret": "xxxxxxxxxx"
}
}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('twitter/RetrieveTwitterFollowers/0.1.0')
print(algo.pipe(input))
import Algorithmia
input = {
"username": "elonmusk",
"auth": {
"app_key": "xxxxxxxxxx",
"app_secret": "xxxxxxxxxx",
"oauth_token": "xxxxxxxxxx",
"oauth_token_secret": "xxxxxxxxxx"
}
}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('twitter/RetrieveTwitterFriends/0.1.1')
print(algo.pipe(input))
import Algorithmia
input = {
"query": "tesla",
"numTweets": "10",
"auth": {
"app_key": "xxxxxxxxxx",
"app_secret": "xxxxxxxxxx",
"oauth_token": "xxxxxxxxxx",
"oauth_token_secret": "xxxxxxxxxx"
}
}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('twitter/RetrieveTweetsWithKeyword/0.1.5')
print(algo.pipe(input))
import Algorithmia
input = {"INPUT": "something interesting"}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('OUR_ALGORITHM')
print(algo.pipe(input))
import Algorithmia
input = {
"username": "elonmusk",
"numTweets": "10",
"auth": {
"app_key": "xxxxxxxxxx",
"app_secret": "xxxxxxxxxx",
"oauth_token": "xxxxxxxxxx",
"oauth_token_secret": "xxxxxxxxxx"
}
}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('twitter/RetrieveTweetsWithUser/0.1.0')
print(algo.pipe(input))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment