mask

command module
v0.0.0-...-74ff373 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2020 License: MIT Imports: 6 Imported by: 0

README

Mask

Mask is a CLI tool built to achieve one goal: changing your Twitter AVI to a random image from a specified directory. You can use it from the CLI, but it was written for use with Cron jobs in mind.

How to use

Mask is pretty simple to use, but there are some requirements.

Prerequisites

  1. A Mask binary, which you'll need to build yourself* (sorry)
  2. A directory of images to pull from
  3. A set of consumer keys and access tokens from Twitter.

1a. A Mask binary can be obtained by cloning the GitHub repository and running go build.
* Mask has only been built and tested on Linux, it should work on other operating systems but it has not been tested there nor is it supported.

2a. This is pretty self-evident. However, Twitter only supports PNG, JPG, GIF, so your images can only be of those formats.

3a. These can be obtained from Twitter's developer dashboard. You'll need to navigate to Twitter's developer site and create an application. From there you should have consumer tokens listed, and have the option to generate access tokens for your own account.

Config

Mask uses JSON as its config format of choice. If no config is found upon start, Mask will try its best to generate the needed structure and files*, and exit. Filling out the aforementioned appropriately and running again will allow Mask to proceed.

* Mask uses Go's os.UserConfigDir() method to find the directory in which user-specific configs are stored. It will create a mask subdirectory, and a mask.json file within that.

Structure
{
    "image_dir": "", // /path/to/image/dir
    "consumer_key": "", // Twitter consumer key
    "consumer_secret": "", // Twitter consumer key secret
    "oauth_token": "", // Twitter OAuth / access token for your account
    "oauth_token_secret": "" // Twitter OAuth / access token secret for your account
}

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
config
Package config implements config-related functionality
Package config implements config-related functionality
mask
Package mask implements the user-facing logic for the Mask application
Package mask implements the user-facing logic for the Mask application
twitter
Package twitter partially implements the Twitter API.
Package twitter partially implements the Twitter API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL