Giter Site home page Giter Site logo

keltia / forthlift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nojhan/forthlift

0.0 3.0 0.0 156 KB

A command line app to post sequences of text lines on social media: prepare your sequence of status in your text editor, then post everything.

License: GNU Affero General Public License v3.0

Python 100.00%

forthlift's Introduction

forthlift — post sequences of texts on social media

Forthlift is a command line application to post sequences of text lines on social media.

Its main use case is to post on Twitter several status that you have prepared first in your text editor.

It is thus designed to ease automation and integration in existing tools and had an Unix-like text-and-pipes command line interface.

For example, it makes it easy to post "chained" twitter status (that answer to each others) from your text editor. Just send the selected text to its standard input, selecting the twitter API, and voilà. Using Vim, you can tweet the visually-selected lines with: :'<,'>w !forthlift -a twitter

SYNOPSIS

forthlift [-h]

forthlift [-a {stdout,twitter}] [-m MAXLEN] [-i|-t] [-c] [-q] [-d] [-s]

DESCRIPTION

A generic tool

Generally speaking, it's a Unix-like command that operate a sequence of pre-programmed chained actions on its text input.

It comes with some existing actions:

  • stdout: print the input text on the standard output,
  • twitter: send the input text as status on twitter.

Features

The main feature of forthlift is its ability to chain actions. Depending on the chosen API, this could means different things:

  • for twitter, this mean that the sequence of status will be posted as a sequence of answers and not as a list of independent tweets.

  • for the "stdout" API, this means that each printed line will start with its index in the input list.

While it is recommended to prepare the input text with other text-processing tools (fold, fmt, tr, sed, grep, your text editor, etc.), forthlift comes with some rough text-processing capabilities, among which:

  • ignore or trim lines that are longer than a given size (see --trim and --ignore),

  • add a counter of the form <current index>/<total lines> at the end of the lines (see --counter).

OPTIONS

  • -h, --help: show this help message and exit

  • -a {stdout,twitter}, --api {stdout,twitter}: Name of the API to use. (default: stdout)

  • -m MAXLEN, --max-len MAXLEN: Maximum number of characters in the lines. (default: 140)

  • -i, --ignore: Ignore lines that are longer than MAXLEN (default: False)

  • -t, --trim: Trim down lines that are longer than MAXLEN. (default: False)

  • -c, --counter: Add a counter of the form " x/N" at the end of the lines, with N being the number of lines read and x the current index of the line. NOTE: this necessitate to read all the input before processing it. (default: False)

  • -q, --quiet: Do not print errors and warnings on the standard error output. (default: False)

  • -s, --setup: Setup the selected API (e.g. authenticate and get authorization to post). (default: False)

  • -d, --independent: Post each item independently from the previous one The behaviour of this option depends on the selected API. For example on Twitter: do not post a line as an answer to the previous one but as a new tweet. (default: False)

INSTALLATION

Twitter

  1. Copy twitter.conf-dist as twitter.conf and indicate your developer's API keys in the corresponding fields.
  2. Run forthlift --api twitter --setup and follow the instructions (go to the given URL, then paste the given PIN).

Why should you get developer's API keys? Because Twitter does not like open-source desktop applications, see: http://arstechnica.com/security/2010/09/twitter-a-case-study-on-how-to-do-oauth-wrong/

forthlift's People

Contributors

nojhan avatar

Watchers

Ollivier Robert avatar James Cloos avatar  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.