[twitter-dev] Re: Rate Limit reporting

2009-07-14 Thread Martin Omander

Hi again,

Thank you for your prompt reply, I really appreciate it.

My application just went over the limit again on one account, and new
status updates sent through the API are not accepted. When I try to
post an update through the web UI to the same account, I get the error
message Wow, that's a lot of Twittering! You have reached your limit
of updates for the hour. Try again later.

Below is the debug info I have been able to glean. This issue makes it
hard to stay under the rate limit :-) Please let me know what you
think.

When I call the API

curl -u username:password http://twitter.com/account/rate_limit_status.xml

I get this response every time:

?xml version=1.0 encoding=UTF-8?
hash
  reset-time type=datetime2009-07-15T00:13:56+00:00/reset-time
  remaining-hits type=integer2/remaining-hits
  hourly-limit type=integer2/hourly-limit
  reset-time-in-seconds type=integer1247616836/reset-time-in-
seconds
/hash

Yesterday I got hourly-limit=150 two times out of a dozen requests,
but I'm only getting the 20,000 number today. The HTTP headers in the
response are:

HTTP/1.1 200 OK
Date: Tue, 14 Jul 2009 23:13:56 GMT
Server: hi
Last-Modified: Tue, 14 Jul 2009 23:13:56 GMT
Status: 200 OK
ETag: 56f05d81ae1e088e58e908037fe15aef
Pragma: no-cache
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-
check=0
Content-Type: application/xml; charset=utf-8
Content-Length: 306
Expires: Tue, 31 Mar 1981 05:00:00 GMT
X-Revision: 2da57beb7893dcb352b069aadddbf5916013ea1d
X-Transaction: 1247613236-88799-1093
Set-Cookie: lang=en; path=/
Set-Cookie:
_twitter_sess=BAh7CToJdXNlcmkEKk1aAzoHaWQiJTZiMWI4MmQ3MDNmOWFhZjdiMD
hiYmI1%250AZTYzN2I1NjgwIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpGbGFzaDo6%250ARmxh
c2hIYXNoewAGOgpAdXNlZHsAOhNwYXNzd29yZF90b2tlbiItMWQ1YmZl
%250AMTE5NmYwOTlhYjI2OGE
1NTRiNmMwYzJjOWQ1ZWQ5ODUzZg%253D
%253D--0bb9b2c1b8d9bee81c7aa35e9a91a6745df9a888;
 domain=.twitter.com; path=/
Vary: Accept-Encoding


/Martin



On Jul 13, 7:48 pm, alan_b ala...@gmail.com wrote:
 but thehttp://apiwiki.twitter.com/Rate-limiting doc also said:

 If you have received verification from Twitter that your account and/
 or IP address has been whitelisted you can verify your whitelisting
 with the accounts/rate_limit_status method. Calling this method with
 credentials will return the rate limit status of the authenticating
 user and invoking this method without credentials will return the rate
 limit status of the calling IP address. 

 but my experience is callinghttp://twitter.com/account/rate_limit_status.xml
 with a valid credential using OAuth always return rate limit status of
 the calling IP address, not the given credential.

 On Jul 14, 9:27 am, Damon Clinkscales sca...@pobox.com wrote:



  The doc says: IP whitelisting takes precedence to account rate
  limits. GET requests from a whitelisted IP address made on a user's
  behalf will be deducted from the whitelisted IP's limit, not the
  users.

 http://apiwiki.twitter.com/Rate-limiting

  If he's seeing a 20k limit, then that implies it's a whitelisted IP.
  According to the above, that IP would take precedence over the account
  user's passed in credentials.

  Yes?

  Both Matt and Doug answered this question though, so I feel like I
  must be reading this wrong. :)

  -damon
  --http://twitter.com/damon

  On Mon, Jul 13, 2009 at 7:48 PM, Doug Williamsd...@twitter.com wrote:
   Martin,
   That's interesting.

   Is there a pattern to this? Can you offer steps for recreation? It would 
   be
   helpful to have full header information when this does happen so we can 
   look
   to see if a specific machine that is returning incorrect information.

   Thanks,
   Doug

   On Mon, Jul 13, 2009 at 4:26 PM, Martin Omander moman...@google.com 
   wrote:

   Hi there,

   I'm getting the same thing, that is the rate limit for my IP address
   rather than for the account... most of the time. I run this curl
   command

   curl -u username:password
  http://twitter.com/account/rate_limit_status.xml

   where username and password are the account's real username and
   password. Most of the time the response contains an hourly-limit of
   20,000, for my IP address I assume. But occasionally the exact same
   curl command returns an hourly-limit of 150. Very odd. I assume curl
   handles the credentials correctly.

   Any thoughts?

   /Martin

   On Jul 13, 9:54 am, Justin justin.realw...@googlemail.com wrote:
