Skip to content

👍 ottosocial is a CLI to schedule tweets via CSV

Notifications You must be signed in to change notification settings

Phantas0s/ottosocial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ottosocial logo travis CLI Hits-of-Code License Go Report Card Codacy Badge

ottosocial is a CLI which allows you to schedule and send automatically messages on social media, from a CSV file.

You can send threads by separating your tweets with a pipe |. As a result, you can't use the pipe as a character in a tweet.

For now, only Twitter is supported.

ottosocial is in beta. Breaking changes might come.

Menu

Installation

General

You can simply grab the latest released binary file and download the version you need, depending on your OS.

Linux script

If you use a Linux based OS, here's a simple way to download ottosocial and move it in /usr/local/bin to be able to use it globally.

curl -LO https://raw.githubusercontent.com/Phantas0s/ottosocial/master/install/linux.sh && \
./linux.sh && \
rm linux.sh

Manual installation

You need to clone this repository and build the binary in the root directory.

Getting Started

First, you need to authorize ottosocial to send tweets from your twitter account. To do so:

  1. Go to Twitter app management. Log in if necessary.
  2. Click on "Create an app".
  3. Fill the required fields.
  4. You'll need to copy the following to authorize ottosocial to send tweets:
    • API key,
    • API secret key,
    • Access Token
    • Access Token Secret provided,

See below the configuration to include everything to the configuration file.

Commands

For now, only the command csv is available.

I advise you to use a terminal multiplexer or & to run ottosocial in the background.

Configuration

Some configuration is required in order to run ottosocial. Here's the detail:

Name Description Flag Type Required default
key Twitter API key --key, -k string yes -
secret Twitter API secret key --secret, -s string yes -
token Twitter Access Token --token, -t string yes -
token-secret Twitter Access Token Secret --token-secret, -j string yes -
logpath File path of the log file --logpath, -l string no -
file File path of the CSV --filepath, -f string yes -
verify Verify each tweet --verify, -v boolean no false

NOTES:

  • If logpath is not filled, the default output will be the shell. I advise you to use a logpath and tailing it at all time to see every error.
  • If verify is true, ottosocial will stop if one (or more) tweets are invalid.

You can either way use flags, a configuration file, or both at the same time.

Using flags

If you use only flags, you'll need to precise every required configuration field directly when you launch ottosocial.

For example:

ottosocial csv --key=1234 --secret=5678 --token=910-11 --token-secret=12KK --logpath=/tmp/ottosocial-logs -v -f ./test.csv

Configuration File

This is the simplest way to use ottosocial. You'll need to create the file ~/ottosocial.yml (directly in your home directory) and add your configuration there. For example:

---
key: 1234 # API key
secret: 5678 # API secret key
token: 910-11 # Access token
token-secret: 12KK # Access token secret
logpath: /tmp/ottosocial-logs
file: ~/my-tweets.csv

Then, you simply need to launch ottosocial.

CSV Format

ottosocial can send tweets from a CSV. It needs to have two columns: date (when the tweet will be sent) and message.

For example:

2020-01-23 07:57,This is a test
2020-01-23 08:00,"This is a test, with quotes"

You need to respect the date format. If the date is in the past, the tweet will never be sent.

NOTES:

  • If you modify the CSV, you need to relaunch ottosocial. I might implement hot reloading later, if somebody is interested in that.

Contribute

Thanks a lot if you want to contribute to ottosocial!

I think the "talk, then code" practice is pretty good to avoid misunderstandings and hours of work for nothing.

Therefore:

"Every new feature or bug fix should be discussed with the maintainer(s) of the project before work commences. It’s fine to experiment privately, but do not send a change without discussing it first."

Acknowledgement

The logo uses Maria Letta mega doodle pack. Thanks for these great illustrations.

Licence

Apache Licence 2.0