Git Product home page Git Product logo

toot's Introduction

toot

A simple command-line utility that allows you to post a "toot" (equivalent of a Tweet) on the Mastodon social network.

Installation

npm install -g toot

Running first time

When you first run toot you will be asked some questions in order for toot to authenticate with your Mastodon service

> toot
Before you start using toot, you need to authenticate with your Mastodon server.
...

You will be asked for:

  • which instance of Mastodon are you posting to? - there are many e.g. toot.cafe
  • what name you want to give your app? - the name you pick here will show up in your Mastodon settings under "Authorized apps"

You will then be asked to visit a long URL in your browser and be prompted for one further piece of information:

  • the code displayed when you visit the URL?

This is a once-only operation. Then your configuration is saved (in ~/.mastodon.json).

Sending a toot

After the inital setup, sending a toot is a breeze:

> toot "I'm sending a Toot from the command-line!"

You can also pipe data from other processes into toot:

> cat longfile.txt | grep 'message' | toot

Options

  • --visibility/-v [direct|private|unlisted|public] - the visibility of the toot
  • --cw/-c - content warning text
  • --config [path] - location of the config file
  • --help - view help text
  • --version - show version number

e.g.

> toot --visibility private "secret"
> toot -v unlisted -c "Knock Knock" "Who's there?"

Why would I want this?

Perhaps you want to set up a Mastodon account for servers you are looking after. They can then be easily configured to send status updates:

> 
> toot "$HOSTNAME is going down for maintenance. Farewell dear friends"
> toot "$HOSTNAME is up. I'm back!"

Reconfiguring

If you want to reconfigure Toot from the beginning, simply delete the ~/.mastodon.json file and run toot again to reauthorise.

toot's People

Contributors

glynnbird avatar greenkeeperio-bot avatar marnanel avatar nolanlawson avatar vonkavalier 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

toot's Issues

Add --config flag

I would like to use this pkg in a CI environment, specifically appveyor, but the way .mastodon.json is saved makes it a bit difficult.

It would be nice if you could add a --config flag that would allow me to

  1. pass the entire json inline
  2. set the location/path of where the pkg looks for .mastodon.json

Allowing the json to be passed inline would let me set the contents of .mastodon.json as an environment variable and not have to worry about leaking my API keys anywhere.


So the CLI calls for these might look like

toot 'This is a test toot.' --config .
toot 'This is a test toot.' --config ./some/path/to/config/file
toot 'This is a test toot.' --config '{"domain":"mastodon.social","name":"example-app-name-v1","baseURL":"https://mastodon.social","id":4,"redirect_uri":"urn:ietf:wg:oauth:2.0:oob","client_id":"xxx","client_secret":"xxx","accessToken":"xxx"}'
toot 'This is a test toot.' --config $Env:APPVEYOR_TOOT_AUTH_JSON

Add a flag to set visibility

It would be great if we could set the visibility of our toots, like a --visibility flag.

And it could accept one of the four available options:

  • public (default?)
  • unlisted
  • private
  • direct

Example: toot "Dear followers..." --visibility private

Unable to Reconfigure/Reauthorize the App

Hi.

I installed Toot via npm in MacOS Sierra, and configured setup the app name and pointed it at my Mastodon instance, and got the token. Everything works. However, I didnt realize the name of the app would appear in the Authorized Apps page on my Mastodon account, so I decided to delete the authorization, and set up the app connection again. This is where Toot doesnt seem to work.

I retyped "toot" in the Terminal and nothing happens. I am not asked to reconfigure anything. I uninstalled and reinstalled and it doesnt seem to do anything. Also, I cant seem to understand the "-c" configuration. To my knowlege there is no configuration file.

Would you help me be able to reauthroize the app with my Mastodon instance?

Thanks.

David

Piping a toot in from a file or command

What I expect: this would work

emv$ echo "can I pipe a toot into toot" | toot
emv$ cat tootfile | toot

What I got:

Error: Usage: toot <message>

Workaround: if you have a toot in a file, you can toot it out with toot "$(cat tootfile)"

toot not recognised on Windows 10 device

I have a Windows 10 x64 PC with Node 8.9.0 installed. When I run "node" the outputs were all right.

I did "npm install -g toot" and got toot installed globally, but when I run "toot blablabla" I keep getting this:

Fatal error in launcher: Unable to create process using '"'

I have uninstalled all python versions from my computer.

I then tried "npm install toot" and I managed to get the app working by navigating to that directory where toot is downloaded and running "node toot.bin.js".

So why is it that toot couldn't be executed globally? You know because the app is great but it needs perhaps some more elegance?

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.