Sorry about emailing you my last response.

I understand what you're saying about firefox - though I'm having the
same issue with requests via Microsoft.XMLHTTP requests - it's gone
the end of the day now (I do have a habit of starting these things
when there's no time). Will carry on the fight tomorrow - at least I
have a direction now - will try some other request methods.
Many thanks once again for your quick responses.

@JustinReid

On Jul 13, 5:26 pm, Matt Sanford m...@twitter.com wrote:

 Hi Justin,

    

[twitter-dev] Re: Rate Limit reporting

2009-07-13 Thread Matt Sanford


Hi Justin,

The user:pass is a shortcut used by some browsers and libraries  
but is not supported in all libraries. What language/library are you  
using? Most of them have some option for setting the user and password  
directly. Also, the most common issue when seeing the IP limit is an  
incorrect password. You should also try calling verify_credentials to  
make sure the password is correct and everything is being received  
correctly by Twitter.


Thanks;
 – Matt Sanford / @mzsanford
 Twitter Dev

On Jul 13, 2009, at 9:22 AM, Justin wrote:



I feel a bit silly asking this in the time of OAuth - but I'm not
quite there yet...

So how to return the rate limit for a given user?
Looking at the api documentation I presume you need to authenticate
(log in)

The obvious way to do this is via GET with:
http://username:passw...@twitter.com/account/rate_limit_status.xml
I've also tried base64'ing the username:password as suggested here:
http://en.wikipedia.org/wiki/Basic_access_authentication
http://base64(User:Pass)@twitter.com/account/rate_limit_status.xml

However, every time I try I'm returned with the rate limit for the IP
address and not the user.

I know I'm missing something (a few sandwiches from the picnic
probably)  - could someone enlighten me?

Many thanks




[twitter-dev] Re: Rate Limit reporting

2009-07-13 Thread Justin

Sorry about emailing you my last response.

I understand what you're saying about firefox - though I'm having the
same issue with requests via Microsoft.XMLHTTP requests - it's gone
the end of the day now (I do have a habit of starting these things
when there's no time). Will carry on the fight tomorrow - at least I
have a direction now - will try some other request methods.
Many thanks once again for your quick responses.

@JustinReid

On Jul 13, 5:26 pm, Matt Sanford m...@twitter.com wrote:
 Hi Justin,

      The user:pass is a shortcut used by some browsers and libraries  
 but is not supported in all libraries. What language/library are you  
 using? Most of them have some option for setting the user and password  
 directly. Also, the most common issue when seeing the IP limit is an  
 incorrect password. You should also try calling verify_credentials to  
 make sure the password is correct and everything is being received  
 correctly by Twitter.

 Thanks;
   – Matt Sanford / @mzsanford
       Twitter Dev

 On Jul 13, 2009, at 9:22 AM, Justin wrote:





  I feel a bit silly asking this in the time of OAuth - but I'm not
  quite there yet...

  So how to return the rate limit for a given user?
  Looking at the api documentation I presume you need to authenticate
  (log in)

  The obvious way to do this is via GET with:
  http://username:passw...@twitter.com/account/rate_limit_status.xml
  I've also tried base64'ing the username:password as suggested here:
 http://en.wikipedia.org/wiki/Basic_access_authentication
 http://base64(User:Pass)@twitter.com/account/rate_limit_status.xml

  However, every time I try I'm returned with the rate limit for the IP
  address and not the user.

  I know I'm missing something (a few sandwiches from the picnic
  probably)  - could someone enlighten me?

  Many thanks


