c:twitter.awk
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
c:twitter.awk [2011/07/24 17:52] – created neutronscott | c:twitter.awk [2023/11/04 22:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | The code is viewable [[http:// | + | ====== Twitter.awk ====== |
- | The part that I' | + | [[http:// |
+ | |||
+ | ===== Challenges ===== | ||
+ | |||
+ | Starting from the beginning, and ending at the latest.. | ||
+ | |||
+ | ==== JSON ==== | ||
+ | awk doesn' | ||
+ | |||
+ | ==== OAuth ==== | ||
+ | Twitter requires HMAC-SHA1. This isn't hard with a pipe to openssl and base64. | ||
+ | |||
+ | ==== Unicode ==== | ||
+ | This challenge was revisited a couple times. I now know what Unicode and UTF-8 actually are! :) ASCII is define as first 127 (bit 7 is 0) to keep backward compat | ||
+ | |||
+ | JSON will express this Euro as \u20ac in a string. I first have to convert to UTF-8 to display to terminal. Then I have to URL encode it to re-send to Twitter. In awk, sprintf(" | ||
+ | |||
+ | ==== HMAC-SHA1 ==== | ||
+ | I wanted to drop dependancy on OpenSSL CLI, so I wrote HMAC-SHA1 routine in awk using binary strings. :) | ||
+ | |||
+ | IT WORKS! It' | ||
+ | |||
+ | It was mostly creating functions that did binary operations using strings. Then a direct implement of the wikipedia pseudo-code, but I had to refer to the actual FIPS specification to realize some things. It almost worked on the first go. Then a bug with padding | ||
+ | |||
+ | Then a quick base64(), which wasn't hard to debug. I just was missing ' | ||
+ | |||
+ | ===== Source ===== | ||
+ | |||
+ | Decided to start using my github account and have been pushing the code to: http:// |
c/twitter.awk.1311529969.txt.gz · Last modified: 2023/11/04 22:29 (external edit)