[twitter-dev] Re: API X-RateLimit-Remaining goes to 0 on our first request after midnight

2011-01-18 Thread Zach Gardner
This happened again at midnight of the 16th. The last request I made
on the 15th was at 11:59:15 PM with a reset of 12:27:54 AM and a
remaining of 144. The next request I made was at 12:19:15 AM with the
same reset and a remaining of 0. The next successful request I made
was at 12:29:15 AM.

Is there a better place I should be posting this? Like some sort of
bug tracking application rather than just a development talk?

-Zach

-- 
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


[twitter-dev] Re: API X-RateLimit-Remaining goes to 0 on our first request after midnight

2011-01-15 Thread Zach Gardner
Just got into the office and sure enough I got an email of a 400
response last night at 12:59 AM. From what I can tell the last request
before the 400 was at 11:55 PM and had an expiration time of 11:57 PM.

This does still match up with my first request after midnight theory,
but I noticed something else interesting in the header. The date in
the header is Sat, 15 Jan 2011 06:59:21 GMT, which would be 12:59:21
AM CST. The X-RateLimit-Reset is 1295074762, which is 12:59:22 AM CST.

It's possible that there was a request done after 11:57 PM that I'm
not tracking and that our request was just lucky to be sent one second
before our reset, but I find the one second different a little too
close to ignore.

-Zach




On Jan 14, 9:32 am, Zach Gardner z.gard...@hotmail.com wrote:
 We've been having problems recently with going over our rate limit
 when making API calls. We do a lot of server side caching of the
 responses we get from the API, so I was curious why we were going over
 our limit. I setup our application to record the headers we receive
 each time we make an API call, and found something interesting with X-
 RateLimit-Remaining:

 When we make our first API call in a while a little before midnight,
 we get a new rate limit remaining and new expiration time. But as soon
 as we make a call to the API after midnight, our rate limit goes to 0,
 so we have to wait till the expiration time to start making calls
 again.

 Yesterday at 11:50 PM CST we made the first call to the API after our
 expiration time passed. Our X-RateLimit-Remaining was 149 out of 150
 because that call used one of our allotted 150 per hour. The next call
 we made to the API was this morning at 12:10 AM CST, but our X-
 RateLimit-Remaining was 0. It's entirely possible that I didn't add
 the header tracking to another place we do API calls, but I doubt we'd
 have that much traffic at that time of the day to use 149 calls in 20
 minutes.

 For the past few weeks I had it set to email me when the API returns a
 400 Bad Request header. I've gotten one on the 11th at 12:17, the 10th
 at 12:37, the 8th at 12:22, and the 6th at 12:23 AM CST. (Google
 crawls our site around midnight our time, and our server side caches
 have expired by that time, which is the origin of most of the
 requests.)

 I found something interesting while looking through our logs for the
 12th. We made an API call on the 11th at 11:35 PM, which used our
 146th call per hour. The expiration time for that hour was the 12th at
 12:04 AM. The next call we made was on the 12th at 12:35 AM, after our
 expiration date. Our rate limit remaining was back at 149 out of 150
 with an expiration at 1:35 AM as expected.

 I was wondering if anyone has experienced something similar, or am I
 just missing something entirely. I can provide the headers in full if
 necessary..

 Thanks,

 -Zach

-- 
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


[twitter-dev] API X-RateLimit-Remaining goes to 0 on our first request after midnight

2011-01-14 Thread Zach Gardner
We've been having problems recently with going over our rate limit
when making API calls. We do a lot of server side caching of the
responses we get from the API, so I was curious why we were going over
our limit. I setup our application to record the headers we receive
each time we make an API call, and found something interesting with X-
RateLimit-Remaining:

When we make our first API call in a while a little before midnight,
we get a new rate limit remaining and new expiration time. But as soon
as we make a call to the API after midnight, our rate limit goes to 0,
so we have to wait till the expiration time to start making calls
again.


