Hey Ritvikmath, a friend recommended your channel a few weeks back and it has been not short of excellent. Thanks for putting in this amount of work to explain data science and machine learning concepts in the most simple and plain way possible. God bless you real good.
Great video! Short, concise and straight to the point. However, to anyone having some sort of issue, you should switch the 'wb' when opening the .csv file to just 'w', since that will cause your program to expect a bytes-like object. I don't know how you got your code to work like that
Many thanks Tiago for providing the solution. I got stuck there. However this problem lies in python 3.5 but older version shall work fine with given code.
Note for Python 3 users: don't use the .encode() method on the text. Rather, just use the following parameters in the open function: open(filename, 'w', encoding='utf8'). Was losing my mind trying to figure out why I was getting bytes in my csv file.
@blownspeakersss sounds that I'm the one who wrote that comment from the future dude , I also been tryinng for 2 days before coming up with this solution. :)
Great, can you or anyone tell me how to fetch using hashtags gor specific time period? Like I am planning to fetch from 12th May 2019 to 12th July 2019.
Replace this Line of ritvikmath: with open('%s.csv'%(spreadsheetName),'wb') as file: with mine code with open('hastag%s.csv'%(spreadsheetName),'w') as file:
@@myjonpol hii. Im trying to find tweets from a specific town, but its not really working for me. It would be awesome if you may explain how you did that aww ^_^
while trying to create the account I am getting the error "You'll need an app and API key in order to authenticate and integrate with most Twitter developer products. Create an app to get your API key."
Hi!, Change this line of code " with open('%s.csv' % (fname), 'wb') as file: " to " with open('%s.csv' % (fname), 'w') as file: ", By doing this you will be able to input string data rather than binary data
Thanks for sharing this! When I set the number of items to 100,000, I only end up with e.g. 82 tweets for a particular, yet popular hashtag. For others I get more or even less. How comes? How can I work my way around this to get the desired number of tweets?
Any help with this? ModuleNotFoundError Traceback (most recent call last) in 1 import json 2 import csv ----> 3 import tweepy 4 import re 5 """ ModuleNotFoundError: No module named 'tweepy'
make sure def search_for_hashtags(consumer_key, consumer_secret, access_token, access_token_secret, hashtag_phrase): is written as above. (Case sensative) That error indicates that python can't find a defined field as search_for_hashtags'
Great question. Here is a reference from Twitter for all the cool syntax tricks you can use to get exactly what you want: developer.twitter.com/en/docs/tweets/rules-and-filtering/overview/standard-operators.html
I managed to get it to run and download the data with the helpful suggestions from the comments, thanks! BUT: in my output I don't get separate columns for date, text or hashtags. Every tweet is stored in one row without columns unlike in the output you show in the video. I don't know why. My first row reads timestamp,tweet_text,username,all_hashtags,followers_count, so they are not being separated into columns. Does someone know how to fix this? Thanks in advance!
I tried searching for hashtags that are in Korean, and I got 'utf-8' codec can't decode byte 0x98 in position 0: invalid start byte'. How can I fix this?
help please I got this error NameErrorTraceback (most recent call last) in () 7 8 if __name__ == '__main__': ----> 9 search_for_hashtags(consumer_key, consumer_secret, access_token, access_token_secret, hashtag_phrase) NameError: name 'search_for_hashtags' is not defined
This is bcoz there is some rate limits to extract data! refer this document and see how much data u can extract based on your API section developer.twitter.com/en/docs/rate-limits
"2:58""twitter automation software whitehatbox.blogspot.com/2017/08/whitehatbox-softwares-including.html" Caterina Maria Romula di Lorenzo de' Medici, nota semplicemente come Caterina de' Medici (Firenze, 13 aprile 1519 - Blois, 5 gennaio 1589), fu regina consorte di Francia, come moglie di Enrico II,
Hey Ritvikmath, a friend recommended your channel a few weeks back and it has been not short of excellent. Thanks for putting in this amount of work to explain data science and machine learning concepts in the most simple and plain way possible.
God bless you real good.
Great video! Short, concise and straight to the point. However, to anyone having some sort of issue, you should switch the 'wb' when opening the .csv file to just 'w', since that will cause your program to expect a bytes-like object. I don't know how you got your code to work like that
Many thanks Tiago for providing the solution. I got stuck there. However this problem lies in python 3.5 but older version shall work fine with given code.
Note for Python 3 users: don't use the .encode() method on the text. Rather, just use the following parameters in the open function: open(filename, 'w', encoding='utf8').
Was losing my mind trying to figure out why I was getting bytes in my csv file.
Thanks kid
Thank you :)
@blownspeakersss sounds that I'm the one who wrote that comment from the future dude , I also been tryinng for 2 days before coming up with this solution. :)
where should right this code
@@ritvikmath NameError: name 'raw_input' is not defined
thank you sir for providing this video... it helps me so much on my final project at university
Great, can you or anyone tell me how to fetch using hashtags gor specific time period? Like I am planning to fetch from 12th May 2019 to 12th July 2019.
Thank you ,i did some modifications and it worked !!
You're welcome!
This was super helpful. Thanks for this!
Thanks for the great video. How would you change the date times so we can scrap "keyword" in 2019 maybe ?
can anyone help me? In my jupter notebook, i got a type error:
TypeError: a bytes-like object is required, not 'str'
why is that?
same problem
Replace this Line of ritvikmath: with open('%s.csv'%(spreadsheetName),'wb') as file:
with mine code
with open('hastag%s.csv'%(spreadsheetName),'w') as file:
thanks for helping :)
@@shivanshsingh2869 hey, it gives the same error.
sir can you make complete detailed video how to extract tweets with images on twitter thanks alot
Hi, for some reason it creates only 200 rows of data but I ask for 1000 for example. Whats the reason behind it ?
Hi, thank you for the tutorial.
What if I want to limit the extracted tweets from a specific location (ie Country)?
did you find how to do this ? can you please share ?
@@palakagarwal3764 you need to use Stream.filter using bounding box coordinates as parameters
@@myjonpol hii. Im trying to find tweets from a specific town, but its not really working for me. It would be awesome if you may explain how you did that aww ^_^
Hi, can you make another video showing how to export tweets by user instead of by hashtag? Thanks
super vroo.
romba thx bro
while trying to create the account I am getting the error "You'll need an app and API key in order to authenticate and integrate with most Twitter developer products. Create an app to get your API key."
in my jupyter notebook, i get an error
NameError: name 'raw_input' is not defined
why is it?
replace raw_input() with input()
thanks for helping!
@ritvikmath I am getting "bytes-like object is required, not 'str' " error
Same, please help!
Hi!, Change this line of code " with open('%s.csv' % (fname), 'wb') as file: " to " with open('%s.csv' % (fname), 'w') as file: ", By doing this you will be able to input string data rather than binary data
great work man keep it up
Thanks for sharing this! When I set the number of items to 100,000, I only end up with e.g. 82 tweets for a particular, yet popular hashtag. For others I get more or even less. How comes? How can I work my way around this to get the desired number of tweets?
I feel that lately popular social media sites have been throttling the amount of data you can obtain for free :\
Beautiful, thanks!
Any help with this?
ModuleNotFoundError Traceback (most recent call last)
in
1 import json
2 import csv
----> 3 import tweepy
4 import re
5 """
ModuleNotFoundError: No module named 'tweepy'
try installing tweepy... by executing 'pip install tweepy' in your command line.
Thanks for helping!
just dropping to introduce Ritvik to Ritvik
HELLOO!!!!
Hi ritvikmath! Thanks for the video and code. Is there a way to segment country and age of the users?
please help. I need to get data with a certain date range, I have tried using SINCE and UNTIL but it doesn't work
Abdus Syakur try using an "if" statement. so.. if the date is within the given range, add it to the list
thanks a lot for this video great work!!
have u succeded to get tweets ?.
'charmap' codec can't encode character '\u30fc' in position 379: character maps to
getting this error can someone help?
Hello dear Ayesha. I am having same problem here. Did you solve it? If so, how?
'charmap' codec can't encode character
@@RodrigueTchamna just add encoding='utf-8' to with open('hastag%s.csv' %(fname), 'w+', encoding='utf-8')
How do you alter the code to see all hashtags from 2020-Jan-1 to 2020-Dec-31 for example?
please help i had an error "NameError: name 'search_for_hashtags' is not defined"
make sure
def search_for_hashtags(consumer_key, consumer_secret, access_token, access_token_secret, hashtag_phrase):
is written as above. (Case sensative) That error indicates that python can't find a defined field as search_for_hashtags'
any idea, what argument I need to use in the function to download tweets from a particular country only like 'India' only.
thank you so much this tutorial, but it would be better if location search is added...
did it work for you ?
How do you adapt it to Python 3.8.
hello ,
i am getting error that " raw_imput " cannot be found !
Where did u write code for that ?
Just use input instead of raw_input
Didn't work for me :/
Thanks for the video! Any way we can scrape using the tweet text instead of the hashtag?
You already are doing that. If you take a look at your .csv file, most of the tweets don't have the hashtag you were looking for
How can I obtain the data based on a country
Thanks for the question, maybe this documentation can help you get started: developer.twitter.com/en/docs/tutorials/filtering-tweets-by-location
every thing is working but : the CSV file is empty I trird many word but they are empyt
Could it be this easily done in R?
I'm sure there would be a way to get this same result with R
I want to extract 100000 tweets for a particular month, how to do that?
awesome stuff
Thanks!
Awesome. Thanks!
Thanks for the great video. How would you change the code to search for tweets that contain Aquaman & DC Comics in the text of the tweet?
Great question. Here is a reference from Twitter for all the cool syntax tricks you can use to get exactly what you want: developer.twitter.com/en/docs/tweets/rules-and-filtering/overview/standard-operators.html
I need your help how can I get the data tweets for specific date of time, I tried your code and working with me, Need your help badly
hey did u figure it out? I am stuck at it too!!
@@kaushikkash9108 Still not
hi ritivik , How can we get year 2010 to year 2020 filtered with keyword tweets?
sorry for the late comment but can this be done on pycharm?
I am facing issue with the code please as that is giving error as:
TypeError: a bytes-like object is required, not 'str'
you should switch the 'wb' when opening the .csv file to just 'w'
@@dwititipbeliin8008 @ You are great . i am learning python and you explain very easy . your code is working perfectly
Nice video. I am going to subscribe to your channel.
Thank you so much!
hi , did the code work for you ?
I managed to get it to run and download the data with the helpful suggestions from the comments, thanks! BUT: in my output I don't get separate columns for date, text or hashtags. Every tweet is stored in one row without columns unlike in the output you show in the video. I don't know why. My first row reads timestamp,tweet_text,username,all_hashtags,followers_count, so they are not being separated into columns. Does someone know how to fix this? Thanks in advance!
when you write row make sure use ' ' and , every row you need
the link Create new twitter app is not working any solutions ????
I have UnicodeEncodeError , i see lang = "en" it didnt get only en text ? i got greek and can not encode 0....0
I tried searching for hashtags that are in Korean, and I got 'utf-8' codec can't decode byte 0x98 in position 0: invalid start byte'. How can I fix this?
If I want to fetch profile data of a user whom I am visiting on Twitter, then how we can fetch it without our login? Please tell
where i have to put consumer key etc i cant understand
The hashtag phrase is a string?
Sir how to seperate tweets based on States
do i need a developer account to create an application?
amazing work done(Y)
I am getting tweep Error with status code =400. Wat does it mean?
May I Know How To Analyze Instagram Data Using Big data Ecosystem.....?
NameError: name 'raw_input' is not defined any hints?
Me nether!
@@greendayacdcify hi I'm getting name error:name 'search_for_hashtags'not defined how do I fix it
@@greendayacdcify I used the exact same code used in this program everything is the same
help please I got this error
NameErrorTraceback (most recent call last)
in ()
7
8 if __name__ == '__main__':
----> 9 search_for_hashtags(consumer_key, consumer_secret, access_token, access_token_secret, hashtag_phrase)
NameError: name 'search_for_hashtags' is not defined
did you find a solution to this?
when i put C:\users\Aamir\Anaconda3 it says syntax error how to remove this error
Try '/' instead of '\'
Maybe it will work
NameError Traceback (most recent call last)
in
----> 1 consumer_key = raw_input("Consumer Key ")
2 consumer_secret = raw_input('Consumer Secret ')
3 access_token = raw_input('Access Token ')
4 access_token_secret = raw_input('Access Token Secret ')
5
NameError: name 'raw_input' is not defined
replace raw_input() with input()
Thank you!
It does not work if i put two hashtags like #cocacola AND #france don't get why help pleaaaaaase !!!!!!!!!!!!!!!!!!!!!!!
very veryy help me.. thx you so much
I am trying to collect over 2 lakhs tweets with tag #sarcasm but the program outputs only upto 2647 tweets plz help
This is bcoz there is some rate limits to extract data! refer this document and see how much data u can extract based on your API section developer.twitter.com/en/docs/rate-limits
@@kaushikkash9108 bhai hogaya project banakar and this Corona Shit stopped the final Exams, Thanks btw to reply.
Totally failed to installed tweepy am using python 3.7.2
did you try pip install tweepy, or pip3 install tweepy from your terminal?
TweepError: Twitter error response: status code = 401
"2:58""twitter automation software
whitehatbox.blogspot.com/2017/08/whitehatbox-softwares-including.html" Caterina Maria Romula di Lorenzo de' Medici, nota semplicemente come Caterina de' Medici (Firenze, 13 aprile 1519 - Blois, 5 gennaio 1589), fu regina consorte di Francia, come moglie di Enrico II,
grazie all'aiuto di *CYBER_NEWTON001* su instagram il mio account sospeso è tornato è molto eccellente👍👍👍
grazie all'aiuto di *CYBER_NEWTON001* su instagram il mio account sospeso è tornato è molto eccellente👍👍👍
grazie all'aiuto di *CYBER_NEWTON001* su instagram il mio account sospeso è tornato è molto eccellente👍👍👍