]> jfr.im git - z_archive/twitter.git/log
z_archive/twitter.git
10 years agoMerge pull request #215 from wlonk/colorization twitter-1.14.2
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!

10 years agoMerge pull request #216 from edi-bice/master
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

10 years agourllib2 opener open lacked a timeout parameter causing it to hang indefinitely on...
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

10 years agoUsing upstream ANSI colors.
Kit La Touche [Fri, 21 Mar 2014 16:42:02 +0000 (10:42 -0600)] 
Using upstream ANSI colors.

10 years agoCorrections to width numbers.
Kit La Touche [Thu, 13 Jun 2013 03:50:42 +0000 (21:50 -0600)] 
Corrections to width numbers.

10 years agoImproved display of multiline tweets.
Kit La Touche [Thu, 13 Jun 2013 03:49:04 +0000 (21:49 -0600)] 
Improved display of multiline tweets.

10 years agoOops, left debugging cruft on there.
Kit La Touche [Thu, 13 Jun 2013 03:30:45 +0000 (21:30 -0600)] 
Oops, left debugging cruft on there.

10 years agoAdded spacing for usernames.
Kit La Touche [Thu, 13 Jun 2013 03:29:23 +0000 (21:29 -0600)] 
Added spacing for usernames.

10 years agoMerge pull request #214 from edi-bice/master
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.

10 years agoFixed broken rate limiting error handling in archiver/follow.
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.

10 years agoMerge pull request #213 from RouxRC/fix-twitterrate
Mike Verdone [Wed, 19 Mar 2014 14:27:19 +0000 (15:27 +0100)] 
Merge pull request #213 from RouxRC/fix-twitterrate

