Closed pjskennedy closed 3 years ago
Is there a plan to merge this? stream_filter
errors out as soon as it hits an :invalid response, would be nice to not have to restart it.
i guess i'll use the fork then. edit: oh it's got a bunch of missing commits.. hmm
I've cherry-picked this commit on top of extwitter
0.12.4. Not going to guarantee being up to date, but for now it's a solution. https://github.com/KristerV/extwitter
I'm sorry about not responding to this item. It might be too late, but if you have working change on top of the latest version, is it possible for you to open PR?
Ideally you would rebase this one, at least GitLab has that option right in this UI.
Anyway - if the button isn't here I made the PR: #148 As far as I can tell I did preserve @pjskennedy's name in the commit
And I have this version in use at the moment - seems to work great.
Hi @parroty and @KristerV
I have rebased, this should be good to merge now.
Thank you for the updates, and I'm sorry about taking so long to merge.
hey no worries and thanks for the package!
I noticed internal Poison parsing errors while using the streaming API:
Twitter's API Doc's:
I took a look into the code and found that sometimes detecting an "end of tweet" was not detecting there was actually two (or more) tweet JSON documents concatenated together. It looks as though each HTTP Chunk returned could have multiple tweets in it.
The line feed (
\r\n
) is always to delimit tweets in this API, even if it exists in a following chunk. The existing code was skipping "Empty" messages (messages that are only line feeds), however these line feeds are often marking the end of a tweet in a previous chunk in the HTTP response. This is what was leading to appended JSON documents and corresponding JSON parse failures.