Yesterday at 11:50 PM CST we made the first call to the API after our
expiration time passed. Our X-RateLimit-Remaining was 149 out of 150
because that call used one of our allotted 150 per hour. The next call
we made to the API was this morning at 12:10 AM CST, but our X-
RateLimit-Remaining was 0. It's entirely possible that I didn't add
the header tracking to another place we do API calls, but I doubt we'd
have that much traffic at that time of the day to use 149 calls in 20
minutes.

For the past few weeks I had it set to email me when the API returns a
400 Bad Request header. I've gotten one on the 11th at 12:17, the 10th
at 12:37, the 8th at 12:22, and the 6th at 12:23 AM CST. (Google
crawls our site around midnight our time, and our server side caches
have expired by that time, which is the origin of most of the
requests.)

I found something interesting while looking through our logs for the
12th. We made an API call on the 11th at 11:35 PM, which used our
146th call per hour. The expiration time for that hour was the 12th at
12:04 AM. The next call we made was on the 12th at 12:35 AM, after our
expiration date. Our rate limit remaining was back at 149 out of 150
with an expiration at 1:35 AM as expected.

I was wondering if anyone has experienced something similar, or am I
just missing something entirely. I can provide the headers in full if
necessary..

Thanks,

-Zach

-- 
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


[twitter-dev] Re: Mad about lists and cursors... please help

2010-04-20 Thread Zach
I don't know if this fix for next_cursor always being zero has been
deployed or not, but I'm still seeing this bug.  A fix for this would
be really awesome.


On Apr 17, 12:04 pm, Mark McBride mmcbr...@twitter.com wrote:
 Yes.  A fix has been identified, and should be deployed in a few days

 Sent from mobile device

 On Apr 17, 2010, at 7:08 AM, Zach zcox...@gmail.com wrote:

  It's 10 days later and next_cursor on
 http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-GET-list-member...
  is still always 0, even when the user is being followed by far more
  than 20 lists.  This is completely broken and prevents 3rd party apps
  from discovering all lists that follow a given user.

  Has anyone at Twitter even looked into this?

  On Apr 7, 3:43 pm, Mark McBride mmcbr...@twitter.com wrote:
  Eugene, we're aware of the issue and will take a look at it today.

    ---Mark

 http://twitter.com/mccv

  On Wed, Apr 7, 2010 at 11:09 AM, eugene.man...@gmail.com 

  eugene.man...@gmail.com wrote:
  I posted this issue to @twitterapi twice, but they ignored it.

  Dear API group, please address this question.

  Thank you!

  On Apr 6, 9:45 am, Spraycode joey.fernan...@gmail.com wrote:
  Has anyone been able to solve this issue?  This is still  
  crippling us.

  Thanks!

  On Apr 2, 5:25 am, luisfigo rsoeg...@gmail.com wrote:

  Having the same problem...

  Triedhttp://api.twitter.com/1/avinashkaushik/lists/memberships.xml
  and get 0 forcursor. This guy is followed by ton of lists in  
  fact

  Below is the snapshot of the end result I got... This is  
  screwing up
  our app right now...

  .
  profile_background_image_url
 http://a1.twimg.com/profile_background_images/79104366/twitter_backgr
  ...
  /profile_background_image_url
  profile_background_tilefalse/profile_background_tile
  notificationsfalse/notifications
  geo_enabledfalse/geo_enabled
  verifiedfalse/verified
  followingfalse/following
  statuses_count3208/statuses_count
  langen/lang
  contributors_enabledfalse/contributors_enabled
  /user
  /list
  /lists
  next_cursor0/next_cursor
  previous_cursor0/previous_cursor
  /lists_list

  On Apr 1, 6:00 pm, Diego Rin Martin diego@gmail.com wrote:

  I think it's a API bug, even in the twitter page the paginator
  doesn't work
  as expected, sometimes
  appears, sometines not, and when appears it makes in a random  
  manner.

  i'm gettingcursor0 from API, using int or string  
  representation,
  the bug
  is in the API that sends
  thecursor0 randomly.

  regards, diego.

  On Thu, Apr 1, 2010 at 2:38 AM, jmathai jmat...@gmail.com  
  wrote:
  Are you sure you're using the string representation of the  
 cursor
  instead of the int?  The API'scursorexceeds PHP's max integer
  value
  (generally).

  jmathai ~ $ php -r '$x =
  json_decode
  (1);
  echo $x; echo \n;

  var_dump
  ($x===1);
  var_dump($x===1.111E+52);'
  1.111E+52
  bool(false)
  bool(true)

  jmathai ~ $ php -r '$x =
  1; echo $x;
  echo
  \n;

  var_dump
  ($x===1);
  var_dump($x===1.111E+52);'
  1.111E+52
  bool(true)
  bool(false)

  On Mar 31, 2:03 am, Diego Rin Martín diego@gmail.co
  m wrote:
  Hi there,

  this is my first post to this group, i'm a spanish developer
  dealing
  with twitter api surprises, excuse my poor english, i'will do  
  my
  best
  to comunicate nicest.

  So, to the problem, I'm trying to retrieve the lists for a  
  user,
  via
  list/membershipsget method, and passingcursoras parameter,  
  I'm
  having got random results, I explain myself, sometimes I made a
  request (for user edans, that have a huge amount of pages to
  paginate)
  and I get one page, I passcursor-1 and I getcursor0,
  sometimes I
  get one page, I passcursor-1 i getcursor 
  1331431515904087602,
  then
  I pass it and I get 0, sometimes I get a random number of  
  pages,
  but
  never, never, be able to retrieve the total amount of pages.

  I use php twitter-async classes to comunicate with API, I  
  thought
  that
  it could be the cause of the problem, but using direct curl  
  (via
  php5-
  curl extension) calls I'm having the same issues.

  Same using json or xml.

  I'm always getting 200 responses, so the call finish in a  
  correct
  way.

  any clue?

  I'm turning mad.

  Thanks in advance.
  diego.

  --
  To unsubscribe, reply using remove me as the subject.


