X-Git-Url: http://git.harvie.cz/?p=mirrors%2Flibpurple-core-answerscripts.git;a=blobdiff_plain;f=purple%2Fanswerscripts.sh;h=4410ee473e9af61f422cf55d292bc9b6f6f9c30e;hp=dbcb548a4b74f971651b21022cc47adc154f9a00;hb=2270485e8ffed1081f810d3352fd53d1b3ee2e6d;hpb=246236307770bb01b2c9d7f1fe21027b93f3f5a6;ds=sidebyside diff --git a/purple/answerscripts.sh b/purple/answerscripts.sh index dbcb548..4410ee4 100755 --- a/purple/answerscripts.sh +++ b/purple/answerscripts.sh @@ -1,31 +1,9 @@ #!/bin/sh - +# # This file is called for every message received by libpurple clients (pidgin,finch,...) -# - Following env values are passed to this script: -# - ANSW_FROM (who sent you message) -# - ANSW_MSG (text of the message) -# - ANSW_STATUS (unique ID of status. eg.: available, away,...) -# - ANSW_STATUS_MSG (status message set by user) -# - WARNING: You should mind security (don't let attackers to execute their messages/nicks!) -# - Each line of output is sent as reply to that message -# - You can try to rewrite this script in PERL or C for better performance (or different platform) +# - You can try to rewrite this script in PERL or C for better performance (or different platform) - let me know # - On M$ Windows answerscripts.exe from libpurple directory will be called instead of this script # -# Basic example can look like this: -# [ "$ANSW_STATUS" != 'available' ] && echo "<$ANSW_FROM> $ANSW_MSG" && echo "My status: $ANSW_STATUS_MSG"; -# -# There are lot of hacks that you can do with this simple framework if you know some scripting. eg.: -# - Forward your instant messages to email, SMS gateway, text-to-speach (eg. espeak) or something... -# - Smart auto-replying messages based on regular expressions -# - Remote control your music player (or anything else on your computer) using instant messages -# - Simple IRC/Jabber/ICQ bot (accepts PM only, you can run finch in screen on server) -# - Providing some service (Searching web, Weather info, System status, RPG game...) -# - BackDoor (even unintentional one - you've been warned) -# - Loging and analyzing messages -# - Connect IM with Arduino -# - Annoy everyone with spam (and probably get banned everywhere) -# - Anything else that you can imagine... -# # Maybe you will want to add more hooks for receiving messages, so i've made following script # - It just executes all +x files in answerscripts.d directory so you should do your magic there # - To disable some of those scripts simply use: chmod -x ./script