[twitter-dev] Re: Rate Limit reporting

2009-07-13 Thread Martin Omander

Hi there,

I'm getting the same thing, that is the rate limit for my IP address
rather than for the account... most of the time. I run this curl
command

curl -u username:password http://twitter.com/account/rate_limit_status.xml

where username and password are the account's real username and
password. Most of the time the response contains an hourly-limit of
20,000, for my IP address I assume. But occasionally the exact same
curl command returns an hourly-limit of 150. Very odd. I assume curl
handles the credentials correctly.

Any thoughts?

/Martin




On Jul 13, 9:54 am, Justin justin.realw...@googlemail.com wrote:
 Sorry about emailing you my last response.

 I understand what you're saying about firefox - though I'm having the
 same issue with requests via Microsoft.XMLHTTP requests - it's gone
 the end of the day now (I do have a habit of starting these things
 when there's no time). Will carry on the fight tomorrow - at least I
 have a direction now - will try some other request methods.
 Many thanks once again for your quick responses.

 @JustinReid

 On Jul 13, 5:26 pm, Matt Sanford m...@twitter.com wrote:



  Hi Justin,

       The user:pass is a shortcut used by some browsers and libraries  
  but is not supported in all libraries. What language/library are you  
  using? Most of them have some option for setting the user and password  
  directly. Also, the most common issue when seeing the IP limit is an  
  incorrect password. You should also try calling verify_credentials to  
  make sure the password is correct and everything is being received  
  correctly by Twitter.

  Thanks;
    – Matt Sanford / @mzsanford
        Twitter Dev

  On Jul 13, 2009, at 9:22 AM, Justin wrote:

   I feel a bit silly asking this in the time of OAuth - but I'm not
   quite there yet...

   So how to return the rate limit for a given user?
   Looking at the api documentation I presume you need to authenticate
   (log in)

   The obvious way to do this is via GET with:
   http://username:passw...@twitter.com/account/rate_limit_status.xml
   I've also tried base64'ing the username:password as suggested here:
  http://en.wikipedia.org/wiki/Basic_access_authentication
  http://base64(User:Pass)@twitter.com/account/rate_limit_status.xml

   However, every time I try I'm returned with the rate limit for the IP
   address and not the user.

   I know I'm missing something (a few sandwiches from the picnic
   probably)  - could someone enlighten me?

   Many thanks


[twitter-dev] Re: Rate Limit reporting

2009-07-13 Thread Doug Williams
Martin,
That's interesting.

Is there a pattern to this? Can you offer steps for recreation? It would be
helpful to have full header information when this does happen so we can look
to see if a specific machine that is returning incorrect information.

Thanks,
Doug



On Mon, Jul 13, 2009 at 4:26 PM, Martin Omander moman...@google.com wrote:


 Hi there,

 I'm getting the same thing, that is the rate limit for my IP address
 rather than for the account... most of the time. I run this curl
 command

 curl -u username:password
 http://twitter.com/account/rate_limit_status.xml

 where username and password are the account's real username and
 password. Most of the time the response contains an hourly-limit of
 20,000, for my IP address I assume. But occasionally the exact same
 curl command returns an hourly-limit of 150. Very odd. I assume curl
 handles the credentials correctly.

 Any thoughts?

 /Martin




 On Jul 13, 9:54 am, Justin justin.realw...@googlemail.com wrote:
  Sorry about emailing you my last response.
 
  I understand what you're saying about firefox - though I'm having the
  same issue with requests via Microsoft.XMLHTTP requests - it's gone
  the end of the day now (I do have a habit of starting these things
  when there's no time). Will carry on the fight tomorrow - at least I
  have a direction now - will try some other request methods.
  Many thanks once again for your quick responses.
 
  @JustinReid
 
  On Jul 13, 5:26 pm, Matt Sanford m...@twitter.com wrote:
 
 
 
   Hi Justin,
 
The user:pass is a shortcut used by some browsers and libraries
   but is not supported in all libraries. What language/library are you
   using? Most of them have some option for setting the user and password

   directly. Also, the most common issue when seeing the IP limit is an
   incorrect password. You should also try calling verify_credentials to
   make sure the password is correct and everything is being received
   correctly by Twitter.
 
   Thanks;
 – Matt Sanford / @mzsanford
 Twitter Dev
 
   On Jul 13, 2009, at 9:22 AM, Justin wrote:
 
I feel a bit silly asking this in the time of OAuth - but I'm not
quite there yet...
 
So how to return the rate limit for a given user?
Looking at the api documentation I presume you need to authenticate
(log in)
 
The obvious way to do this is via GET with:
http://username:passw...@twitter.com/account/rate_limit_status.xml
I've also tried base64'ing the username:password as suggested here:
   http://en.wikipedia.org/wiki/Basic_access_authentication
   http://base64(User:Pass)@twitter.com/account/rate_limit_status.xml
 
However, every time I try I'm returned with the rate limit for the IP
address and not the user.
 
I know I'm missing something (a few sandwiches from the picnic
probably)  - could someone enlighten me?
 