[twitter-dev] Re: GET list memberships paging is broken?

2010-04-17 Thread Zach
I'm also always seeing next_cursor=0 both using twitter4j and curl.



On Apr 17, 7:26 am, Dan Checkoway dchecko...@gmail.com wrote:
 When using the GET list memberships API 
 (http://api.twitter.com/1/twitterapi/lists/memberships.*), it looks like
 paging is broken.  If the user is a member of 20 lists, you can never see
 anything beyond the first 20.  I'm passing cursor=-1 (well, twitter4j is) on
 the first request, and I get back the first page of 20 lists, which is
 fine...but no matter what, I always get back:

 next_cursor:0, previous_cursor:0, next_cursor_str:0,
 previous_cursor_str:0

 ...which prevents any paging beyond that first page of 20.  This is the case
 no matter which user I've tried.

 What seems coincidental is that even on the twitter web site proper, only
 the first page of 20 is presented as well, with no way to page beyond
 that...for example:  http://twitter.com/GamePro/lists/memberships I'm not
 sure if that's a related issue, or an intentional thing that has also
 affected the API, or what.

 Anyway, can twitter please fix paging on the GET list memberships API?

 Thanks,
 Dan Checkoway

 --
 Subscription 
 settings:http://groups.google.com/group/twitter-development-talk/subscribe?hl=en


[twitter-dev] Re: Mad about lists and cursors... please help

2010-04-17 Thread Zach
It's 10 days later and next_cursor on
http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-GET-list-memberships
is still always 0, even when the user is being followed by far more
than 20 lists.  This is completely broken and prevents 3rd party apps
from discovering all lists that follow a given user.

Has anyone at Twitter even looked into this?


On Apr 7, 3:43 pm, Mark McBride mmcbr...@twitter.com wrote:
 Eugene, we're aware of the issue and will take a look at it today.

   ---Mark

 http://twitter.com/mccv

 On Wed, Apr 7, 2010 at 11:09 AM, eugene.man...@gmail.com 

 eugene.man...@gmail.com wrote:
  I posted this issue to @twitterapi twice, but they ignored it.

  Dear API group, please address this question.

  Thank you!

  On Apr 6, 9:45 am, Spraycode joey.fernan...@gmail.com wrote:
   Has anyone been able to solve this issue?  This is still crippling us.

   Thanks!

   On Apr 2, 5:25 am, luisfigo rsoeg...@gmail.com wrote:

Having the same problem...

Triedhttp://api.twitter.com/1/avinashkaushik/lists/memberships.xml
and get 0 for cursor. This guy is followed by ton of lists in fact

Below is the snapshot of the end result I got... This is screwing up
our app right now...

.
profile_background_image_url
 http://a1.twimg.com/profile_background_images/79104366/twitter_backgr...
/profile_background_image_url
profile_background_tilefalse/profile_background_tile
notificationsfalse/notifications
geo_enabledfalse/geo_enabled
verifiedfalse/verified
followingfalse/following
statuses_count3208/statuses_count
langen/lang
contributors_enabledfalse/contributors_enabled
/user
/list
/lists
next_cursor0/next_cursor
previous_cursor0/previous_cursor
/lists_list

On Apr 1, 6:00 pm, Diego Rin Martin diego@gmail.com wrote:

 I think it's a API bug, even in the twitter page the paginator
  doesn't work
 as expected, sometimes
 appears, sometines not, and when appears it makes in a random manner.

 i'm getting cursor 0 from API, using int or string representation,
  the bug
 is in the API that sends
 the cursor 0 randomly.

 regards, diego.

 On Thu, Apr 1, 2010 at 2:38 AM, jmathai jmat...@gmail.com wrote:
  Are you sure you're using the string representation of the cursor
  instead of the int?  The API's cursor exceeds PHP's max integer
  value
  (generally).

  jmathai ~ $ php -r '$x =
  json_decode(1);
  echo $x; echo \n;

  var_dump($x===1);
  var_dump($x===1.111E+52);'
  1.111E+52
  bool(false)
  bool(true)

  jmathai ~ $ php -r '$x =
  1; echo $x;
  echo
  \n;

  var_dump($x===1);
  var_dump($x===1.111E+52);'
  1.111E+52
  bool(true)
  bool(false)

  On Mar 31, 2:03 am, Diego Rin Martín diego@gmail.com wrote:
   Hi there,

   this is my first post to this group, i'm a spanish developer
  dealing
   with twitter api surprises, excuse my poor english, i'will do my
  best
   to comunicate nicest.

   So, to the problem, I'm trying to retrieve the lists for a user,
  via
  list/membershipsget method, and passing cursor as parameter, I'm
   having got random results, I explain myself, sometimes I made a
   request (for user edans, that have a huge amount of pages to
  paginate)
   and I get one page, I pass cursor -1 and I get cursor 0,
  sometimes I
   get one page, I pass cursor -1 i get cursor 1331431515904087602,
  then
   I pass it and I get 0, sometimes I get a random number of pages,
  but
   never, never, be able to retrieve the total amount of pages.

   I use php twitter-async classes to comunicate with API, I thought
  that
   it could be the cause of the problem, but using direct curl (via
  php5-
   curl extension) calls I'm having the same issues.

   Same using json or xml.

   I'm always getting 200 responses, so the call finish in a correct
  way.

   any clue?

   I'm turning mad.

   Thanks in advance.
   diego.

  --
  To unsubscribe, reply using remove me as the subject.


[twitter-dev] Re: oauth/authenticate error/bug

2009-08-13 Thread Zach

Yeah, there is a major issue with both oauth/authenticate and oauth/
authorize.
Using oauth/authorize, a 403 forbidden is produced if
1) user logs in via my app and then tries to log into twitter.com or
2) user logs into twitter.com and then tries to log in via my app

