Giter VIP home page Giter VIP logo

oldtweets's People

Contributors

karlcow avatar nud avatar olivierthereaux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

oldtweets's Issues

httplib.BadStatusLine error - need logging module

A new issue arose. I haven't found yet why but it seems consistent and reproducible. Which makes me think that there is a missing module for logging in the code.

→ time cat credentials.txt | ./oldtweets.py --delete >> tweets-bkp.txt

Traceback (most recent call last):
  File "./oldtweets.py", line 130, in <module>
    sys.exit(main())
  File "./oldtweets.py", line 109, in main
    tweets_ids += [status.id for status in api.GetUserTimeline(page=i + 1, count=100)]
  File "/Library/Python/2.7/site-packages/twitter.py", line 2680, in GetUserTimeline
    json = self._FetchUrl(url, parameters=parameters)
  File "/Library/Python/2.7/site-packages/twitter.py", line 3794, in _FetchUrl
    response = opener.open(url, encoded_post_data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 392, in open
    response = self._open(req, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 410, in _open
    '_open', req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 370, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1194, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1157, in do_open
    r = h.getresponse(buffering=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1013, in getresponse
    response.begin()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 402, in begin
    version, status, reason = self._read_status()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 366, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine: ''

real    13m0.195s
user    0m0.468s
sys 0m0.138s

Run into issues with special characters

Error output is
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0ca0' in position 13: ordinal not in range(128)

I was able to get around this by replacing
str(tweet.text).replace('\n', '').replace('\r', '')
with
tweet.text.encode('utf-8').strip()

Not sure it is a better replacement but it worked for me.

oldtweets crash

A little issue. when using

→ cat credentials.txt | ./oldtweets.py

Not sure yet why. It seems it might be related to GetUserTimeline. I wonder if twitter modified the format.

Traceback (most recent call last):
  File "./oldtweets.py", line 131, in <module>
    sys.exit(main())
  File "./oldtweets.py", line 110, in main
    tweets_ids += [status.id for status in api.GetUserTimeline(page=i+1, count=100)]
  File "/Library/Python/2.7/site-packages/twitter.py", line 2680, in GetUserTimeline
    json = self._FetchUrl(url, parameters=parameters)
  File "/Library/Python/2.7/site-packages/twitter.py", line 3794, in _FetchUrl
    response = opener.open(url, encoded_post_data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 392, in open
    response = self._open(req, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 410, in _open
    '_open', req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 370, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1194, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1157, in do_open
    r = h.getresponse(buffering=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1013, in getresponse
    response.begin()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 402, in begin
    version, status, reason = self._read_status()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 366, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine: ''

GetUserTimeline not working anymore.

I'm not sure what is wrong yet. But it seems there is an issue.

→ cat credentials.txt | ./oldtweets.py --dry-run

Traceback (most recent call last):
  File "./oldtweets.py", line 138, in <module>
    sys.exit(main())
  File "./oldtweets.py", line 103, in main
    add_statuses = api.GetUserTimeline(count=200, include_rts=True,    page=timeline_page)
TypeError: GetUserTimeline() got an unexpected keyword argument 'page'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.