commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
This is the THIRD in a set of five commands. See my other commands for the previous two.
This step creates the oauth 1.0 token as explained in http://oauth.net/core/1.0/
The token is required for a Twitter filtered stream feed (and almost all Twitter API calls)
This token is simply an encrypted version of your base string. The encryption key used is your hmac.
The last part of the command scans the Base64 token string for '+', '/', and '=' characters and converts them to percentage-hex escape codes. (URI-escapeing). This is also a good example of where the $() syntax of Bash command substitution fails, while the backtick form ` works - the right parenthesis in the case statement causes a syntax error if you try to use the $() syntax here.
See my previous two commands step1 and step2 to see how the base string variable $b and hmac variable $hmac are generated.
There are 7 alternatives - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.