SNDTWTMSG

From MidrangeWiki
Revision as of 15:25, 24 April 2009 by Koldark (talk | contribs) (New page: Want a simple and free way to send a message to Twitter from your System i? Here you go. I am releasing this as an Open Source release. Please improve on the coding and update this page wi...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Want a simple and free way to send a message to Twitter from your System i? Here you go. I am releasing this as an Open Source release. Please improve on the coding and update this page with your changes.

SNDTWTMSG.CLLE

            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

SNDTWTMSG.cmd

            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) +
                         PROMPT('Password')
            PARM       KWD(TWEET) TYPE(*CHAR) LEN(140) CASE(*MIXED) +
                         PROMPT('Tweet')