Skip to main content

How to Tweet from the Command Line on Mac

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.

1.) Install Homebrew, a package manager for Mac.
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

Popular posts from this blog

How to solve print_bits on the 42 Exam

How to solve print_bits on the 42 Exam This is a walkthrough of how to do the print_bits assignment for the 42 exam. Assignment name : print_bits Expected files : print_bits.c Allowed functions: write -------------------------------------------------------------------------------- Write a function that takes a byte, and prints it in binary WITHOUT A NEWLINE AT THE END. Your function must be declared as follows: void print_bits(unsigned char octet); Example, if you pass 2 to print_bits, it will print "00000010" 1.) Make sure you have a good understanding of bits and bytes with the video above. 2.) Then you need to understand bit shifting. It’s a simple concept and Jamie Dawson has a great short tutorial on it here: Basic Bit Shifting Guide 3.) Understanding Bitwise Operators: I found the Swift guide on bitwise operators to be the best. https://docs.swift.org/swift-book/LanguageGuide/AdvancedOperators.html 4.) Solving Print Bits // solu

CodeCademy Explaination -- Javascript Search Text For Your Name 5/7

First, don't feel bad, this lesson's instructions are kind of confusing. You can skip to what you need if you want. 4 Posts: 1.) Explaining For Loops 2.) Exercise 5/7's if statement 3.) Exercise 5/7's inner loop 4.) Exercise 5/7's push statement 1.)  First you need to understand how  for loops  work. For loops are really useful for doing something over and over.  Example: For every horse in the barn, tell me the horse's name and it's age.  You'll be going to a horse over and over again to get it's name and age. But computers are stupid so you have to be reallyyyy specific about it, like this: For ( every horse in the barn starting at the one in the first stall; until you get to the 12th stall; go to the next stall) { This is what I want you to do at every stall. Get it's name and age.} Now for the computer to understand us we have to speak Javascript to it because it doesn't know English. In Javascript, that's a for loop

Preparing for the 42 Piscine

You can come to the 42 Piscine with no programming experience but if you would like something to study ahead of time here are my 2 suggestions. All this content is free 1.) Learning how to learn on Coursera. This will help you develop the good study habits you will need during the piscine.  https://www.coursera.org/learn/learning-how-to-learn 2.) C Programming Tutorials by Caleb Curry I haven't used this series myself but I have had it recommended a lot, many people have told me it helped them during the piscine so if you'd like to try your hand at C before the piscine you can follow along with these tutorials. https://www.youtube.com/watch?v=CPjZKsUYSXg&list=PL_c9BZzLwBRKKqOc9TJz1pP0ASrxLMtp2 3.)  Khan Academy Brush up on your math skills fore free with Khan Academy. They have both the instructions as well as exercises for practice. Mostly you'll be working with more basic arithmetic for the piscine, but you'll have a few exercises that require more math