I believe that twitter.com's _twitter_sess cookie is doing something
to produce a 403 whenever we try to authorize or authenticate an
already signed in user.

On Aug 12, 3:03 pm, aschobel ascho...@gmail.com wrote:
 I'm also getting this error when trying to block folks using
 twitter.com, so it may not be specific to oauth.

 On Aug 12, 2:53 pm, aschobel ascho...@gmail.com wrote:



  We are having the same issue, getting a 403 forbidden.

  I tried another OAuth enabled site and they have the same issue,

 http://www.twitlonger.com/

  Maybe there is some type of outage?

  On Aug 12, 1:45 pm, Zach zwe...@gmail.com wrote:

   Use case:
   User logs in via oauth/authenticate
   User logs out via accounts/end_session.  Cookies on my site containing
   access tokens are cleared.
   Same user logs back in later (in the same browser session) with
   oauth_authenticate.

   However, this last step produces a 403 forbidden: server understood
   request but refuses to fulfill it.

   Any ideas?  This should be a fairly basic use case...


[twitter-dev] Re: OAuth and native clients

2009-07-08 Thread Zach

I'm going to 3rd Sebastian's POV.  This is a serious problem that
needs to be addressed now.  Mobile app developers want to integrate
their native apps with sites like Twitter and Facebook, but the
current user experience is so unacceptable that no one is going to use
it in its current form.

