Coder Social home page Coder Social logo

twitter_crawler's Introduction

使用方法

  1. 将文件解压后使config.py,instance.json,nitter.py,tweets.py在同一目录下
  2. 根据需要修改config.py文件
  3. 运行tweets.py文件即可

config.py参数说明

  • term: 关键词

  • mode: 'term'根据关键词查找 'user'根据用户名查找

  • number: 爬取推文个数

  • since: 起始日期,格式为YYYY-MM-DD.

  • until: 终止日期YYYY-MM-DD.

  • near: 推文地区,默认为任何地方

  • language:语言(e.g. 'en' for English, 'es' for Spanish, 'fr' for French ...)

  • to: 引用,如果引用@github,将其设置为to = 'github'

  • filters: 筛选,例如:'nativeretweets', 'media', 'videos', 'news', 'verified', 'native_video', 'replies', 'links', 'images', 'safe', 'quote', 'pro_video'

  • exclude: 反向筛选,不包括哪些关键词

  • max_retries: (爬取失败时会重试)最大尝试次数,默认为5

  • 例如

search_term = 'openai'
mode = 'term'
number = 10
since = None
until = None
near = None
language = None
to = None
filters = None
exclude = None
max_retries = 10
  • valid log_levels None = no logs 0 = only warning and error logs 1 = previous + informational logs (default)

  • skip_instance_check: 是否跳过选择实例,默认为跳过,建议跳过,否则会很慢

  • 例如

log_level = 1
skip_instance_check = True

输出结果

'link' 推文链接 'text' 推文内容 'user'用户信息,包含用户名、账户、id、头像 'date' 推文日期,包括年月日,具体到分钟 'is-retweet' 是否转发 'is-pinned' 是否置顶 'external-link' 外部链接 'replying-to' 回复 'quoted-post' 引用推文 'stats' 推文状态,包括评论、转发,喜欢 'pictures'图片(如果推文内容有图) 'videos'视频(如果推文内容有视频) 'gifs'动态图(如果推文内容有动态图)

twitter_crawler's People

Stargazers

heshiwen avatar yebin avatar  avatar gambol avatar

Watchers

Rhythmli avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.