Pushing the limit

Regularly, twhirl users report that the program runs into a “limit exceeded” error and pauses for five minutes before trying to get new updates from Twitter again. Most of the time, they blame it on twhirl, and I always have to explain that it’s not its fault. This article will take a detailed view on what “the limit” is, why you may run into it, and ways to avoid it.

What’s this limit stuff all about?

Let’s start with an introduction in what the request limit is at all. Twitter mainly is a website that is intended to be used via a web browser, an instant messaging client or SMS. Using these three access points, you are free to fetch information or interact with the service as often as you like, there is no limit imposed.
But Twitter offers another way to use their service: the Twitter API (Application Programming Interface). This is the way all desktop clients, third-party-webservices or browser extensions work. They send requests to the API and get an answer from the Twitter servers, like fetching a user’s tweets, posting a status update, setting a favorite, requesting a user’s profile information etc. Some of these requests can be done without sending a username and password, like requesting the public timeline, but most require the client to send a valid username and password with the request.
Using the Twitter API is free, but the number of requests you may send is limited to 70 per hour. Starting from the first request, within the next 60 minutes the API may not be accessed more than 70 times, otherwise access to the API will be locked until the 60 minutes are elapsed and the next period starts.

Which requests are counted among the limit?

There are some requests that don’t increase your count. You can write an unlimited number of tweets and direct messages per hour, and requesting the public timeline is free, too. All other requests will increase the counter, like fetching replies, fetching your archived tweets, following a user, deleting a direct message and so on.
Twitter counts all requests to the API using your username and password, independent from where they come. So if you are running two clients at the same time, they will share the same counter.

What does twhirl do to avoid hitting the limit?

Like most Twitter desktop clients, twhirl asks the Twitter API regularly if there are new tweets, replies or direct messages for you. It has a built-in mechanism that will prevent these automatic requests to exceed the limit within the 60 minute period. It’s up to you how many requests it is allowed to use for this purpose, from 10 to 60 per hour. By default, it will use 40 requests per hour, leaving about 30 for you.
What twhirl cannot control is how often the user (you) triggers a request, for example by deleting tweets, making them favorites or looking up a user profile (which actually consumes two requests, one for requesting the profile information, another for fetching his tweets).
If twhirl tries to access the API, but the limit is exceeded, Twitter returns an error. Twhirl understands this, informs you about it and pauses automatic requests for five minutes. Why five minutes? Under normal conditions, the limit will be exceeded to the end of the 60 minutes. Waiting five minutes might get you out of the period and you have 70 fresh requests. Twhirl will issue one request after the five minute wait to see if you are unlocked again, and pause another five minutes if not (and so on). If Twitter has unlocked your account, it will resume normal automatic requests.

Why does my twhirl say I exceeded the limit?

There are several reasons why this could happen. Most of the time, one or a combination of the following scenarios could lead to exceeding the limit:
  • You clicked the buttons too often
    Yes, I know, buttons exist to be clicked. But keep in mind that many of twhirl’s buttons trigger some interaction with the Twitter API. For example, if you go through a list of old direct messages you received and delete twenty of them, every single delete will use a request.
  • Another API client talks to Twitter using your credentials
    You have another client running that uses your username and password to send requests to the Twitter API. This can be a browser extension like TwitterFox, a social browser like Flock which rembers your account and frequently checks for your friends’ updates, or maybe even a third-party web service.
  • You (re)started twhirl multiple times within a short period of time
    The built-in limit protection can only work reliably if you let twhirl run for a longer time. If you restart it over and over, requests may be issued in shorter time spans than it should.
  • You are at work, and left twhirl running on your home computer
    Right, a special case of the second scenario, but don’t laugh, it already happend to people…
You see, API requests are of great value in the Twitterverse. Always keep that in mind, and don’t waste them carelessly.

What else can I do?

A simple way to decrease the number of requests you consume is to decrease the twhirl’s automatic request usage. But this can lead to other problems like missing tweets, because twhirl cannot keep up with your friends’ postings.
Do not use twhirl’s built-in profile lookup too often, as it requires two requests! Configure twhirl to open the user’s profile on twitter.com in a browser instead when you click on a username.
Basically, if you do not run other API clients, there is nothing more you can do, unfortunately. It’s normally not a big problem if you hit the limit infrequently. But if it happens more often, you may have to rethink how you use twhirl (or any other Twitter client, as all the above is true for every one of them).

Conclusion

Hopefully, this introduction helped you to understand what the limit is, how it works, why you hit it (if you hit it), and what you an do against it. If anything is unclear or missing, add a comment and I’ll try to clarify it.

