bonzanini / Book-SocialMediaMiningPython

Companion code for the book "Mastering Social Media Mining with Python"
548 stars 264 forks source link

twitter_get_user modify limits ? and how to run the code in jupyter notebook ? #5

Closed abdolrhman closed 7 years ago

abdolrhman commented 7 years ago

hello my friend @bonzanini am having a problem with this script on how i can control the amount followers or friends as twitter restricting the amount i can have so the script never finish the process it stop on getting followers and telling me that i exceed the limits ? also i want to be able to write the user i want to track and folder name , within the code it self , what code line should i modify to be able to do this ? this is very important for me as am using the code in juypter notebook , and is there a magic command or any command that i can write it in jupyter to simulate the running script process , something like writing python twitter_get_user 'userName' withing the cell in juypter notebook , to save the affort and time in modifying the code so that it can be run in juypter notebook cell thank very much for your work sir :)

abdolrhman commented 7 years ago

and about the second part , i meant is there a way , to write the python command in notebook cell , and get the result in output of the cell ?

abdolrhman commented 7 years ago

well i found the soulution the problem was in that equation max_pages = math.ceil(MAX_FRIENDS / 5000) all i had to is to make Max_Friends is >5000 rather than 15k and i changed also , the condition of making the sleep start to 1000 for the rate limit

the second question was very naive by the way , all i had to is cope the code to jupyter and delete

if len(sys.argv) != 2: usage() sys.exit(1) and replace sys.argv[1] with the name of user i want . thank you very much for the knowledge we gained from that great book :)

Jawad-repo commented 7 years ago

@Nasr-Z1. i need your help in Twitter mining data. i am new in coding. i want to extract the count of tweets to a specific event like accident. i don't know what to do please help me .

abdolrhman commented 7 years ago

well the easy way , there is a script in the book examples , called tweeter term frequency , you can use it , it will count the most used words in all of the tweets , so you will be able to see if the tweets in an race even for example how many terms for accident words . or you can build a function to check in all of the tweets(text) a list of words you want . so that the function will check all of the tweets if some of them are true (they match words you specified in the list ) then the counter will be increasing by one , etc .. good luck ^^

Jawad-repo commented 7 years ago

i have no idea of coding. i need an applicant that extract the tweets or count the tweets of an specific event

On Sun, May 28, 2017 at 12:39 PM, Nasr-Z1 notifications@github.com wrote:

well the easy way , there is a script in the book examples , called tweeter term frequency , you can use it , it will count the most used words in all of the tweets , so you will be able to see if the tweets in an race even for example how many terms for accident words . or you can build a function to check in all of the tweets(text) a list of words you want . so that the function will check all of the tweets if some of them are true (they match words you specified in the list ) then the counter will be increasing by one , etc .. good luck ^^

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bonzanini/Book-SocialMediaMiningPython/issues/5#issuecomment-304498475, or mute the thread https://github.com/notifications/unsubscribe-auth/AbqsTpXrWqSZowCvl8G6riZIBIfKmyLqks5r-SSagaJpZM4NhAD- .

-- Jawad Ahmed Abbasi Software Developer +92 342 5111231 http://jawadahmedabbasi.weebly.com