简体   繁体   中英

Android Twitter api rate limit exceeded

hi i'm in the testing phase for my app and as it all works ok apart from the twitter feed. for some reason on my phone it works fine on another phone it doesnt and i'm getting this error message

08-14 12:24:18.730: W/System.err(25844): org.json.JSONException: Value {"error":"Rate limit exceeded. Clients may not make more than 150 requests per hour.","request":"\/1\/statuses\/user_timeline.json?screen_name=myleague&count=10"} of type org.json.JSONObject cannot be converted to JSONArray
08-14 12:24:18.730: W/System.err(25844):    at org.json.JSON.typeMismatch(JSON.java:111)
08-14 12:24:18.735: W/System.err(25844):    at org.json.JSONArray.<init>(JSONArray.java:91)
08-14 12:24:18.735: W/System.err(25844):    at org.json.JSONArray.<init>(JSONArray.java:103)
08-14 12:24:18.735: W/System.err(25844):    at .TwitterActivity.loadtweets(TwitterActivity.java:186)
08-14 12:24:18.735: W/System.err(25844):    at .TwitterActivity$PostTask.doInBackground(TwitterActivity.java:154)
08-14 12:24:18.735: W/System.err(25844):    at TwitterActivity$PostTask.doInBackground(TwitterActivity.java:1)
08-14 12:24:18.735: W/System.err(25844):    at android.os.AsyncTask$2.call(AsyncTask.java:264)
08-14 12:24:18.735: W/System.err(25844):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
08-14 12:24:18.735: W/System.err(25844):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
08-14 12:24:18.735: W/System.err(25844):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
08-14 12:24:18.735: W/System.err(25844):    at 

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)

does anyone know why i have tried it on multiple phones before and it's worked. i don't think the rate limit will have been reached but bit confused?

This happens because essentially the widgets are API clients , like any other API client , but they are making unauthenticated requests to the API, for which a single IP address has only 150 requests/hour .

If any other device, Web Browser , or app on your IP address were making Unauthenticated requests to the API at a given block of time, it would be decrementing from the pool.

When another user is viewing the widget from a different IP address, they most likely see it display just fine.

You can ask Twitter to move that limit up:: see the process here

You can check this useful links:

  1. link-1
  2. link-2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM