Created
October 13, 2013 15:46
-
-
Save woxtu/6963724 to your computer and use it in GitHub Desktop.
Tweet in Rouge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Rouge 0.0.14 | |
| (require "oauth") | |
| (def *consumer-key* "YOUR CONSUMER KEY") | |
| (def *consumer-secret* "YOUR CONSUMER SECRET") | |
| (let [consumer-token (OAuth.Consumer. *consumer-key* *consumer-secret* | |
| {:site "https://api.twitter.com/"}) | |
| request-token (.get_request_token consumer-token)] | |
| (puts "Open the following URL and grant access to your account") | |
| (puts (.authorize_url request-token)) | |
| (puts "Enter the PIN") | |
| (let [pin (-> STDIN .gets .chomp) | |
| access-token (.get_access_token request-token {:oauth_verifier pin})] | |
| (.post access-token | |
| "https://api.twitter.com/1.1/statuses/update.json" | |
| {:status "Tweet something"}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment