GitHub - hughrun/yawp: command line app for publishing social media posts Skip to content Sign up Sign up Why GitHub? Features → Mobile → Actions → Codespaces → Packages → Security → Code review → Project management → Integrations → GitHub Sponsors → Customer stories→ Team Enterprise Explore Explore GitHub → Learn and contribute Topics → Collections → Trending → Learning Lab → Open source guides → Connect with others The ReadME Project → Events → Community forum → GitHub Education → GitHub Stars program → Marketplace Pricing Plans → Compare plans → Contact Sales → Education → In this repository All GitHub ↵ Jump to ↵ No suggested jump to results In this repository All GitHub ↵ Jump to ↵ In this user All GitHub ↵ Jump to ↵ In this repository All GitHub ↵ Jump to ↵ Sign in Sign up Sign up {{ message }} hughrun / yawp Notifications Star 0 Fork 0 command line app for publishing social media posts AGPL-3.0 License 0 stars 0 forks Star Notifications Code Issues 1 Pull requests 0 Actions Projects 0 Security Insights More Code Issues Pull requests Actions Projects Security Insights main Switch branches/tags Branches Tags Nothing to show {{ refName }} default View all branches Nothing to show {{ refName }} default View all tags 1 branch 1 tag Go to file Code Clone HTTPS GitHub CLI Use Git or checkout with SVN using the web URL. Work fast with our official CLI. Learn more. Open with GitHub Desktop Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio If nothing happens, download the GitHub extension for Visual Studio and try again. Go back Latest commit   Git stats 12 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time src add more detail to README Apr 12, 2021 .gitignore more readme updates Apr 12, 2021 Cargo.lock Initial code commit Apr 12, 2021 Cargo.toml minor updates to cargo.toml and readme Apr 12, 2021 LICENSE Initial commit Apr 11, 2021 README.md add yawp definition to readme Apr 12, 2021 example.env add more detail to README Apr 12, 2021 View code yawp In brief Installation MacOS or Linux From source Usage: Flags: Options: Args: Environment variables Mastodon Twitter Examples README.md yawp A command line (CLI) app for publishing social media posts. In brief yawp takes some text as an argument and publishes it to the social media accounts of your choice. No need to read the comments, just send your yawp and move on with your day. Current options are Twitter and Mastodon, it's possible more will be added in future (or not). yawp is specifically designed to fit within a broader toolchain: in general terms it tries to follow "the Unix philosophy": can take input from stdin (e.g. redirected from a file or another process) outputs the message as plaintext to stdout (i.e. the output is the input) takes all configuration from environment (ENV) values to enable flexibility Installation MacOS or Linux Download the relevant binary file from the latest release. Save it somewhere in your PATH, e.g. in /usr/local/bin/. Alternatively you can symlink it from wherever you want to save it, like this: ln -s /my/awesome/directory/yawp /usr/local/bin/ From source If you're using another platform or don't trust my binaries you can build your own from source: git clone or download the repository as a zip. cargo build --release Usage: yawp [FLAGS] [OPTIONS] Flags: -h, --help Prints help information -m, --mastodon Send toot -q, --quiet Suppress output (error messages will still be sent to stderr) -t, --twitter Send tweet -V, --version Prints version information Options: -e, --env path to env file Args: Message (post) to send. If using stdin you must provide a hyphen (-) as the argument. However if you do this and are not redirecting stdin from somewhere, yawp will hang your shell unless you supply EOF by pressing Ctrl + D. (See example 5 below). Environment variables yawp requires some environment variables in order to actually publish your message. You can set these in a number of ways depending on your operating system. yawp also allows you to call them in from a file. See example 6 for using a file or example 7 for setting environment values at the same time you call yawp. An example environment variables file is provided at example.env. The possible values are: Mastodon For Mastodon you need the base url of your instance (server), and an API access token. MASTODON_ACCESS_TOKEN - You can create a token at settings - applications in your Mastodon account. You require write:statuses permission. MASTODON_BASE_URL - This is the base URL of your server. e.g. https://mastodon.social Twitter For Twitter you need the four tokens provided when you create an app at https://developer.twitter.com/en/apps. TWITTER_CONSUMER_KEY TWITTER_CONSUMER_SECRET TWITTER_ACCESS_TOKEN TWITTER_ACCESS_SECRET Examples Provide message on command line: yawp 'Hello, World!' -t # Output: Hello, World! # Tweets: Hello, World! Pipe in message: echo 'Hello again, World!' | yawp - -m # Output: Hello again, World! # Toots: Hello again, World! Read from file # create a file (echo Hello fronds; echo " It's me"; echo ...a tree 🌳) > message.txt # run yawp and direct file content into it yawp - output.txt # the message.txt and output.txt files are now identical. Read from user input This is not really recommended, but you may find yourself facing a user input prompt if you use a hyphen without providing any redirected input. i.e. if you do this: yawp - # machine awaits user further input from command line Don't panic, you can provide the message text by typing it in at the command prompt. There is a catch, however, in that yawp will wait for further input until it reaches EOF (End of File). This will not happen when you press Enter but can usually be provided by pressing Ctrl + D: yawp -t - # machine awaits user further input from command line Awoo! [Ctrl + D] # Output: Awoo! # Tweets: Awoo! Provide environment variables from file In some situtations (e.g. when using Docker Compose) you may have already set environment variables specific to those needed by yawp. If not, you can call them in from a file by providing the filepath using -e or --env: yawp -m --env 'yawp.env' 'I love to toot!' Provide environment variables on command line You could also set ENV settings manually when you call yawp: MASTODON_BASE_URL=https://ausglam.space MASTODON_ACCESS_TOKEN=abcd1234 yawp -m '🎺 I am tooting!' About command line app for publishing social media posts Resources Readme License AGPL-3.0 License Releases 1 0.1.0 Latest Apr 12, 2021 Packages 0 No packages published Languages Rust 96.8% Shell 3.2% © 2021 GitHub, Inc. Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About You can’t perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.