Many thanks



[twitter-dev] Re: Rate Limit reporting

2009-07-13 Thread Damon Clinkscales

The doc says: IP whitelisting takes precedence to account rate
limits. GET requests from a whitelisted IP address made on a user's
behalf will be deducted from the whitelisted IP's limit, not the
users.

http://apiwiki.twitter.com/Rate-limiting

If he's seeing a 20k limit, then that implies it's a whitelisted IP.
According to the above, that IP would take precedence over the account
user's passed in credentials.

Yes?

Both Matt and Doug answered this question though, so I feel like I
must be reading this wrong. :)

-damon
-- 
http://twitter.com/damon

On Mon, Jul 13, 2009 at 7:48 PM, Doug Williamsd...@twitter.com wrote:
 Martin,
 That's interesting.

 Is there a pattern to this? Can you offer steps for recreation? It would be
 helpful to have full header information when this does happen so we can look
 to see if a specific machine that is returning incorrect information.

 Thanks,
 Doug



 On Mon, Jul 13, 2009 at 4:26 PM, Martin Omander moman...@google.com wrote:

 Hi there,

 I'm getting the same thing, that is the rate limit for my IP address
 rather than for the account... most of the time. I run this curl
 command

 curl -u username:password
 http://twitter.com/account/rate_limit_status.xml

 where username and password are the account's real username and
 password. Most of the time the response contains an hourly-limit of
 20,000, for my IP address I assume. But occasionally the exact same
 curl command returns an hourly-limit of 150. Very odd. I assume curl
 handles the credentials correctly.

 Any thoughts?

 /Martin




 On Jul 13, 9:54 am, Justin justin.realw...@googlemail.com wrote:
  Sorry about emailing you my last response.
 
  I understand what you're saying about firefox - though I'm having the
  same issue with requests via Microsoft.XMLHTTP requests - it's gone
  the end of the day now (I do have a habit of starting these things
  when there's no time). Will carry on the fight tomorrow - at least I
  have a direction now - will try some other request methods.
  Many thanks once again for your quick responses.
 
  @JustinReid
 
  On Jul 13, 5:26 pm, Matt Sanford m...@twitter.com wrote:
 
 
 
   Hi Justin,
 
        The user:pass is a shortcut used by some browsers and libraries
   but is not supported in all libraries. What language/library are you
   using? Most of them have some option for setting the user and password
  
   directly. Also, the most common issue when seeing the IP limit is an
   incorrect password. You should also try calling verify_credentials to
  
   make sure the password is correct and everything is being received
   correctly by Twitter.
 
   Thanks;
     – Matt Sanford / @mzsanford
         Twitter Dev
 
   On Jul 13, 2009, at 9:22 AM, Justin wrote:
 
I feel a bit silly asking this in the time of OAuth - but I'm not
quite there yet...
 
So how to return the rate limit for a given user?
Looking at the api documentation I presume you need to authenticate
(log in)
 
The obvious way to do this is via GET with:
http://username:passw...@twitter.com/account/rate_limit_status.xml
I've also tried base64'ing the username:password as suggested here:
   http://en.wikipedia.org/wiki/Basic_access_authentication
   http://base64(User:Pass)@twitter.com/account/rate_limit_status.xml
 
However, every time I try I'm returned with the rate limit for the
IP
address and not the user.
 
I know I'm missing something (a few sandwiches from the picnic
probably)  - could someone enlighten me?
 
