To post to twitter from the command line as of Oct 8, 2018. (Twitter is always changing though.)
Homebrew is a package manager for Mac. You can use it to download and install things.
Oysttyer is a CLI (command line interface) for Twitter.
Oysttyer is a CLI (command line interface) for Twitter.
1.) Install Homebrew, a package manager for Mac.
Copy and paste the following to install brew. More information about brew here https://brew.sh/
Copy and paste the following to install brew. More information about brew here https://brew.sh/
mkdir $HOME/.brew && curl -fsSL https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C $HOME/.brew
mkdir -p /tmp/.$(whoami)-brew-locks
mkdir -p $HOME/.brew/var/homebrew
ln -s /tmp/.$(whoami)-brew-locks $HOME/.brew/var/homebrew/locks
export PATH="$HOME/.brew/bin:$PATH"
brew update && brew upgrade
1b.) Afterwards make sure you add the following lines to your .zshrc.
mkdir -p /tmp/.$(whoami)-brew-locks
export PATH="$HOME/.brew/bin:$PATH"
The
~/.zshrc
doesn’t exist by default in Mac OS X so you may need to create it. The ~/ translates to your user’s home directory and the .zshrc is the ZSH configuration file itself. Just open up iTerm and type this in to create the file:vim ~/.zshrc
*note, I am using vim to create it the .zshrc file, but you can use whatever editor you like.
2.) Next let's install and run Oysttyer. Put these commands into iTerm. More information about oysttyer here https://github.com/oysttyer/oysttyer
brew install oysttyer
(Homebrew is a bit slow, give it a few minutes.)cd ./.brew/Cellar/oysttyer/2.9.1/bin/
(You may have a different version, you can use ls
to figure out what's inside the oysttyer folder, just replace the 2.9.1)perl ./oysttyer
(This runs the oysttyer. When it tells you to restart oysttyer, just type this again.)
3.) Read the prompt from there. But basically you press enter, then you get a url to go to twitter's website, get a pin from there to authorize oysttyer. Then you can tweet. Anything you type without a / in front is sent as a tweet. It's a bit slow so give it a moment to send.
4.) DONE.
P.S. inside oysttyer, you can type /help for commands
Comments
Post a Comment