[论文解读] twAwler: A lightweight twitter crawler
twAwler 是一种轻量级、以用户为中心的 Twitter 爬虫,通过利用多个 Twitter API 端点提取完整的用户时间线和互动图谱(转发、提及、回复、引用、关注),在遵守速率限制和政策的前提下,高效地发现并监控特定语言的社区——以希腊语用户为例。它可在单台机器上实现完整、合规的数据收集,生成包含丰富关系结构的 7.5 亿条推文数据集。
This paper presents twAwler, a lightweight twitter crawler that targets language-specific communities of users. twAwler takes advantage of multiple endpoints of the twitter API to explore user relations and quickly recognize users belonging to the targetted set. It performs a complete crawl for all users, discovering many standard user relations, including the retweet graph, mention graph, reply graph, quote graph, follow graph, etc. twAwler respects all twitter policies and rate limits, while able to monitor large communities of active users. twAwler was used between August 2016 and March 2018 to generate an extensive dataset of close to all Greek-speaking twitter accounts (about 330 thousand) and their tweets and relations. In total, the crawler has gathered 750 million tweets of which 424 million are in Greek; 750 million follow relations; information about 300 thousand lists, their members (119 million member relations) and subscribers (27 thousand subscription relations); 705 thousand trending topics; information on 52 million users in total of which 292 thousand have been since suspended, 141 thousand have deleted their account, and 3.5 million are protected and cannot be crawled. twAwler mines the collected tweets for the retweet, quote, reply, and mention graphs, which, in addition to the follow relation crawled, offer vast opportunities for analysis and further research.
研究动机与目标
- 解决在遵守速率限制和 Twitter 服务条款的前提下,高效爬取大规模活跃 Twitter 社区的挑战。
- 实现针对特定语言用户社区的完整、非抽样式数据收集,避免依赖多个账户或昂贵的基础设施。
- 提供一种轻量级、开源的工具,可在单台机器上部署,支持用户内容及其关系的持续、容错重启爬取。
- 通过挖掘包含时间戳的关注、转发、提及、回复、引用等多种互动图谱,支持高级社交网络分析。
- 通过仅提取用户 ID 和元数据,实现准匿名化数据共享,符合 Twitter 的数据重用政策。
提出的方法
- 使用 Twitter 的 /statuses/user_timeline 端点爬取每位用户最多 3,200 条推文,优先选择预期推文量高或上次爬取时间久的用户,以最小化请求开销并防止推文丢失。
- 采用双重优先级爬取策略:按上次爬取以来的预期推文数排序,以及按上次访问时间排序,以平衡新鲜度与效率。
- 利用 /statuses/lookup 端点发现并爬取转发、回复和引用推文,实现完整线程重建和互动图谱挖掘。
- 通过使用 /statuses/filter 流式 API 并结合希腊语停用词作为种子,启动追踪用户集,并通过已追踪用户的转发行为扩展用户集合。
- 在多次爬取中保持用户的状态化追踪,包括希腊语用户、非希腊语用户、被封禁账户、已删除账户、受保护账户和失效账户的集合,以确保数据一致性。
- 处理并存储所有爬取的数据,包括关注、转发、提及、回复、引用、点赞和列表关系,并附带时间戳,以支持动态网络分析。
实验结果
研究问题
- RQ1如何设计一种轻量级、单机运行的 Twitter 爬虫,以高效发现并监控特定语言用户社区的所有公开可访问内容,同时不违反速率限制或 Twitter 的服务条款?
- RQ2像 twAwler 这类以用户为中心的爬虫,在最小化请求开销和推文丢失的前提下,能在多大程度上重建完整的互动图谱(转发、提及、回复、引用)?
- RQ3单凭证、单机爬虫在长期维护大规模活跃用户社区的完整爬取方面,其性能和可扩展性如何?
- RQ4twAwler 如何通过从爬取数据中提取并打上时间戳的多种关系结构,有效支持高级社交网络分析?
- RQ5twAwler 是否能通过仅暴露用户 ID 和元数据,实现准匿名化数据共享,并支持先前研究的复现,同时保持分析的实用性?
主要发现
- twAwler 仅使用单个用户的凭证和一台桌面电脑,在 20 个月内成功爬取了 7.5 亿条推文(其中包含 4.24 亿条希腊语推文)和 7.5 亿条关注关系。
- 该系统发现了 30 万个 Twitter 列表,包含 1.19 亿个成员关系和 2.7 万个订阅关系,支持对基于社区的用户分组进行分析。
- 系统识别出 5200 万个唯一用户,其中包括 29.2 万个被封禁账户、14.1 万个已删除账户,以及 350 万个无法爬取的受保护账户。
- 通过优先处理高活跃度和长时间未访问的用户,twAwler 相较基线策略将每条推文的请求负载降低了 50%,显著提升了爬取效率。
- 该爬虫实现了对转发、提及、回复和引用图谱的完整重建,并附带时间戳,支持动态网络分析和传播模式研究。
- twAwler 生成的数据集支持高级分析,包括使用希腊语情感词典进行情感分析,并可完整复现以往关于希腊语 Twitter 事件的研究,保留完整的关联上下文。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。