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...

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 ...

Resources for getting a job as a software developer.

Preparation 0.) Elevate Code Interview Prep + Job Tracker Sheet I've created a google sheet that is great for job hunting. Track data about which jobs you've applied for and fill out the common questions with your answers so you don't have to think about what to say during the interview. https://docs.google.com/spreadsheets/d/1cVSuABWR1dwaF5j4AZ46grS9ggl37NaBY5X1bK2ktt0/edit?usp=sharing  1.) Github Git is the most widely used source control. Showing that you know how to use it and having a portfolio of code that employers can look at can give your career a boost. 2.) Leetcode Great for practicing in a style very similar to interviews, plus the discussion forums can show you a better way to solve things. There's a lot of great tutorials here as well. I highly suggest also posting your answers in a repo on Github. Don't try to memorize problems, but use it as a way to test your knowledge of applying the fundamentals. 3.) HackerRank Similar to Leetcode, bu...