Many thanks


[twitter-dev] Re: Rate Limit reporting

2009-07-13 Thread alan_b

but the http://apiwiki.twitter.com/Rate-limiting  doc also said:

If you have received verification from Twitter that your account and/
or IP address has been whitelisted you can verify your whitelisting
with the accounts/rate_limit_status method. Calling this method with
credentials will return the rate limit status of the authenticating
user and invoking this method without credentials will return the rate
limit status of the calling IP address. 

but my experience is calling http://twitter.com/account/rate_limit_status.xml
with a valid credential using OAuth always return rate limit status of
the calling IP address, not the given credential.

On Jul 14, 9:27 am, Damon Clinkscales sca...@pobox.com wrote:
 The doc says: IP whitelisting takes precedence to account rate
 limits. GET requests from a whitelisted IP address made on a user's
 behalf will be deducted from the whitelisted IP's limit, not the
 users.

 http://apiwiki.twitter.com/Rate-limiting

 If he's seeing a 20k limit, then that implies it's a whitelisted IP.
 According to the above, that IP would take precedence over the account
 user's passed in credentials.

 Yes?

 Both Matt and Doug answered this question though, so I feel like I
 must be reading this wrong. :)

 -damon
 --http://twitter.com/damon



 On Mon, Jul 13, 2009 at 7:48 PM, Doug Williamsd...@twitter.com wrote:
  Martin,
  That's interesting.

  Is there a pattern to this? Can you offer steps for recreation? It would be
  helpful to have full header information when this does happen so we can look
  to see if a specific machine that is returning incorrect information.

  Thanks,
  Doug

  On Mon, Jul 13, 2009 at 4:26 PM, Martin Omander moman...@google.com wrote:

  Hi there,

  I'm getting the same thing, that is the rate limit for my IP address
  rather than for the account... most of the time. I run this curl
  command

  curl -u username:password
 http://twitter.com/account/rate_limit_status.xml

  where username and password are the account's real username and
  password. Most of the time the response contains an hourly-limit of
  20,000, for my IP address I assume. But occasionally the exact same
  curl command returns an hourly-limit of 150. Very odd. I assume curl
  handles the credentials correctly.

  Any thoughts?

  /Martin

  On Jul 13, 9:54 am, Justin justin.realw...@googlemail.com wrote:
   Sorry about emailing you my last response.

   I understand what you're saying about firefox - though I'm having the
   same issue with requests via Microsoft.XMLHTTP requests - it's gone
   the end of the day now (I do have a habit of starting these things
   when there's no time). Will carry on the fight tomorrow - at least I
   have a direction now - will try some other request methods.
   Many thanks once again for your quick responses.

   @JustinReid

   On Jul 13, 5:26 pm, Matt Sanford m...@twitter.com wrote:

Hi Justin,

     The user:pass is a shortcut used by some browsers and libraries
but is not supported in all libraries. What language/library are you
using? Most of them have some option for setting the user and password

directly. Also, the most common issue when seeing the IP limit is an
incorrect password. You should also try calling verify_credentials to

make sure the password is correct and everything is being received
correctly by Twitter.

Thanks;
  – Matt Sanford / @mzsanford
      Twitter Dev

On Jul 13, 2009, at 9:22 AM, Justin wrote:

 I feel a bit silly asking this in the time of OAuth - but I'm not
 quite there yet...

 So how to return the rate limit for a given user?
 Looking at the api documentation I presume you need to authenticate
 (log in)

 The obvious way to do this is via GET with:
 http://username:passw...@twitter.com/account/rate_limit_status.xml
 I've also tried base64'ing the username:password as suggested here:
http://en.wikipedia.org/wiki/Basic_access_authentication
http://base64(User:Pass)@twitter.com/account/rate_limit_status.xml

 However, every time I try I'm returned with the rate limit for the
 IP
 address and not the user.

 I know I'm missing something (a few sandwiches from the picnic
 probably)  - could someone enlighten me?

 Many thanks