Skip to content

Extract Tweets from twitter search without using the official API

License

Notifications You must be signed in to change notification settings

dtuit/TwitterWebsiteSearch

Repository files navigation

#TwitterWebsiteSearch

TwitterWebsiteSearch is a small python script for searching and saving data from Twitter.com search without using the official API.

##Data Format Tweets extracted, are formatted similarly to the official API, detailed here

each tweet is a python dict with the following structure.

{
	'created_at' : UTC-datetime format '%Y-%m-%d %H:%M:%S' ,
	'id_str' : "",
	'text' : "",
	'entities': {
		'hashtags': [],
		'symbols':[],
		'user_mentions':[],
		'urls':[],
		'media'[] optional
		},
	'user' : {
		'id_str' : "",
		'name' : "",
		'screen_name': "",
		'profile_image_url': "",
		'verified': bool
		},
	'retweet_count' : 0,
	'favorite_count' : 0,
	'is_quote_status' : False,
	'in_reply_to_user_id': None,
	'in_reply_to_screen_name' : None,
	'contains_photo': False,
	'contains_video': False
}

##Usage create your query using twitter advanced search
note: pass the query without url encoding.

	import TwitterWebsiteSearch

	TitterPageIterator = TwitterWebsiteSearch.TwitterPager().get_iterator('#python')

	count = 0
	for page in TitterPageIterator:
		for tweet in page['tweets']:
			print("{0} id: {1} text: {2}".format(count, tweet['id_str'], tweet['text']))
			count += 1

###Dependencies

###Twitter Search Guide

About

Extract Tweets from twitter search without using the official API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published