ptwobrussell / recipes-for-mining-twitter Goto Github PK
View Code? Open in Web Editor NEWAdaptations and Extensions of Twitter-Related Examples from Mining the Social Web
Home Page: http://amzn.to/d1Ci8A
Adaptations and Extensions of Twitter-Related Examples from Mining the Social Web
Home Page: http://amzn.to/d1Ci8A
got this error for recipe__streaming_api.py
Traceback (most recent call last):
File "stream_tweepy.py", line 65, in
streaming_api = tweepy.streaming.Stream(auth, CustomStreamListener(), timeout=60)
TypeError: init() takes at least 4 non-keyword arguments (3 given)
Hi,
thanks for your example on using tweepy for mining Twitter.
I installed tweepy (version 1.7.1), copied your code and inserted the details I got from Twitter.
However, I get the following error message on debugging:
Traceback (most recent call last):
File "C:\Programming\Scripts\test.py", line 65, in
streaming_api = tweepy.streaming.Stream(auth, CustomStreamListener(), timeout=60)
TypeError: init() takes at least 4 arguments (4 given)
Do you have experienced the same issue?
Thanks for your help,
majom
Traceback (most recent call last):
While i try to execute this file, i am getting this error,what should i do?
File "C:\Users\TOSHIBA\Desktop\py.PY", line 39, in
oauth_login(APP_NAME, CONSUMER_KEY, CONSUMER_SECRET)
File "C:\Users\TOSHIBA\Desktop\py.PY", line 17, in oauth_login
consumer_secret)
File "build\bdist.win-amd64\egg\twitter\oauth_dance.py", line 35, in oauth_dance
twitter.oauth.request_token())
File "build\bdist.win-amd64\egg\twitter\api.py", line 159, in call
arg_data = self.auth.encode_params(uriBase, method, kwargs)
File "build\bdist.win-amd64\egg\twitter\oauth.py", line 105, in encode_params
enc_params = urlencode_noplus(sorted(params.items()))
File "build\bdist.win-amd64\egg\twitter\oauth.py", line 132, in urlencode_noplus
return urlencode(query, safe='~').replace("+", "%20")
TypeError: urlencode() got an unexpected keyword argument 'safe'
The other recipes for visualizing retweet relationships work well, but I am stumped by this error for 1-16. Here's the traceback:
Traceback (most recent call last):
File "recipe__visualize_rt_graph_protovis.py", line 85, in
write_protovis_output(g, f, HTML_TEMPLATE)
File "recipe__visualize_rt_graph_protovis.py", line 33, in write_protovis_output
html = open(html_template).read() % (json_data,)
TypeError: not all arguments converted during string formatting
Any ideas?
Hi there!
I was trying out the Summarizing Link Target and i received the following error:
( i named the file as twitter_solution.py )
Traceback (most recent call last):
File "twitter_solution.py", line 127, in
summary = summarize(clean_page)
File "twitter_solution.py", line 76, in summarize
sentences = [s for s in nltk.tokenize.sent_tokenize(txt)]
File "/usr/lib/pymodules/python2.6/nltk/tokenize/init.py", line 43, in sent_tokenize
tokenizer = nltk.data.load('tokenizers/punkt/english.pickle')
File "/usr/lib/pymodules/python2.6/nltk/data.py", line 590, in load
resource_val = pickle.load(_open(resource_url))
File "/usr/lib/pymodules/python2.6/nltk/data.py", line 669, in _open
return find(path).open()
File "/usr/lib/pymodules/python2.6/nltk/data.py", line 439, in find
try: return find(modified_name)
File "/usr/lib/pymodules/python2.6/nltk/data.py", line 429, in find
try: return ZipFilePathPointer(p, zipentry)
File "/usr/lib/pymodules/python2.6/nltk/data.py", line 306, in init
zipfile = OpenOnDemandZipFile(os.path.abspath(zipfile))
File "/usr/lib/pymodules/python2.6/nltk/data.py", line 721, in init
zipfile.ZipFile.init(self, filename)
File "/usr/lib/python2.6/zipfile.py", line 696, in init
self._GetContents()
File "/usr/lib/python2.6/zipfile.py", line 716, in _GetContents
self._RealGetContents()
File "/usr/lib/python2.6/zipfile.py", line 728, in _RealGetContents
raise BadZipfile, "File is not a zip file"
zipfile.BadZipfile: File is not a zip file
May i know if there's anything wrong ?
I am using NLTK 2.0b8 on my Ubuntu 10.04 computer.
May i know how do i fix this issue ?
Thanks!
Hi,
First of all, thank you for writing the book and releasing the code!
I am having some issues in running the example.
After installing the required packages such as networkx and twitter package,
I ran recipe__visualize_rt_graph_protovis.py by typing the following:
$: ecipe__visualize_rt_graph_protovis.py japan
Than i received the following error:
Traceback (most recent call last):
File "recipe__visualize_rt_graph_protovis.py", line 71, in
page=page))
File "/usr/local/lib/python2.6/dist-packages/twitter-1.6-py2.6.egg/twitter/api.py", line 150, in call
return self._handle_response(req, uri, arg_data)
File "/usr/local/lib/python2.6/dist-packages/twitter-1.6-py2.6.egg/twitter/api.py", line 165, in _handle_response
raise TwitterHTTPError(e, uri, self.format, arg_data)
twitter.api.TwitterHTTPError: Twitter sent status 404 for URL: 1/search.json using parameters: (q=japan&rpp=100&page=1)
details:
You may have mistyped the address or the page may have moved.
May I know what am I doing wrong?
Am I missing something?
Best Regards,
Eugene
HI
when I try to run the above code exactly as in this example I get two errors:
When I try pass just the 'auth' parameter the above error comes. I've upgraded tweepy to 1.7.1 and still the same error.
The code is exactly as yours and the argv i'm passing is something like JustinBieber and other high volume queriies.
Thanks
Hi, when I run the code for the trends recipe I get this error:
"errors": [{"message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68. Kindly advise
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.