twitter - Python- twitterstream. filter tuple error -


I am trying to filter Twitter streams for related tweets related to emotion analysis ...

 Try: Tweet: * json.loads (data) print (tweet ['created'], tweet ['text']) alchemyapi = alchemyAPI () response = ['text']) print " ['Id'] = '[' id '] dictionary [' created '] [' Doctorcentant '] ["type"] dictionary = {} dictionary [' tweet '] = tweets [' text '] dictionary [' id '] =' '] = Tw SaveFile = open ('silverweetfeeed.json', 'a') = ['emotion'] = "[reaction] [" doctorcentant "] [" type "] json_data = json.dumps (dictionary) Add SaveFile. Write (json_data) saveFile.write ('\ n') saveFile.close () Exclude the true base exclusion, e: #base exceptions because no rate limit or internet drop print 'unsuccessful turnkey', string (e) time. Slip (5) can be DF on_error (self, status): print status auth = OAuthHandler (ckey, (track) [track = ["silver" and "CFD" or "investment" or "bloomberg" or "dft" "Rally" or "investor" or "demand" or "interest rate" or "inflation" or "bullion" or "business" or "investment" or "market"]) twitterStream.filter (languages ​​= ["N"])  

But when I run it, it throws an error ...

  /PythonFiles/silverScript.py ", Line 49, & lt; modules & gt; "investment", "m File "build / bdist.macosx-10.9-intel / egg / tweepy /streaming.py", "bundle", "interest rate", "inflation", "bullion", "business", "investment", "market" , Line 330, in the filter attribute: Error: There may be no attribute 'encoded' logout in the 'Tulle' object  

Can someone suggest a more efficient filter technique or this Can help to solve the error?

This can be done by logic logic logic is. 'silver bullion' is interpreted as 'silver' and 'bullion', while ['silver', 'bullion'] > 'Silver' or 'Boolean' . Therefore, filter for all your combinations:

  twitterStream.filter (track = ['silver silver', 'silver investment', 'silver bloomberg', 'silver dft', 'silver rally 'Silver investment', 'silver demand', 'silver demand', 'silver interest rate', 'silver inflation', 'silver bullion', 'silver trade', 'silver investment', 'silver market']) / Code> 

Keep in mind that search terms are parsed as lowercase, so that your uppercase code And only more than uppercase characters matches.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -