Setheck / tweetstreem

A cross platform twitter client for the terminal.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TweetStreem

Build - Go Go Report Card

A cross platform twitter client for the terminal. Inspired heavily by rainbowstream

Installation

To install, download the release package (tweetstreem.tar.gz) from the Releases page. Upon first run, it will prompt for login and store your tokens and configurations in $HOME/.tweetstreem.json

Note currently .tweetstreem.json stores your user token and secret (this is not username or password) in clear text, if you have security concerns with storing these twitter credentials in your home directory, you may want to avoid this application for now. You can always revoke these tokens by going to Twitter Applications while logged in and revoking the ~TweetStreem~ application.

Actions

  • config - show the current configuration
  • p,pause - pause the stream
  • r,resume - resume the stream
  • v,version - print tweetstreem version
  • o,open - open the link in the selected tweet (optionally provide 0 based index)
  • b,browse - open the selected tweet in a browser
  • rt,retweet - retweet the selected tweet
  • urt,unretweet - uretweet the selected tweet
  • li,like - like the selected tweet
  • ul,unlike - unlike the selected tweet
  • reply - reply to the tweet id (requires user mention, and confirmation)
  • cbreply - reply to tweet id with clipboard contents (requires confirmation)
  • t,tweet - create a new tweet and post (requires confirmation)
  • me - view your recent tweets
  • home - view your default timeline
  • q,quit,exit - exit tweetstreem.
  • h,help - this help menu :D

Configuration

Tweetstream will create $HOME/.tweetstreem.json Example of default configuration

{
  "config": {
    "twitterConfiguration": {
      "pollTime": "2m",
      "userToken": "*****",
      "userSecret": "*****"
    },
    "tweetTemplate": "\n{{ .UserName | color \"cyan\" }} {{ \"@\" | color \"green\" }}{{ .ScreenName | color \"green\" }} {{ .RelativeTweetTime | color \"magenta\" }}\nid:{{ .Id }} {{ \"rt:\" | color \"cyan\" }}{{ .ReTweetCount | color \"cyan\" }} {{ \"♥:\" | color \"red\" }}{{ .FavoriteCount | color \"red\" }} via {{ .App | color \"blue\" }}\n{{ .TweetText }}\n",
    "templateOutputConfig": {
      "MentionHighlightColor": "blue",
      "HashtagHighlightColor": "magenta"
    },
    "enableApi": false,
    "enableClientLinks": false,
    "apiPort": 8080,
    "autoHome": false
  }
}

Templating

Output of tweets is based on go templates and some home grown helpers. The default Template is:


{{ .UserName | color "cyan" }} {{ "@" | color "green" }}{{ .ScreenName | color "green" }} {{ .RelativeTweetTime | color "magenta" }}
id:{{ .Id }} {{ "rt:" | color "cyan" }}{{ .ReTweetCount | color "cyan" }} {{ "♥:" | color "red" }}{{ .FavoriteCount | color "red" }} via {{ .App | color "blue" }}
{{ .TweetText }}

which results in the following

Template Fields that exist are

  • CreatedAt - The time in string format when the tweet was created.
  • UserName - The twitter user name who created the tweet
  • ScreenName - The twitter handle who created the tweet
  • RelativeTweetTime - When the tweet occurred (ex: 1h37m19s ago if < 24 hours ago, 03/25/2020 01:07:21 otherwise)
  • ReTweetCount - # of retweets
  • FavoriteCount - # of favotires
  • App - Name of app that created the tweet
  • TweetText - Text of the tweet

Template Helpers that exist are

  • color <colorstr> <text to colorize>
  • format <createdAtstr> <go time format>

Note Windows terminal does not support colors

Available colors are

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • gray
  • white

Remote Commands

If the apiEnabled flag is true, tweetstream will start an rpc server and accept commands from client mode. This feature mainly exists, so that you can control the tweetstreem output from another terminal session.

If the enableClientLinks flag is true, when open or browse is used client side, the link will also be opened client side.

Client Mode

If you have another tweetstream running in api mode, you can send remote commands with the -c flag and your command. ex:

$ tweetstreem -c home

About

A cross platform twitter client for the terminal.


Languages

Language:Go 98.5%Language:Makefile 1.5%