Skip to content

Instantly share code, notes, and snippets.

@gagejustins gagejustins/followers.py
Last active Apr 5, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.