Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Issues connecting to Site Streams #49

Closed
ghost opened this issue Apr 9, 2013 · 2 comments
Closed

Issues connecting to Site Streams #49

ghost opened this issue Apr 9, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 9, 2013

I'm in the process of trying to migrate an application from using Twitter4J's site stream implementation over to hbc-twitter4j, and I've run into two somewhat critical but related bugs.

First, SitestreamEndpoint.java provides no way to supply the "follow" parameter to the connection endpoint, which is described by https://dev.twitter.com/docs/api/1.1/get/site as required. Not supplying that field results in the endpoint returning 400 BAD REQUEST on any connection attempt.

After hacking SitestreamEndpoint.java to accept and pass that parameter through, I ran into a second issue in JSONObjectParser.getSitestreamUser(...). All messages received from the site stream are passed through that method including the control stream message documented in https://dev.twitter.com/docs/streaming-apis/streams/site/control. The control stream message, however, does not contain a "for_user" field, so the method ends up throwing a JSONException. This results in the stream never being opened because the stream ID is never captured.

I hacked around this second problem as well to see what would happen and was eventually able to get my site stream connection running, but given the presence of these two bugs either of which completely prevent the Site Streams feature from working at all, I have significant concerns about deploying this code into a production environment.

@kevinoliver
Copy link
Contributor

Thanks for the report. We don't have any sitestreams clients internally at Twitter, so this is the least tested part of the codebase. Seems like both of these issues should be fixable and we'd definitely love pull requests from working code.

@caniszczyk
Copy link
Contributor

closing this out, reopen if you face new issues

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants