Exception while using count parameter of streaming api

140 views
Skip to first unread message

revati choudhari

unread,
Nov 2, 2010, 1:14:49 PM11/2/10
to Twitter Development Talk
I am doing a project on twitter sentiment analysis, and I was trying
to pull previous statuses using the "count" parameter. Here is the
code:

inputConfig.Parameters = "track=" + FilterParametersTbx.Text +
"&count=10";

I was granted the shadow access level by twitter yesterday, which
means I can use the "count" parameter. Why do I still get the
following exception?

System.Net.WebException was unhandled by user code
Message=The remote server returned an error: (416) Requested Range Not
Satisfiable.
Source=System
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at AdvantIQ.ExampleAdapters.Input.Twitter.TwitterInput.ProduceEvents()
in C:\Stream Insight Example\JAhlen - username\ExampleAdapters\Input
\Twitter\TwitterInput.cs:line 68
at AdvantIQ.ExampleAdapters.Input.Twitter.TwitterInput.Start() in C:
\Stream Insight Example\JAhlen - username\ExampleAdapters\Input\Twitter
\TwitterInput.cs:line 45
at Filter.InvokeWithFilter(Action , Func`2 , Action`1 )
at
Microsoft.ComplexEventProcessing.Diagnostics.Exceptions.ExecuteWithFilter(Action
body, Func`2 filter, Action`1 handler)
at
Microsoft.ComplexEventProcessing.Adapters.Adapter.ThreadProcStart(Object
thisPtr)
InnerException:


If anyone has any idea about this, please help me out.

Taylor Singletary

unread,
Nov 2, 2010, 2:02:07 PM11/2/10
to twitter-deve...@googlegroups.com
The count parameter is not available for all streaming roles/endpoints. What end point are you executing and what level of streaming do you have access to?

From the docs on the count parameter:
Firehose, Links, Birddog and Shadow clients interested in capturing all statuses should maintain a current estimate of the number of statuses received per second and note the time that the last status was received. Upon a reconnect, the client can then estimate the appropriate backlog to request. Note that the count parameter is not allowed elsewhere, including track, sample and on the default access role.

Taylor


--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: http://groups.google.com/group/twitter-development-talk

revati choudhari

unread,
Nov 5, 2010, 12:41:29 PM11/5/10
to Twitter Development Talk
Thanks for your reply.
Actually I have the Shadow access level, which means that I should be
able to use the count parameter.
Why do I still get the exception? :(
Also, I didnt understand what you mean by "endpoint"? Please explain.

Does "Note that the count parameter is not allowed elsewhere,
including
track, sample" mean that I cannot use the count parameter with the
track parameter? The wording are a little confusing.

Thanks,
Revati


On Nov 2, 11:02 am, Taylor Singletary <taylorsinglet...@twitter.com>
wrote:
> The count parameter is not available for all streaming roles/endpoints. What
> end point are you executing and what level of streaming do you have access
> to?
>
> From the docs on the count parameter:
> *Firehose, Links, Birddog and Shadow* clients interested in capturing all
> statuses should maintain a current estimate of the number of statuses
> received per second and note the time that the last status was received.
> Upon a reconnect, the client can then estimate the appropriate backlog to
> request. *Note that the count parameter is not allowed elsewhere*, including
> > Microsoft.ComplexEventProcessing.Diagnostics.Exceptions.ExecuteWithFilter(A­ction
> > body, Func`2 filter, Action`1 handler)
> > at
> > Microsoft.ComplexEventProcessing.Adapters.Adapter.ThreadProcStart(Object
> > thisPtr)
> > InnerException:
>
> > If anyone has any idea about this, please help me out.
>
> > --
> > Twitter developer documentation and resources:http://dev.twitter.com/doc
> > API updates via Twitter:http://twitter.com/twitterapi
> > Issues/Enhancements Tracker:
> >http://code.google.com/p/twitter-api/issues/list
> > Change your membership to this group:
> >http://groups.google.com/group/twitter-development-talk- Hide quoted text -
>
> - Show quoted text -

John Kalucki

unread,
Nov 8, 2010, 1:00:00 PM11/8/10
to twitter-deve...@googlegroups.com
Shadow allows you to follow more users, but also allows you to continue to use track. There are no cases where we support count and track together.

-John Kalucki
Twitter, Inc

revati choudhari

unread,
Nov 8, 2010, 6:17:32 PM11/8/10
to Twitter Development Talk
Thanks for your reply John. So what parameters can I use together with
"count" to get the past statuses?

-Revati


On Nov 8, 10:00 am, John Kalucki <j...@twitter.com> wrote:
> Shadow allows you to follow more users, but also allows you to continue to
> use track. There are no cases where we support count and track together.
>
> -John Kaluckihttp://twitter.com/jkalucki
> Twitter, Inc
>
> On Fri, Nov 5, 2010 at 9:41 AM, revati choudhari <revati.choudh...@gmail.com
> > > >http://groups.google.com/group/twitter-development-talk-Hide quoted
Reply all
Reply to author
Forward
0 new messages