Twit To be continued.

    Start.
    I correct the previous version of the script. Now I will check the response from the twitter server to make sure the message is delivered. The message itself will be received from stdin.
    So now using the tws.xsl xsl file:







    I will check if the id of the new message exists in the response. Actually the script itself:
    #! / bin / sh
    # Made by rsk - http://rsk.me
    # Imports $ TPASS, $ TUSER
    . ~ / .twit / pass
    XSLPATH = / etc / twit / twit.xsl
    echo "Type in your message ..."
    MSG = "$ (perl -e '$ _ = <>, print')"
    echo -n "Sending ..."
    RESULT = $ (curl --basic --user $ TUSER: $ TPASS --data status = "$ MSG" http://twitter.com/statuses/update.xml 2> / dev / null | xsltproc $ XSLPATH - | tail -n 1)
    if [-n "$ RESULT"]; then
    echo "ok";
    else
    echo "Sending failed!";
    fi
    



    Do not forget about the file ~ / .twit / pass

    ps the article was rewritten, because initially the script was, to put it mildly, not optimal, which was noticed by comrade crash

    Also popular now: