Difference between revisions of "SNDTWTMSG"

From MidrangeWiki
Jump to: navigation, search
(Changed to use consistent operators when constructing &CMD)
m (Add See also and Categories sections)
Line 24: Line 24:
 
             PARM      KWD(TWEET) TYPE(*CHAR) LEN(140) CASE(*MIXED) +
 
             PARM      KWD(TWEET) TYPE(*CHAR) LEN(140) CASE(*MIXED) +
 
                           PROMPT('Tweet')
 
                           PROMPT('Tweet')
 +
 +
==See also==
 +
*[[Twitter]]
 +
 +
==Categories==
 +
[[Category:Open Source]]

Revision as of 16:40, 24 April 2009

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.

You will need the AIX binary of cURL from here. You will need version 7.13.1. Once extracted, put the curl object into a folder on the IFS.

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 |< ':' || &PASS |< ' +
                         --data status="' || &TWEET |< '" +
                         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') DSPINPUT(*NO)
            PARM       KWD(TWEET) TYPE(*CHAR) LEN(140) CASE(*MIXED) +
                         PROMPT('Tweet')

See also

Categories