Giter Site home page Giter Site logo

command-line-tweeter's Introduction

Command Line Interface Tweeter

Windows build status Build Status Hackage

Displaying a user timeline in a terminal.

tweet-hs is a command-line tool for twitter. It has more features than its rust counterpart and it's a bit slower.

Reasons to use tweeth-hs:

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

Reasons not to use tweet-hs:

  • You want "twitter in a terminal" that rainbowtools or oysttyer provides.
  • You want to be able to easily tweet emoji

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

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 ~/.cred.toml, as in the following example:

api-key = "API_KEY_HERE"
api-sec = "API_SECRET_HERE"
tok = "OAUTH_TOKEN_HERE"
tok-sec = "TOKEN_SECRET_HERE"

Installation

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

To build from source, install haskell stack; on unix systems this is as simple as

wget -qO- https://get.haskellstack.org/ | sh

Then type stack install tweet-hs it will put an executable called tweet on your path.

Use

View Profiles and timelines

To get your timeline, simply type:

tweet view

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

tweet user NateSilver538 --color

Sending tweets

To send a tweet:

tweet send "This is my tweet"

Input from stdin

To tweet from stderr, run a command that pipes stderr to stdin, i.e.

stack build &>/dev/null | tweet input

The tweet executable reads from stdin only, but you can view the options (replies, number of tweets to thread, etc.) with

tweet --help

This script powers the twitter account @my_build_errors for instance. There's an example bash script for in bash/example

Viewing your timeline

You can also use

tweet view

or

tweet view --color

to view your own timeline.

GHCi integration

You can define the following in your ~/.ghci

:def tweet (\str -> pure $ ":! tweet send \"" ++ str ++ "\"")

Completions

The directory bash/ has a mkCompletions script to allow command completions for your convenience.

Library

A haskell package is included. It's fairly easy to use once you have the credentials set up, with two main functions: thread and basicTweet: the first for threading your own tweets or replying to someone else's and the second for just tweeting.

command-line-tweeter's People

Contributors

vmchale avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

command-line-tweeter's Issues

-n/--count seem to have no effect

~$ tweet -c ~/.cred.LedgerTips.toml view -n10 
🐦

LedgerTips (LedgerTips):
    https://t.co/ZqSbWioO30 - You Need A Budget to beancount converter #beancount #plaintextaccounting
    💜0   0  948206821570887687

LedgerTips (LedgerTips):
    https://t.co/Fr8pC0Ao08
    #plaintextaccounting #hledger #ledgercli
    💜5   0  947573550897963008

LedgerTips (LedgerTips):
    RT @dmmerzlyakov: @LedgerTips One more ledger-like! https://t.co/V0Df3VmNzI - .Net, ledger tests passed, public beta. Welcome! #plaintextac…
    💜3   1  947571999202668544

LedgerTips (LedgerTips):
    RT @simonkwmichael: #hledger 1.5 released on schedule. https://t.co/egY9FwEOey
    Auto postings, periodic txns, budget report, and more: https…
    💜7   4  947570275918364673


tweet: <stdout>: commitBuffer: invalid argument (invalid character)

Hi Dear,
I download windows version of your application and insert this code:
tweet-x86_64-pc-windows.exe -c ~/.cred.LedgerTips.toml view -n10

but output was :
tweet-x86_64-pc-windows.exe: <stdout>: commitBuffer: invalid argument (invalid character)

where is my problem?

cheers

possible typo, wishes

Loving this! Thanks! Some wishes:
tweet --version
tweet show TWEETID
tweet COMMAND --open # view corresponding part of web ui if any

Informative readme. "Reasons not to use tweet-hs: You want to extend your tools in haskell" - is that a typo ?

not installable from stackage

With lts-10.0 configured as global resolver, stack install is currently failing:

~$ stack install tweet-hs

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for tweet-hs-1.0.1.33:
    composition-prelude must match -any, but the stack configuration has no specified version (latest matching version is 0.1.1.4)
    htoml-megaparsec must match -any, but the stack configuration has no specified version (latest matching version is 1.0.1.11)
needed since tweet-hs is a build target.

Some potential ways to resolve this:

  * Recommended action: try adding the following to your extra-deps in /Users/simon/.stack/global-project/stack.yaml:

- composition-prelude-0.1.1.4
- htoml-megaparsec-1.0.1.11

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * You may also want to try using the 'stack solver' command.

Plan construction failed.

Windows Issue

When I tried it to run it on Windows, I got the following error:

failed :(
error code: 401

Any suggestion !!

too many names

Different names is bad for memorability/marketing.

github: command-line-tweeter
hackage: tweet-hs
executable: tweet
--help: clit

timeline streaming

the ability to stream a timeline is my primary use-case for these tools. Are there any plans to add such a feature?

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.