Created
March 14, 2010 04:27
-
-
Save tkosaka/331768 to your computer and use it in GitHub Desktop.
This file contains 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
// Post a tweet with a hash tag. | |
// Add this code to .keysnail.js. | |
hook.addToHook('PluginLoaded', | |
function () { | |
if (!plugins.twitterClient) { | |
return; | |
} | |
var tsuda_hash_tag = null; | |
function tsuda (ev, arg) { | |
if (!tsuda_hash_tag) { | |
display.echoStatusBar("You have to execute tsuda-change-hash-tag first.", 2000); | |
} | |
var tweet = tsuda_hash_tag; | |
if (arg) { | |
tweet += " " + arg; | |
} | |
plugins.twitterClient.tweet(tweet); | |
} | |
function tsudaChangeHashTag (ev, arg) { | |
prompt.read("Hash Tag:", | |
function (aReadStr, aUserArg) { | |
tsuda_hash_tag = aReadStr; | |
} | |
, null, null, tsuda_hash_tag); | |
}; | |
ext.add("tsuda", tsuda, "Automatically add a hash tag and post a tweet." | |
); | |
ext.add("tsuda-change-hash-tag", | |
tsudaChangeHashTag, | |
"Change the hash tag to add." | |
); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment