Giter VIP home page Giter VIP logo

tw-rs's Introduction

Command Line Interface Tweeter (rust version)

Build Status

Screenshot in alacritty:

Displaying a user's timeline in a terminal.

The rust version of this tool is somewhat faster than its haskell counterpart, but the haskell one has a couple more features.

Reasons to use tw-rs:

  • Faster than other tools (t, tweet-hs, oysttyer)
  • Lightweight (5MB executable)
  • Unobtrusive
  • You know rust and like being able to extend your tools
  • You want something that can be called from vim
  • Support for colored output
  • You want a twitter library for rust.
  • Can be used in scripts
  • BSD3 licensed

Reasons not to use tw-rs:

  • Several features are still in development
  • Fewer features than rainbowstream, t, or oysttyer
  • You want to extend your tools in haskell
  • You want "twitter in a terminal" that rainbowtools or oysttyer provides.
  • You want to be able to easily tweet emoji

Config

Generate a token to authorize access to your twitter account by following the guide here

Then place your API keys and OAuth tokens in a file (default is $HOME/.cred), separated by a line break:

api-key: API_KEY_HERE
api-sec: API_SECRET_HERE
tok: OAUTH_TOKEN_HERE
tok-sec: TOKEN_SECRET_HERE

Note that the labels must in the correct order, and separated from the keys with whitespace.

Installation

If you're on Linux/Windows the best way is probably to download the binaries from the releases page here.

Otherwise, you'll have to build from source. To build from source, install cargo with rustup; on unix systems this is as simple as

curl https://sh.rustup.rs -sSf | sh

Then type cargo install tw-rs.

Use

View Profiles

To get your profile, simply type:

$ tw user

To view a user's profile, type e.g.

$ tw user lemondefr

If you have any problems along the way:

$ tw help

Sending tweets

$ tw send "YOUR_TWEET_TEXT"

Viewing your timeline

You can also use

$ tw view

to view your own timeline.

Features

  • tweet
  • view timeline
  • view user profiles
  • output with id of tweet
  • delete tweet
  • retweet
  • reply to tweet
  • fav/unfav tweets
  • follow/unfollow users
  • display quoted tweets alongside
  • fetch mentions
  • block accounts

Speed

In the bash directory you will find a script that times tw-rs, tweet-hs, oysttyer, and t fetching tweets. On linux, it consistently places tw as the fastest.

Comparison to other command-line clients

Tool Language Color output Interactive Vim plugin support Scriptable Send emoji
tw Rust x x x
rainbowstream Python x x x
oysttyer Perl x ½
tweet-hs Haskell x x x
t Ruby ½ x

Screenshots (alacritty + solarized dark)

tw

Displaying a user's timeline in a terminal.

t

Displaying a user's timeline in a terminal.

rainbowstream

Displaying a user's timeline in a terminal.

tweet

Displaying a user's timeline in a terminal.

oysttyer

Displaying a user's timeline in a terminal.

Some results

These aren't 100% great benchmarks since twitter's load varies, but tw does come in first consistently. This is done with haskell's bench tool.

Timed results.

Coloring

tw-rs respects the CLICOLOR behavior defined here. If you wish to disable colorization,

 $ export CLICOLOR=0

Emoji

To make tw use standard unicode in place of symbol fonts, simply set

 $ export DISABLE_EMOJI

Library

A library is included. It's fairly easy to use once you have the credentials set up, though it requires a fixed oAuth token.

Haskell

There is a haskell version of this, with a binary and a library, available here. The haskell library is more complete.

tw-rs's People

Contributors

cardoe avatar vmchale avatar

Watchers

James Cloos 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.