Skip to content

A cli tool to get old tweets as csv

License

Notifications You must be signed in to change notification settings

akiomik/squawks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

squawks

Go CodeQL

A cli tool to get old tweets on twitter (inspired by Jefferson-Henrique/GetOldTweets-python).

  • Download your search results to a csv file
  • No authentication required
  • Works out-of-the-box

Install

  • Download the latest release from the release page. Supported platforms are Windows, macOS and linux.
  • Extract the downloaded .tar.gz file.

Usage

Search for tweets

Usage:
  squawks search tweets --out FILENAME [flags]

Flags:
      --exclude strings     exclude tweets by type of tweet [hashtags|nativeretweets|retweets|replies] (default [])
      --filter strings      find tweets by type of account or tweet [verified|follows|media|images|twimg|videos|periscope|vine|consumer_video|pro_video|native_video|links|hashtags|nativeretweets|retweets|replies|safe|news] (default [])
      --from string         find tweets sent from a certain user
      --geocode string      find tweets sent from certain coordinates (e.g. 35.6851508,139.7526768,0.1km)
  -h, --help                help for tweets
      --include strings     include tweets by type of tweet [hashtags|nativeretweets|retweets|replies] (default [])
      --lang string         find tweets by a certain language (e.g. en, es, fr)
      --near string         find tweets nearby a certain location (e.g. tokyo)
  -o, --out string          output csv filename (required)
  -q, --query string        query text to search
      --since string        find tweets since a certain day (e.g. 2014-07-21)
      --to string           find tweets sent in reply to a certain user
      --top                 find top tweets
      --until string        find tweets until a certain day (e.g. 2020-09-06)
      --url string          find tweets containing a certain url (e.g. www.example.com)
      --user-agent string   set custom user-agent
      --within string       find tweets nearby a certain location (e.g. 1km)

Example

Get tweets by username:

squawks --from 'barackobama' -o out.csv

Get tweets by query search:

squawks -q 'europe refugees' -o out.csv

Get tweets by username and bound dates:

squawks --from 'barackobama' --since 2015-09-10 --until 2015-09-12 -o out.csv

Get top tweets by username:

squawks --from 'barackobama' --top -o out.csv

Output CSV schema

  • id (int)
  • username (str)
  • created_at (datetime)
  • full_text (str)
  • retweet_count (int)
  • favorite_count (int)
  • reply_count (int)
  • quote_count (int)
  • latitude (float)
  • longitude (float)
  • lang (str)
  • source (str)

Build

make build

Test

make test