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
- A Mask binary, which you'll need to build yourself* (sorry)
- A directory of images to pull from
- 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