转载于:https://blog.51cto.com/hexen/261813

Twhirl's limit exceeded相关推荐

  1. java.lang.OutOfMemoryError:GC overhead limit exceeded填坑心得

    该文章出自:http://www.cnblogs.com/hucn/p/3572384.html 分析工具:http://www.blogjava.net/jjshcc/archive/2014/03 ...

  2. spark 读取mongodb失败,报executor time out 和GC overhead limit exceeded 异常

    代码: import com.mongodb.spark.config.ReadConfig import com.mongodb.spark.sql._ val config = sqlContex ...

  3. Caused by: java.sql.SQLException: GC overhead limit exceeded处理百万数据出现的异常

    Caused by: java.sql.SQLException: GC overhead limit exceeded处理百万数据出现的异常 参考文章: (1)Caused by: java.sql ...

  4. Eclipse报错:gc overhead limit exceeded eclipse

    Eclipse报错:gc overhead limit exceeded eclipse 原因是Eclipse默认配置内存太小需要更改Eclipse安装文件夹下的eclipse.ini文件. 1.打开 ...

  5. 原因代码10044-Erdos number Time limit exceeded

    近期笔者几篇文章介绍了改原因代码的文章. 关联文章的地址 以下是我的代码,但是在通过uva试测是time limit exceeded, 不道知是什么原因,而且我自己试测了几个数据都是对的. 每日一道 ...

  6. OutOfMemoryError: GC Overhead Limit Exceeded错误处理

    OutOfMemoryError: GC Overhead Limit Exceeded错误处理 最近线上遇到一个问题,服务日志正常打印,但是接口调不通,重启服务后正常. 为了找到问题所在,那就翻日志 ...

  7. 一次OutOfMemoryError: GC overhead limit exceeded

    现象: 由于需要将mysql表中的过期数据在凌晨定时读取出过滤后转入到MongoDB,一个转换SQL达到百行,而且有几十个,集中运行后程序反馈异常: Handler dispatch failed; ...

  8. unable to execute dex:GC overhead limit exceeded unable to execute dex:java heap space 解决方案

    最近做厂商适配,厂商提供了一部分Framework的jar包,把jar包通过Add Jar放到Build Path中, 在生成APK过程中,Eclipse长时间停留在100%那个进度. 最后Eclip ...

  9. java.lang.OutOfMemoryError:GC overhead limit exceeded

    我遇到这样的问题,本地部署时抛出异常java.lang.OutOfMemoryError:GC overhead limit exceeded导致服务起不来,查看日志发现加载了太多资源到内存,本地的性 ...

最新文章

  1. Android 使用 setImageResource 清空图片
  2. 2014东师计算机应用基础离线作业,2014秋东师 计算机应用基础 离线作业及答案...
  3. xbox acc驱动win7_Xbox老大:希望第一方工作室能推出更多单机游戏_电竞
  4. python tempfile模块用不了_Python tempfile:坏了还是我做错了?
  5. ready与load的区别
  6. javaweb中mysql数据库的回滚操作代码
  7. VMware workstation9 Virtual Machine Network
  8. eCognition易康导出样本
  9. 线段树详解 二 ----(区间修改区间查询)
  10. 计算机硬盘容量的最小单位,计算机中存储数据的最小单位和存储容量的基本单位各是什么?...
  11. Qt安卓开发环境搭建
  12. ubuntu安装JLink 驱动。终结总结
  13. 0501 0503 模块区别_关于博途STEP7仿真软件究竟与真实PLC有哪些区别?
  14. word表格转图片线条不会缺失方法
  15. 华为usg6320服务器映射,华为防火墙USG6320配置(简单)
  16. jQuery(JavaScript类库)
  17. 论Cardano修仙之路,聊ADA现状分析
  18. 密码学系列 - 棱镜门
  19. 【el-tree】树形结构拖拽
  20. 【层级文本分类】Constrained Sequence-to-Tree Generation for Hierarchical Text Classification

热门文章

  1. window下Ionic环境安装
  2. Solr安装及集成javaWeb
  3. UltraEdit 所有快捷键 说明
  4. MapReduce 学习指南
  5. 物联网卡不能使用的情况有哪些
  6. java 中_l1,L2指令获取错过远高于L1指令获取未命中
  7. java.exe 不是有效的win32_WinXP提示不是有效的Win32应用程序怎么办?
  8. linux 修改密码和端口号_WINDOWS/LINUX系统修改管理员密码方法
  9. python def函数调用内容_基本的python,def函数和文本菜单的调用
  10. Spark(Hive)对字符串数值的排序