Ejemplo n.º 1
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(TWITTER_OAUTH_TOKEN, TWITTER_OAUTH_SECRET,
                       TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET)

    df = tp.friends(limit=10)
    print(df.head())

    df = tp.followers(limit=10)
    print(df.head())

    df = tp.me()
    print(df)

    df = tp.get_user(screen_name='willmcginnis')
    print(df)

    df = tp.search_users(query='willmcginnis', limit=10)
    print(df)

    print(tp.api_screen_name)
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(
        TWITTER_OAUTH_TOKEN,
        TWITTER_OAUTH_SECRET,
        TWITTER_CONSUMER_KEY,
        TWITTER_CONSUMER_SECRET
    )

    user_id = tp.api_id

    df = tp.favorites(id_=user_id, limit=10)
    print(df.head())
Ejemplo n.º 3
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(TWITTER_OAUTH_TOKEN, TWITTER_OAUTH_SECRET,
                       TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET)

    print(tp.api_id)
Ejemplo n.º 4
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(
        TWITTER_OAUTH_TOKEN,
        TWITTER_OAUTH_SECRET,
        TWITTER_CONSUMER_KEY,
        TWITTER_CONSUMER_SECRET
    )

    df = tp.rate_limit_status()
    print(df.head())
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(
        TWITTER_OAUTH_TOKEN,
        TWITTER_OAUTH_SECRET,
        TWITTER_CONSUMER_KEY,
        TWITTER_CONSUMER_SECRET
    )

    user_id = tp.api_id

    df = tp.home_timeline(limit=10)
    print(df.head())

    df = tp.statuses_lookup(id_=[x for x in df['id'].values], limit=10)
    print(df.head())

    df = tp.user_timeline(id_=user_id, limit=10)
    print(df.head())

    df = tp.retweets_of_me(limit=10)
    print(df.head())
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'freddievargus'

if __name__ == '__main__':
    tp = TwitterPandas(
        TWITTER_OAUTH_TOKEN,
        TWITTER_OAUTH_SECRET,
        TWITTER_CONSUMER_KEY,
        TWITTER_CONSUMER_SECRET
    )

    df = tp.saved_searches()
    print(df.head(), '\n')
    print(df.info(), '\n\n')

    search_id = df[['id_str']].values[0][0]
    df = tp.get_saved_search(search_id)
    print(df, '\n')
    print(df.info())
Ejemplo n.º 7
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(TWITTER_OAUTH_TOKEN, TWITTER_OAUTH_SECRET,
                       TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET)

    user_id = tp.api_id

    print('\n\nTRENDS AVAILABLE')
    df = tp.trends_available()
    print(df.shape)

    print('\n\nTRENDS PLACE')
    df = tp.trends_place(id_=1)
    print(df.shape)

    print('\n\nTRENDS CLOSEST')
    df = tp.trends_closest(lat=33.74, long=84.38)
    print(df.shape)
Ejemplo n.º 8
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(
        TWITTER_OAUTH_TOKEN,
        TWITTER_OAUTH_SECRET,
        TWITTER_CONSUMER_KEY,
        TWITTER_CONSUMER_SECRET
    )

    user_id = tp.api_id

    df = tp.lists()
    print(df.head())

    df = tp.lists_memberships()
    print(df.head())

    df = tp.lists_subscriptions()
    print(df.head()) # returning empty

    df = tp.list_timeline(owner='knanne', slug='data-science', limit=5)
    print(df.head())

    # TODO: broken in tweepy: https://github.com/tweepy/tweepy/issues/697
    # df = tp.get_list(owner='knanne', slug='data-science', limit=5)
    # print(df.head())
    #
Ejemplo n.º 9
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(
        TWITTER_OAUTH_TOKEN,
        TWITTER_OAUTH_SECRET,
        TWITTER_CONSUMER_KEY,
        TWITTER_CONSUMER_SECRET
    )

    user_id = tp.api_id

    print('\n\nTRENDS AVAILABLE')
    df = tp.trends_available()
    print(df.shape)

    print('\n\nTRENDS PLACE')
    df = tp.trends_place(id_=1)
    print(df.shape)

    print('\n\nTRENDS CLOSEST')
    df = tp.trends_closest(lat=33.74, long=84.38)
    print(df.shape)
Ejemplo n.º 10
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'freddievargus'

if __name__ == '__main__':
    tp = TwitterPandas(
        TWITTER_OAUTH_TOKEN,
        TWITTER_OAUTH_SECRET,
        TWITTER_CONSUMER_KEY,
        TWITTER_CONSUMER_SECRET
    )

    df = tp.direct_messages()
    print(df.head(), '\n')
    print(df.info(), '\n\n')

    dm_id = df[['id_str']].values[0][0]
    df = tp.get_direct_message(id_=dm_id)
    print(df.head(), '\n')
    print(df.info(), '\n\n')

    df = tp.sent_direct_messages()
    print(df.head(), '\n')
    print(df.info(), '\n\n')
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'freddievargus'