Fix routing to rate_limit_status calls (Fix #157)

10 years agoFix routing to rate_limit_status calls (Fix #157)
RouxRC [Wed, 19 Mar 2014 00:59:15 +0000 (01:59 +0100)] 
Fix routing to rate_limit_status calls (Fix #157)

10 years agoVersion 1.14.1. twitter-1.14.1
Mike Verdone [Wed, 12 Mar 2014 20:41:32 +0000 (21:41 +0100)] 
Version 1.14.1.

10 years agoMerge pull request #211 from justinclift/master
Mike Verdone [Wed, 12 Mar 2014 20:35:34 +0000 (21:35 +0100)] 
Merge pull request #211 from justinclift/master

Trivial typo fix

10 years agoMerge pull request #212 from justinclift/friends_timeline_update
Mike Verdone [Wed, 12 Mar 2014 20:35:09 +0000 (21:35 +0100)] 
Merge pull request #212 from justinclift/friends_timeline_update

Update README with friends_timeline() replacement

10 years agoMerge pull request #210 from sixohsix/stream_cleanup_two
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

10 years agoTrivial typo fixes
Justin Clift [Tue, 11 Mar 2014 03:27:32 +0000 (03:27 +0000)] 
Trivial typo fixes

10 years agoUpdate README with friends_timeline() replacement
Justin Clift [Tue, 11 Mar 2014 03:03:56 +0000 (03:03 +0000)] 
Update README with friends_timeline() replacement

10 years agoWe don't need range.
Mike Verdone [Mon, 10 Mar 2014 23:47:19 +0000 (00:47 +0100)] 
We don't need range.

10 years agoRemove a pdb. Handle very long timeouts better.
Mike Verdone [Mon, 10 Mar 2014 23:32:25 +0000 (00:32 +0100)] 
Remove a pdb. Handle very long timeouts better.

10 years agoHandle old-school non-blocking.
Mike Verdone [Mon, 10 Mar 2014 22:53:20 +0000 (23:53 +0100)] 
Handle old-school non-blocking.

10 years agoSimplify code. Produce data faster by handling bizarre CRLF behaviour.
Mike Verdone [Mon, 10 Mar 2014 22:26:54 +0000 (23:26 +0100)] 
Simplify code. Produce data faster by handling bizarre CRLF behaviour.

10 years agoOkay. It works now. Omg.
Mike Verdone [Mon, 10 Mar 2014 21:31:52 +0000 (22:31 +0100)] 
Okay. It works now. Omg.

10 years agoVersion 1.14.0 twitter-1.14.0
Mike Verdone [Sun, 9 Mar 2014 21:17:17 +0000 (22:17 +0100)] 
Version 1.14.0

10 years agoMerge pull request #208 from RouxRC/pr-userstream-keywords-example
Mike Verdone [Sun, 9 Mar 2014 21:11:52 +0000 (22:11 +0100)] 
Merge pull request #208 from RouxRC/pr-userstream-keywords-example

Add possibility to use keywords track with user/site streams in script sample
To help illustrate further comments to come on #205

10 years agoMerge pull request #205 from sixohsix/stream_cleanup
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.

10 years agoMake possible to use track keywords with user/site streams in sample script (cf ...
RouxRC [Sun, 9 Mar 2014 20:10:09 +0000 (21:10 +0100)] 
Make possible to use track keywords with user/site streams in sample script (cf #205)

10 years agoFix Python 3.x support.
Mike Verdone [Tue, 25 Feb 2014 16:19:50 +0000 (17:19 +0100)] 
Fix Python 3.x support.

10 years agoLet's use the stdlib io system for great sanity.
Mike Verdone [Mon, 24 Feb 2014 23:06:38 +0000 (00:06 +0100)] 
Let's use the stdlib io system for great sanity.

10 years agoFurther simplification in progress.
Mike Verdone [Mon, 24 Feb 2014 21:48:08 +0000 (22:48 +0100)] 
Further simplification in progress.

10 years agoMerge pull request #206 from polm/patch-1
Mike Verdone [Mon, 24 Feb 2014 21:03:31 +0000 (22:03 +0100)] 
Merge pull request #206 from polm/patch-1

oauth dance should use https.
HTTP URL generated by OAuth dance just gives a blank page, but changing it to HTTPS fixes it.

10 years agooauth dance should use https.
Paul O'Leary McCann [Mon, 24 Feb 2014 01:50:17 +0000 (10:50 +0900)] 
oauth dance should use https.

HTTP URL generated by OAuth dance just gives a blank page, but changing it to HTTPS fixes it.

10 years agoExplicitly control heartbeat timeouts.
Mike Verdone [Tue, 18 Feb 2014 00:59:54 +0000 (01:59 +0100)] 
Explicitly control heartbeat timeouts.

10 years agoBetter help for example.
Mike Verdone [Mon, 17 Feb 2014 23:28:33 +0000 (00:28 +0100)] 
Better help for example.

10 years agoUse timeout and block args for all streams in example.
Mike Verdone [Mon, 17 Feb 2014 23:18:18 +0000 (00:18 +0100)] 
Use timeout and block args for all streams in example.

10 years agoSimplify further. New args to example script. Update documentation.
Mike Verdone [Mon, 17 Feb 2014 23:15:50 +0000 (00:15 +0100)] 
Simplify further. New args to example script. Update documentation.

10 years agoSimplify streaming code.
Mike Verdone [Mon, 17 Feb 2014 22:44:12 +0000 (23:44 +0100)] 
Simplify streaming code.

10 years agoMerge pull request #203 from RouxRC/pr-fix-timeout
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

10 years agoplease @adonoho
Benjamin Ooghe-Tabanou [Mon, 17 Feb 2014 16:33:46 +0000 (17:33 +0100)] 
please @adonoho

10 years agorevert to regular no yield in timeout mode until further non-blocking+timeout option
RouxRC [Sun, 16 Feb 2014 19:38:28 +0000 (20:38 +0100)] 
revert to regular no yield in timeout mode until further non-blocking+timeout option

10 years agouse non timeout mode for all streams in the sample tester
RouxRC [Sun, 16 Feb 2014 19:26:20 +0000 (20:26 +0100)] 
use non timeout mode for all streams in the sample tester

10 years agofix python2.6 compat and refacto per as @Adonoho's #201
RouxRC [Sun, 16 Feb 2014 03:15:10 +0000 (04:15 +0100)] 
fix python2.6 compat and refacto per as @Adonoho's #201

10 years agohangup should happen also in noblock mode
RouxRC [Sun, 16 Feb 2014 02:43:04 +0000 (03:43 +0100)] 
hangup should happen also in noblock mode

10 years agoyield None as well in timeout mode when no tweet received
RouxRC [Sun, 16 Feb 2014 02:42:43 +0000 (03:42 +0100)] 
yield None as well in timeout mode when no tweet received

10 years agotake twitter's keepalive signals into account for the timeout
RouxRC [Sun, 16 Feb 2014 02:41:38 +0000 (03:41 +0100)] 
take twitter's keepalive signals into account for the timeout

10 years agoFix exception on hangedup streams in 2.6
RouxRC [Sun, 16 Feb 2014 01:41:19 +0000 (02:41 +0100)] 
Fix exception on hangedup streams in 2.6

10 years agoVersion 1.13.1. twitter-1.13.1
Mike Verdone [Wed, 12 Feb 2014 15:23:34 +0000 (16:23 +0100)] 
Version 1.13.1.

10 years agoRestore Python 2.6 compatibility by restoring the old version of recv_chunk, only...
Mike Verdone [Wed, 12 Feb 2014 15:23:01 +0000 (16:23 +0100)] 
Restore Python 2.6 compatibility by restoring the old version of recv_chunk, only used for Py 2.6.

10 years agoVersion 1.13.0. Ends support for Python 2.6.
Mike Verdone [Wed, 12 Feb 2014 14:07:41 +0000 (15:07 +0100)] 
Version 1.13.0. Ends support for Python 2.6.

10 years agoMerge pull request #199 from adonoho/use-bytearray-buffer
Mike Verdone [Wed, 12 Feb 2014 14:06:23 +0000 (15:06 +0100)] 
Merge pull request #199 from adonoho/use-bytearray-buffer

Reduce memory usage by writing directly into byte array buffer.
Gentlefolk,

The whole point of using a `bytearray` as opposed to concatenating reads of `bytes` was to reduce memory usage. This pull request now takes that strategy to its logical conclusion by writing the balance of the chunk directly into the `bytearray`. This saves the creation of a temporary `bytes` array, up to 8KiB in size.

It does this by creating a `memoryview` of the `bytearray`. While this is still an allocation, the `memoryview`s are much smaller and are, presumably, reclaimed faster.

This patch has been running for over 24 hours and has processed over 4 MTw under Python v3.3.3 on OS X 10.8.5. It has also been run for about 10 minutes on Python v2.7.6 on a similar machine. `memoryview` does not appear to have been backported to Python v2.6.*. Hence, this pull request is incompatible with that platform.

Anon,
Andrew

P.S. The changes in this pull request are larger than strictly necessary for adding this functionality. I chose to improve the naming of my variables and move some of them closer to where they are used.

10 years agoClarify comment.
Andrew W. Donoho [Fri, 7 Feb 2014 00:11:47 +0000 (18:11 -0600)] 
Clarify comment.

10 years agoMerge branch 'use-bytearray-buffer'
Andrew W. Donoho [Wed, 5 Feb 2014 21:31:42 +0000 (15:31 -0600)] 
Merge branch 'use-bytearray-buffer'

10 years agoDirectly read the balance of the HTTP chunk into the byte array. This eliminates...
Andrew W. Donoho [Wed, 5 Feb 2014 21:29:19 +0000 (15:29 -0600)] 
Directly read the balance of the HTTP chunk into the byte array. This eliminates at least one large allocation. Adjust names to match new logic.

10 years agoVersion 1.12.1 twitter-1.12.1
Mike Verdone [Tue, 4 Feb 2014 20:01:33 +0000 (21:01 +0100)] 
Version 1.12.1

10 years agoMerge pull request #198 from adonoho/fix-busy-wait
Mike Verdone [Tue, 4 Feb 2014 19:59:28 +0000 (11:59 -0800)] 
Merge pull request #198 from adonoho/fix-busy-wait

Follow the hangup message with a break out of the loop.
And clarify a comment and just use a normal string as an initial value.

10 years agoFollow the hangup message with a break out of the loop. Clarify a comment and just...
Andrew W. Donoho [Tue, 4 Feb 2014 19:48:13 +0000 (13:48 -0600)] 
Follow the hangup message with a break out of the loop. Clarify a comment and just use a normal string as an initial value.

10 years agoMerge pull request #197 from RouxRC/pr-rouxrc
Mike Verdone [Tue, 4 Feb 2014 14:40:12 +0000 (06:40 -0800)] 
Merge pull request #197 from RouxRC/pr-rouxrc

Add image support + fix diverses issues
All right, Mike's motivation was contagious and I cherry-picked and merged my pending commits regarding the other parts than the streaming.
This should fix a few more pending issues I tagged back then : #127 #177 #192 #126 #10 #64
I also seized the occasion to add @adonoho among the authors as well.

10 years agonew version and include @adonoho in authors
RouxRC [Mon, 3 Feb 2014 23:06:32 +0000 (00:06 +0100)] 
new version and include @adonoho in authors

10 years agoMerge https://github.com/sixohsix/twitter into pr-rouxrc
RouxRC [Mon, 3 Feb 2014 23:03:59 +0000 (00:03 +0100)] 
Merge https://github.com/sixohsix/twitter into pr-rouxrc

10 years agofriends_timeline is deprecated in API v1.1, remove it from all examples and ircbot
Benjamin Ooghe-Tabanou [Thu, 16 Jan 2014 17:00:30 +0000 (18:00 +0100)] 
friends_timeline is deprecated in API v1.1, remove it from all examples and ircbot

10 years agoVersion 1.11.1. twitter-1.11.1
Mike Verdone [Mon, 3 Feb 2014 22:59:30 +0000 (23:59 +0100)] 
Version 1.11.1.

10 years agoFix tilde fixing...
RouxRC [Sat, 28 Dec 2013 17:40:50 +0000 (18:40 +0100)] 
Fix tilde fixing...

convert non string before replacing in it...
(follows da33e70db0a0469dd8990b1ca3e7b06445529ea2 )

10 years agoComplete tildes fix for python 2
RouxRC [Sat, 28 Dec 2013 16:56:46 +0000 (17:56 +0100)] 
Complete tildes fix for python 2

The fix #64 by @grahame was fixing the issue of sending tweets with
'~' for python 3 but not for python 2 due to urllib.urlencode's lack
of safe functions. Here's a dirty hack to do it anyway.
Any better fix welcome :)

10 years agoMerge https://github.com/sixohsix/twitter into pr-rouxrc
RouxRC [Mon, 3 Feb 2014 22:54:37 +0000 (23:54 +0100)] 
Merge https://github.com/sixohsix/twitter into pr-rouxrc

10 years agoauthorship
RouxRC [Fri, 27 Dec 2013 10:42:09 +0000 (11:42 +0100)] 
authorship

10 years agoActually, the POST 'place' method is deprecated and removed.
Mike Verdone [Mon, 3 Feb 2014 22:53:39 +0000 (23:53 +0100)] 
Actually, the POST 'place' method is deprecated and removed.

10 years agoHandle multipart oauth to use image sending api
RouxRC [Sat, 28 Dec 2013 16:44:14 +0000 (17:44 +0100)] 
Handle multipart oauth to use image sending api

So the calls to send media (update_with_media, update_profile_image,
update_profile_background_image and update_profile_banner) require
to send queries differently, as multipart form, and oauth needs to be
signed without taking any parameter into account.
This does the trick, following the rules here and there:
https://dev.twitter.com/docs/uploading-media
https://dev.twitter.com/docs/api/1.1/post/statuses/update_with_media
https://dev.twitter.com/discussions/1059

Closes #127

Merged from 0a6fe85f7cc72d940b4393d2522d88d74b05ad22

10 years agoFix broken follow create/destroy in cmdline & bot
RouxRC [Fri, 27 Dec 2013 10:36:47 +0000 (11:36 +0100)] 
Fix broken follow create/destroy in cmdline & bot

Adapt argument calls to the intended behavior

Fixes #177 #192 #126 #10

10 years agoDon't crash with 'python -OO'.
Mike Verdone [Mon, 3 Feb 2014 22:49:24 +0000 (23:49 +0100)] 
Don't crash with 'python -OO'.

10 years agoMerge https://github.com/sixohsix/twitter into pr-rouxrc
RouxRC [Mon, 3 Feb 2014 22:47:19 +0000 (23:47 +0100)] 
Merge https://github.com/sixohsix/twitter into pr-rouxrc

10 years agoIgnore .pyo
Mike Verdone [Mon, 3 Feb 2014 22:45:00 +0000 (23:45 +0100)] 
Ignore .pyo

10 years agoMake the logger work again.
Mike Verdone [Mon, 3 Feb 2014 22:44:42 +0000 (23:44 +0100)] 
Make the logger work again.

10 years agoMerge https://github.com/sixohsix/twitter
RouxRC [Mon, 3 Feb 2014 22:41:56 +0000 (23:41 +0100)] 
Merge https://github.com/sixohsix/twitter

10 years agoUse POST for all methods requiring it in specs
RouxRC [Fri, 27 Dec 2013 09:38:15 +0000 (10:38 +0100)] 
Use POST for all methods requiring it in specs

Added all missing methods from https://dev.twitter.com/docs/api/1.1
Also included some of the streaming methods which work with both GET
and POST but accept arguments like "track" which can quickly require
POST.

(Closes #187 #145 #188)

10 years agoUpdate follow/unfollow API calls for 1.1.
Mike Verdone [Mon, 3 Feb 2014 22:24:04 +0000 (23:24 +0100)] 
Update follow/unfollow API calls for 1.1.

10 years agoMake stream example print message if no args are given. twitter-1.11.0
Mike Verdone [Mon, 3 Feb 2014 22:02:34 +0000 (23:02 +0100)] 
Make stream example print message if no args are given.

10 years agoVersion 1.11.0
Mike Verdone [Mon, 3 Feb 2014 21:59:49 +0000 (22:59 +0100)] 
Version 1.11.0

10 years agoInitialize error instance correctly. Based on @kemkin's patch.
Mike Verdone [Mon, 3 Feb 2014 21:56:24 +0000 (22:56 +0100)] 
Initialize error instance correctly. Based on @kemkin's patch.

10 years agoMerge pull request #196 from adonoho/pr-fix-stream
Mike Verdone [Mon, 3 Feb 2014 21:51:53 +0000 (13:51 -0800)] 
Merge pull request #196 from adonoho/pr-fix-stream

A Simpler Fix to the Streaming Code due to Changes from Twitter on Jan. 13, 2014.
Gentlefolk,

This is a candidate release patch. I propose it become the formal branch of this library and have dubbed it version v1.10.3. I once again formally thank RouxRC for his efforts moving this library forward. Any errors in this patch remain mine and do not reflect upon RouxRC or his code.

This library is a high performance streaming library. Compared to other Twitter libraries, it is easily an order of magnitude faster at delivering tweets to your application. Why is that? When streaming, this library pierces Python's urllib abstraction and takes control of the socket. It interprets the HTTP stream directly. That makes it fast. It also makes it vulnerable to changes. It needed to be upgraded when Twitter upgraded the protocol version.

Twitter's switch to HTTP v1.1 was long overdue.

Summary of changes:

- Based upon RouxRC's code, I turned off gzip compression. My version is slightly different than RouxRC's version.
- Instead of incrementally reading arbitrary lengths of bytes from the socket and seeing if they parse in the JSON parser, a good technique, the switch to HTTP chunking forced us to process in chunk sized blocks. Based upon inspection, Twitter never sends partial JSON in a chunk. They also send keep-alive delimiters in single 7 byte long chunks. This code depends upon both of these observations. It does not do general purpose HTTP chunk processing. It is a Twitter specific HTTP chunk parser.
- Chunk oriented processing allowed me to isolate stream interpretation to the chunk code and migrate the wrapper code to operate exclusively using strings. This makes the wrapper code more readable.
- Once I had opened up the wrapper code, I cleaned it up. This involved modest edits in how certain socket parameters were determined and moving data exclusive to the generator into the generator and out of the containing object.
- As this is exclusively socket oriented code, the HTTP exception catching was removed from the method. The exception was moved to wrap the opening of the socket by url lib.
- Due to reading the data in larger chunks and, hence, running it through the JSON parser less often, this code is about 10% faster than the prior generation.
- When Twitter hangs up on us, this code emits a `hangup` message in the stream.
- This code has been tested using Python v2.7.6 and v3.3.3 on OS X 10.8.5 (Mountain Lion). I have tested it on the high volume sample stream and on a user stream under both versions of Python. It is believed, but not tested, that it will function under Python v2.6.x. It uses the bytearray type. I believe that has been back ported all the way to Python v2.6.x. As the code is not particularly tricky, I do not foresee that it has introduced any new issues that were not already apparent in this library.
- I use this patch in production and have captured 50M+ tweets with it. It is solid and reliable. If you find it to not be so, please contact me. I use it in production and have a vested interest in ensuring that it catches all corner cases.

Thank you for your patience while I refine this patch and I ask Mr. Verdone to select this patch as the basis for moving this library forward.

Enjoy and Anon,
Andrew

10 years agoMerge branch 'fix-stream' into pr-fix-stream
Andrew W. Donoho [Thu, 30 Jan 2014 12:52:30 +0000 (06:52 -0600)] 
Merge branch 'fix-stream' into pr-fix-stream

10 years agoClarify the comment about edge cases.
Andrew W. Donoho [Wed, 29 Jan 2014 22:00:56 +0000 (16:00 -0600)] 
Clarify the comment about edge cases.

10 years agoAdd comments detailing why we can avoid handling certain edge cases in the Twitter...
Andrew W. Donoho [Wed, 29 Jan 2014 15:30:41 +0000 (09:30 -0600)] 
Add comments detailing why we can avoid handling certain edge cases in the Twitter stream.

10 years agoHandle HTTP chunks that only contain keep-alive delimiters.
Andrew W. Donoho [Tue, 28 Jan 2014 23:44:26 +0000 (17:44 -0600)] 
Handle HTTP chunks that only contain keep-alive delimiters.
A few cosmetic edits of the iterator function.

10 years agoSet a timeout on the main sample stream to test that code path.
Andrew W. Donoho [Tue, 28 Jan 2014 20:57:26 +0000 (14:57 -0600)] 
Set a timeout on the main sample stream to test that code path.

10 years agoRemove socket timeout mutation code.
Andrew W. Donoho [Tue, 28 Jan 2014 20:56:37 +0000 (14:56 -0600)] 
Remove socket timeout mutation code.
Simplify protocol parsing checks.
Move HTTP exception catching to where it might actually be thrown.

10 years agoRemove all keep-alive delimiters to allow the hangup patch to function.
Andrew W. Donoho [Tue, 28 Jan 2014 16:18:38 +0000 (10:18 -0600)] 
Remove all keep-alive delimiters to allow the hangup patch to function.

10 years agoBump the version number.
Andrew W. Donoho [Tue, 28 Jan 2014 14:13:30 +0000 (08:13 -0600)] 
Bump the version number.

10 years agoFurther refine socket management.
Andrew W. Donoho [Tue, 28 Jan 2014 14:13:06 +0000 (08:13 -0600)] 
Further refine socket management.
All HTTP chunks are read in their entirety.
Cosmetic code improvements. (The socket's blocking state is set in a more compact form after a DeMorgan's boolean transformation.)
Hangups by Twitter, as with timeouts, are signaled via a message to allow gracious recovery.

10 years agoAs Twitter appears to send complete JSON in the chunks, we can simplify buffer manage...
Andrew W. Donoho [Mon, 27 Jan 2014 13:26:44 +0000 (07:26 -0600)] 
As Twitter appears to send complete JSON in the chunks, we can simplify buffer management to only operate on strings and not re-encode the string as bytes. This improves readability at the expense of breakage if Twitter starts spanning JSON across HTTP chunks. This is an unlikely change to their infrastructure. That said, this is a totally optional patch.

10 years agoMove variables out of the iterator class and into the generator function. This slight...
Andrew W. Donoho [Sun, 26 Jan 2014 21:15:56 +0000 (15:15 -0600)] 
Move variables out of the iterator class and into the generator function. This slightly improves locality of code and data.

10 years agoMove recv_chunk() into a stand alone function. Further minimize memory use by using...
Andrew W. Donoho [Sun, 26 Jan 2014 21:02:59 +0000 (15:02 -0600)] 
Move recv_chunk() into a stand alone function. Further minimize memory use by using a chunk sized bytearray.

10 years agoMerge branch 'fix-stream' into pr-fix-stream
Andrew W. Donoho [Fri, 24 Jan 2014 15:44:42 +0000 (09:44 -0600)] 
Merge branch 'fix-stream' into pr-fix-stream

10 years agoCosmetic edits.
Andrew W. Donoho [Fri, 24 Jan 2014 15:44:19 +0000 (09:44 -0600)] 
Cosmetic edits.

10 years agoMinimize string decoding and move to use a bytearray for the buffer. This reduces...
Andrew W. Donoho [Thu, 23 Jan 2014 23:44:46 +0000 (17:44 -0600)] 
Minimize string decoding and move to use a bytearray for the buffer. This reduces memory consumption and is faster than the += operator for buffer concatenation and trimming.

10 years agoMerge branch 'fix-stream' into pr-fix-stream
Andrew W. Donoho [Mon, 20 Jan 2014 13:09:28 +0000 (07:09 -0600)] 
Merge branch 'fix-stream' into pr-fix-stream

10 years agoCosmetic edit
Andrew W. Donoho [Mon, 20 Jan 2014 13:06:55 +0000 (07:06 -0600)] 
Cosmetic edit

10 years agoBring HTTP chunk downloading into its own separate method.
Andrew W. Donoho [Fri, 17 Jan 2014 20:54:40 +0000 (14:54 -0600)] 
Bring HTTP chunk downloading into its own separate method.

10 years agoAdd support for both user and site streams.
Andrew W. Donoho [Fri, 17 Jan 2014 20:53:36 +0000 (14:53 -0600)] 
Add support for both user and site streams.

10 years agoIncrease the size of the read buffer to be larger than the average tweet.
Andrew W. Donoho [Thu, 16 Jan 2014 21:11:40 +0000 (15:11 -0600)] 
Increase the size of the read buffer to be larger than the average tweet.

10 years agoMove the potentially uninitialized values out of the if test.
Andrew W. Donoho [Thu, 16 Jan 2014 21:10:54 +0000 (15:10 -0600)] 
Move the potentially uninitialized values out of the if test.