分享这个post是自己方便查,还有中文网界对这个东西介绍太少。

更多的就看github项目twint吧。

Installation:

git+pip3:

git clone https://github.com/twintproject/twint.git
pip3 install -r requirements.txt
pip3 install twint

or pip3+pipenv:

pip3 install --user --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint
pipenv install -e git+https://github.com/twintproject/twint.git#egg=twint

You may meet module cannot found error when you try to run twint after installation. On ubuntu, add ~/.local/bin into your PATH by:

export PATH=$PATH:~/.local/bin

You may edit ~/.bashrc file to permanately add the '~/.local/bin' into your PATH.

Usage:

Running the twint cmd with arguments can give you results. A few simple examples to help you understand the basics:

  • twint -u username - Scrape all the Tweets from user's timeline.
  • twint -u username -s pineapple - Scrape all Tweets from the user's timeline containing pineapple.
  • twint -s pineapple - Collect every Tweet containing pineapple from everyone's Tweets.
  • twint -u username --year 2014 - Collect Tweets that were tweeted before 2014.
  • twint -u username --since "2015-12-20 20:30:15" - Collect Tweets that were tweeted since 2015-12-20 20:30:15.
  • twint -u username --since 2015-12-20 - Collect Tweets that were tweeted since 2015-12-20 00:00:00.
  • twint -u username -o file.txt - Scrape Tweets and save to file.txt.
  • twint -u username -o file.csv --csv - Scrape Tweets and save as a csv file.
  • twint -u username --email --phone - Show Tweets that might have phone numbers or email addresses.
  • twint -s "Donald Trump" --verified - Display Tweets by verified users that Tweeted about Donald Trump.
  • twint -g="48.880048,2.385939,1km" -o file.csv --csv - Scrape Tweets from a radius of 1km around a place in Paris and export them to a csv file.
  • twint -u username -es localhost:9200 - Output Tweets to Elastic search
  • twint -u username -o file.json --json - Scrape Tweets and save as a json file.
  • twint -u username --database tweets.db - Save Tweets to a SQLite database.
  • twint -u username --followers - Scrape a Twitter user's followers.
  • twint -u username --following - Scrape who a Twitter user follows.
  • twint -u username --favorites - Collect all the Tweets a user has favorited (gathers ~3200 tweet).
  • twint -u username --following --user-full - Collect full user information a person follows
  • twint -u username --profile-full - Use a slow, but effective method to gather Tweets from a user's profile (Gathers ~3200 Tweets, Including Retweets).
  • twint -u username --retweets - Use a quick method to gather the last 900 Tweets (that includes retweets) from a user's profile.
  • twint -u username --resume resume_file.txt - Resume a search starting from the last saved scroll-id.

More detail about the commands and options are located in the wiki

twint 安装及使用的更多相关文章

  1. docker——容器安装tomcat

    写在前面: 继续docker的学习,学习了docker的基本常用命令之后,我在docker上安装jdk,tomcat两个基本的java web工具,这里对操作流程记录一下. 软件准备: 1.jdk-7 ...

  2. 网络原因导致 npm 软件包 node-sass / gulp-sass 安装失败的处理办法

    如果你正在构建一个基于 gulp 的前端自动化开发环境,那么极有可能会用到 gulp-sass ,由于网络原因你可能会安装失败,因为安装过程中部分细节会到亚马逊云服务器上获取文件.本文主要讨论在不变更 ...

  3. Sublime Text3安装JsHint

    介绍 Sublime Text3使用jshint依赖Nodejs,SublimeLinter和Sublimelinter-jshint. NodeJs的安装省略. 安装SublimeLinter Su ...

  4. Fabio 安装和简单使用

    Fabio(Go 语言):https://github.com/eBay/fabio Fabio 是一个快速.现代.zero-conf 负载均衡 HTTP(S) 路由器,用于部署 Consul 管理的 ...

  5. gentoo 安装

    加载完光驱后 1进行ping命令查看网络是否通畅 2设置硬盘的标识为GPT(主要用于64位且启动模式为UEFI,还有一个是MBR,主要用于32位且启动模式为bois) parted -a optima ...

  6. Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级

    Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 5.安装Database软件 5. ...

  7. Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作

    Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 1.实施前准备工作 1.1 服务器安装操 ...

  8. 【原】nodejs全局安装和本地安装的区别

    来微信支付有2年多了,从2年前的互联网模式转变为O2O模式,主要的场景是跟线下的商户去打交道,不像以往的互联网模式,有产品经理提需求,我们帮忙去解决问题. 转型后是这样的,团队成员更多需要去寻找业务的 ...

  9. tLinux 2.2下安装Mono 4.8

    Tlinux2.2发行版基于CentOS 7.2.1511研发而成,内核版本与Tlinux2.0发行版保持完全一致,更加稳定,并保持对Tlinux2.0的完全兼容.Mono 4版本要求CentOS 7 ...

随机推荐

  1. mysql explain中的列

    参考:<高性能mysql>附录D EXPLAIN MySql将Select查询分为简单和复杂类型,复杂类型分为3大类:简单子查询,所谓的派生表(在派生表的子查询),以及UNION查询. 列 ...

  2. 2018.03.29 python-matplotlib 图表生成

    '''Matplotlib -> 一个python版的matlab绘图接口,以2D为主,支持python,numpy,pandas基本数据结构,高效图标库''' import numpy as ...

  3. 【Qt开发】设置Qt应用程序图标

    [Qt开发]设置Qt应用程序图标 标签:[Qt开发] 首先,准备一个图标,例如:zx.ico,并新建一个文本文档,在里面添加一行: IDI_ICON1 ICON DISCARDABLE"zx ...

  4. Java抽象接口技巧(一)

    原文链接 http://blog.csdn.net/qq_35101189/article/details/70799155 在程序设计过程中,读者很可能遇到这样一种困境:设计了一个接口,但实现这个接 ...

  5. 第八周zuoye

    这个作业属于那个课程 C语言程序设计II 这个作业要求在哪 https://edu.cnblogs.com/campus/zswxy/computer-scienceclass3-2018/homew ...

  6. 第十一周总结 继承、this和super的区别和用法、方法的重写和重载

    一.继承 1.子类继承父类,通过一个关键字 extends 2.子类的对象可以调用父类中的(public protected)属性和方法 当作自己的来使用 3.子类可以添加自己独有的属性和方法 4.子 ...

  7. kubernetes(k8s)容器编排工具基础概念

    Kubernetes (K8s): 中文社区:https://www.kubernetes.org.cn/replication-controller-kubernetes 官网:https://ku ...

  8. Java——HashMap底层源码分析

    1.简介 HashMap 根据键的 hashCode 值存储数据,大多数情况下可以直接定位到它的值,因而具有很快的访问速度,但遍历顺序却是不确定的. HashMap 最多只允许一条记录的key为 nu ...

  9. html5动画之等待加载动画

    <div class="loading"> <p>100<span></span></p> </div> ; ...

  10. DOM属性和事件

    1-22 DOM属性设置与获取   1.获取属性: getAttribute("attribute"): var p = document.getElementById(" ...