For more on the topic:

http://www.hueniverse.com/hueniverse/2009/02/beyond-the-oauth-web-redirection-flow.html

Kudos to the Twitter team for actually starting to think about a
reasonable solution to this problem.  Facebook has the Connect for
iPhone library, but even that is just their terrible JavaScript-based
Connect login shown in an embedded browser.  And forget about trying
to authenticate with Facebook from something like a BlackBerry app.

We are anxiously awaiting a OAuth for Mobile option for the Twitter
API (as are a lot of other developers).  Our app missed the from
[MyApplication] using Basic Auth cutoff so now every status update we
push says from Twitter4J... not the best for marketing purposes.  We
would also love not having to store passwords on the device and send
them over the wire every time a user clicks the Share button.



On Jun 30, 4:42 pm, morefromalan sbal...@gmail.com wrote:
 Just wanted to second Sebastian's POV here.  UserExperience is a key
 revenue driver for us, andOAuthfor nativemobileapps is really
 painful for the user.

 On Jun 19, 5:41 am, Sebastian sdelm...@gmail.com wrote:

  Thanks for the pointer... I did some searches, but they were all
  focused onmobileclients.

  In my case, I'm not worried about the complexity of implementing
 OAuth. I can deal with that, and once it's done, it's gone from the
  picture. It's the user experience that worries me, as exposed on that
  thread by the TTYtter example.

  Well, since people are asking, the workflow doesn't significantly
  differ
  from otherOAuthapplications and depends on the fact that access
  tokens
  don't expire. When people start TTYtter up for the first time without
  an
  access token (or TTYtter tries the access token and it fails), it asks
  for
  the usual request token, prints the access URL with the request token
  it
  wants the user to authorize, and waits for the user to authorize.
  Twitter,
  presumably, will say, ok, tell your program to continue. Back on
  TTYtter's
  side, the user hits ENTER, and TTYtter exchanges its request token for
  an
  access token *and caches it* once it has verified it can successfully
  hit
  the user timeline for data. So far, this is not significantly
  different than
  any otherOAuthapp. 

  Is there any other way to doOAuthand at the same time, behave like a
  sensible application?

  Could Twitter implement a basic auth api call to perform theoauth
  authorization in the first place? Such a call would only be allowed
  from clients that prove they need it, and could be revoked for rogue
  clients. I know this lowers the security ofOAuth, but it only
  officializes a hack many apps will try to implement.

  On Jun 19, 12:39 am, Cameron Kaiser spec...@floodgap.com wrote:

Or is the door for basic auth really closing forever?

   This has been discussed in a number of threads and an exact determination
   has not yet been made. However, this might give you some context:

  http://groups.google.com/group/twitter-development-talk/browse_thread...

   --
    
   personal:http://www.cameronkaiser.com/--
     Cameron Kaiser * Floodgap Systems *www.floodgap.com*ckai...@floodgap.com
   -- The cost of living has not adversely affected its popularity. 
   --- Hide quoted text -

  - Show quoted text -