if __name__ == '__main__':
    tp = TwitterPandas(TWITTER_OAUTH_TOKEN, TWITTER_OAUTH_SECRET,
                       TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET)

    df = tp.saved_searches()
    print(df.head(), '\n')
    print(df.info(), '\n\n')

    search_id = df[['id_str']].values[0][0]
    df = tp.get_saved_search(search_id)
    print(df, '\n')
    print(df.info())
Ejemplo n.º 12
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'keyanvakil'

if __name__ == '__main__':
    # create a twitter pandas client object
    tp = TwitterPandas(TWITTER_OAUTH_TOKEN, TWITTER_OAUTH_SECRET,
                       TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET)

    user_id = tp.api_id

    # example tweet with >100 retweets
    # https://twitter.com/BoredElonMusk/status/611549517322715136
    tweet = 611549517322715136

    # second example tweet with >100 retweets
    # https://twitter.com/jack/status/20
    # tweet = 20

    df = tp.get_status(id_=tweet)
    print(df.head())
    print('\n')
    print(df.info())
    print('\n\n')

    # return dataframe with info on first five retweets
    df = tp.retweets(id_=tweet, count=5)
    print(df.head())
    print('\n')
    print(df.info())
Ejemplo n.º 13
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'keyanvakil'

if __name__ == '__main__':
	# create a twitter pandas client object
	tp = TwitterPandas(
	    TWITTER_OAUTH_TOKEN,
	    TWITTER_OAUTH_SECRET,
	    TWITTER_CONSUMER_KEY,
 	    TWITTER_CONSUMER_SECRET
	)

	user_id = tp.api_id

	# example tweet with >100 retweets
	# https://twitter.com/BoredElonMusk/status/611549517322715136
	tweet = 611549517322715136
	
	# second example tweet with >100 retweets
	# https://twitter.com/jack/status/20
	# tweet = 20

	df = tp.get_status(id_=tweet)
	print(df.head())
	print('\n')
	print(df.info())
	print('\n\n')

	# return dataframe with info on first five retweets
Ejemplo n.º 14
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(
        TWITTER_OAUTH_TOKEN,
        TWITTER_OAUTH_SECRET,
        TWITTER_CONSUMER_KEY,
        TWITTER_CONSUMER_SECRET
    )

    df = tp.followers(limit=10)
    print(df.head())

    df = tp.me()
    print(df)

    df = tp.get_user(screen_name='willmcginnis')
    print(df)

    df = tp.search_users(query='willmcginnis', limit=10)
    print(df)

    print(tp.api_screen_name)
Ejemplo n.º 15
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(TWITTER_OAUTH_TOKEN, TWITTER_OAUTH_SECRET,
                       TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET)

    user_id = tp.api_id

    df = tp.home_timeline(limit=10)
    print(df.head())

    df = tp.statuses_lookup(id_=[x for x in df['id'].values], limit=10)
    print(df.head())

    df = tp.user_timeline(id_=user_id, limit=10)
    print(df.head())

    df = tp.retweets_of_me(limit=10)
    print(df.head())
Ejemplo n.º 16
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(TWITTER_OAUTH_TOKEN, TWITTER_OAUTH_SECRET,
                       TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET)

    user_id = tp.api_id

    df = tp.favorites(id_=user_id, limit=10)
    print(df.head())
Ejemplo n.º 17
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'keyanvakil'

if __name__ == '__main__':
    # create a twitter pandas client object
    tp = TwitterPandas(TWITTER_OAUTH_TOKEN, TWITTER_OAUTH_SECRET,
                       TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET)

    user_id = tp.api_id

    df = tp.followers_ids(id_=user_id)
    print(df.head())
    print('\n')
    print(df.info())
    print('\n\n')

    df = tp.friends_ids(id_=user_id)
    print(df.head())
    print('\n')
    print(df.info())
    print('\n\n')

    friend_id = df[0][0]
    print("friend_id = " + str(friend_id))

    print("Does user_id follow friend_id")
    if (tp.exists_friendship(source_id=user_id, target_id=friend_id)):
        print("True")
        df = tp.show_friendship(source_id=user_id, target_id=friend_id)
Ejemplo n.º 18
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(TWITTER_OAUTH_TOKEN, TWITTER_OAUTH_SECRET,
                       TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET)

    user_id = tp.api_id

    df = tp.lists()
    print(df.head())

    df = tp.lists_memberships()
    print(df.head())

    df = tp.lists_subscriptions()
    print(df.head())  # returning empty

    df = tp.list_timeline(owner='knanne', slug='data-science', limit=5)
    print(df.head())

    # TODO: broken in tweepy: https://github.com/tweepy/tweepy/issues/697
    # df = tp.get_list(owner='knanne', slug='data-science', limit=5)
    # print(df.head())
    #
    # df = tp.list_subscribers(owner='knanne', slug='data-science', limit=5)
    # print(df.head())
Ejemplo n.º 19
0
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY

__author__ = 'willmcginnis'

if __name__ == '__main__':
    tp = TwitterPandas(TWITTER_OAUTH_TOKEN, TWITTER_OAUTH_SECRET,
                       TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET)

    df = tp.rate_limit_status()
    print(df.head())