Mike Verdone [Sat, 24 May 2014 10:41:21 +0000 (12:41 +0200)]
Merge pull request #227 from mponweiser/master
twitter-archiver: Option file path fixed for Windows
Hi, similar to the fix for issue https://github.com/sixohsix/twitter/issues/60, I have adapted the file path for twitter-archiver to work in Windows. Tested under Ubuntu 12.04 and Windows 7, Python 2.7.
Notes:
* 2.6, 2.7, 3.3 pass.
* 3.4 isn't quite yet available, but is coming soon: https://github.com/travis-ci/travis-ci/issues/1989#issuecomment-39315535
* 3.2 fails because it doesn't have u'uncode stuff' but I guess most Py3 users will be ok with 3.3 or 3.4.
* I've not looked into why pypy fails.
* (This PR also contains the same changes as PR #220.)
Mike Verdone [Tue, 15 Apr 2014 14:55:06 +0000 (16:55 +0200)]
Merge pull request #217 from sixohsix/pickled
Support pickling at the risk of breaking some stuff
- support pickling of responses (#82)
- silence Python 2.6 warning (#179)
- this makes rate-limit headers unavailable on boolean or string responses. I'm not sure if that's a problem.
Mike Verdone [Mon, 24 Mar 2014 20:19:47 +0000 (21:19 +0100)]
Merge pull request #215 from wlonk/colorization
Colorization
I've added some logic to align usernames and wrap tweets. It's preliminary, but hopefully useful. I have tied it in to the ANSI format, because that seems the most human-oriented format.
I'm happy to talk about this more and go back and forth on it, and I hope it's useful!
Mike Verdone [Mon, 24 Mar 2014 20:00:27 +0000 (21:00 +0100)]
Merge pull request #216 from edi-bice/master
--follow-redirects hangs indefinitely on certain urls
urllib2 opener open lacked a timeout parameter causing it to hang indefinitely on certain URLs where the host does not send back any data - added timeout=1 for now and will expose as parameter later - also added socket.timeout exception to list of exceptions handled
Edi Bice [Fri, 21 Mar 2014 20:36:58 +0000 (16:36 -0400)]
urllib2 opener open lacked a timeout parameter causing it to hang indefinitely on certain URLs where the host does not send back any data - added timeout=1 for now and will expose as parameter later - also added socket.timeout exception to list of exceptions handled
Mike Verdone [Thu, 20 Mar 2014 17:45:44 +0000 (18:45 +0100)]
Merge pull request #214 from edi-bice/master
Fixed broken rate limiting error handling in archiver/follow.
Twitter changed rate limiting response objects quite a bit in v1.1.
In addition there were bugs due to import of time module and time object from datetime module.
Edi Bice [Thu, 20 Mar 2014 17:21:10 +0000 (13:21 -0400)]
Fixed broken rate limiting error handling in archiver/follow.
Twitter changed rate limiting response objects quite a bit in v1.1.
In addition there were bugs due to import of time module and time object from datetime module.
Mike Verdone [Wed, 12 Mar 2014 20:34:44 +0000 (21:34 +0100)]
Merge pull request #210 from sixohsix/stream_cleanup_two
Stream cleanup twoSecond time... or third time's a charm. I hope this is it.
- code is actually understandable
- NO MORE UNICODE ERRORS
- NO MORE 100% CPU usage
- return data chunks ASAP
- handle "old school" non-blocking mode (for those who still want it)
- works on all stream servers I have access to
Mike Verdone [Sun, 9 Mar 2014 21:11:15 +0000 (22:11 +0100)]
Merge pull request #205 from sixohsix/stream_cleanup
Explicit support for heartbeat handling
Yet another crack at the stream iterator.
Now we explicitly track timeouts and heartbeat timeouts separately. Regular timeouts produce `Timeout` tokens (dicts). Heartbeat timeouts produce `HeartbeatTimeout` and StopIteration if iterated again. This is a solid fix for issue #202.
If the stream is set to use `timeout=None, block=False`, then we yield only data or `None`. If `timeout` is set to a number, we yield data or `Timeout` tokens, never `None`. If we are set to `block=True` then we yield only data.
Also: improve the documentation and remove some code weirdness.
Also: make the example stream program highly configurable to test every bizarre combination from the command line.
Mike Verdone [Mon, 17 Feb 2014 21:29:35 +0000 (22:29 +0100)]
Merge pull request #203 from RouxRC/pr-fix-timeout
Fix streams timeout & hangup behavior + ensure python2.6 compat
Here are the changes to fix the misbehavior of the timeout in case of low tweets by catching Twitter's keep-alive heartbeat signals thanks to the select.select originally added in #178 and still problematic as pointed out by @ksecrist in #202
I also generalized the hangup to all cases since there is no reason to stay in infinite loop after a hangup in non-blocking mode.
And to make things easier and avoid merging issues, I adapted the refacto and fixed python2.6 compatibility from @adonoho's #201