My program sends is using rate_limit_status.xml to get the number of
remaining hits until the account limit is exceeded. My problem is that
it always seems to return the same value: 150. Even once I have
already hit the limit the service continues to show 150 hits left. I
am thinking that it is returning the hits remaining for the IP address
and not the user account I need.

Any ideas? I've been trying to figure this out all night but I haven't
been able to find to many examples of the rate_limit_status.xml
service. Here is my code:


string logon=this.UserName + ":" + this.Password;
logon=System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes
(logon));

//request
HttpWebRequest req=(HttpWebRequest)WebRequest.Create(url);
req.Timeout=System.Convert.ToInt32(gen.Get("twitterTimeout"));
req.Headers.Add("Authorization","Basic " + logon);
req.ServicePoint.Expect100Continue=false;

HttpWebResponse resp=(HttpWebResponse)req.GetResponse();
StreamReader sr=new StreamReader(resp.GetResponseStream
(),Encoding.GetEncoding(1252));

//get results
result=sr.ReadToEnd();
resp.Close();



The code XML response from twitter is:

<?xml version="1.0" encoding="UTF-8"?>
<hash>
  <remaining-hits type="integer">150</remaining-hits>
  <hourly-limit type="integer">150</hourly-limit>
  <reset-time-in-seconds type="integer">1257786363</reset-time-in-
seconds>
  <reset-time type="datetime">2009-11-09T17:06:03+00:00</reset-time>
</hash>

Reply via email to