Can't get Twitter counts

teliasoneracom May 29, 2012 03:59AM EDT

If i log in to Addthis i can see that i have 1 twitter share the last 24 hours.

When i try to retrive this i get 0. I'm using this code. Note that this code works just fine if i chande service from twitter to facebook. Why doesn't i work for twitter when i have a share?

var twApiUrl =
String.Format(
"https://api.addthis.com/analytics/1.0/pub/shares.json?pubid={0}&userid={1}&password={2}&url={3}&period=month&service=twitter",
addThisPubId, addThisUserId, addThisPassword, pageUrl);

jsonstring = client.DownloadString(twApiUrl);
ser = new JavaScriptSerializer();

var twResult = new JavaScriptSerializer().Deserialize<IList<AddThisSearchResults>>(jsonstring);

TwitterCount = Convert.ToString((twResult == null) ? 0 : twResult.Sum(r => r.shares));

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)

Still need help?


General Topics

 

Developers