Skip to content

Instantly share code, notes, and snippets.

@MikeWills
Created April 11, 2011 18:56
Show Gist options
  • Save MikeWills/914056 to your computer and use it in GitHub Desktop.
Save MikeWills/914056 to your computer and use it in GitHub Desktop.
Send a Tweet using an old method. This code may not work anymore. Documented on [the midrange.com wiki](http://wiki.midrange.com/index.php/SNDTWTMSG)
PGM PARM(&USER &PASS &TWEET)
DCL VAR(&USER) TYPE(*CHAR) LEN(30)
DCL VAR(&PASS) TYPE(*CHAR) LEN(30)
DCL VAR(&TWEET) TYPE(*CHAR) LEN(140)
DCL VAR(&CMD) TYPE(*CHAR) LEN(300)
CHGVAR VAR(&CMD) VALUE('/installedApps/curl/curl --basic +
--user ' || &USER *TCAT ':' || &PASS *TCAT ' +
--data status="' || &TWEET *TCAT '" +
http://twitter.com/statuses/update.xml')
QSH CMD(&CMD)
ENDPGM
CMD PROMPT('Send Tweet')
PARM KWD(USER) TYPE(*CHAR) LEN(30) CASE(*MIXED) +
PROMPT('User Name')
PARM KWD(PASS) TYPE(*CHAR) LEN(30) CASE(*MIXED) +
DSPINPUT(*NO) PROMPT('Password')
PARM KWD(TWEET) TYPE(*CHAR) LEN(140) CASE(*MIXED) +
PROMPT('Tweet')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment