Commit | Line | Data |
---|---|---|
ea0fdc06 H |
1 | #!/bin/sh |
2 | ||
3 | # This file is called for every message received by libpurple clients (pidgin,finch,...) | |
4 | # Env variables PURPLE_MSG and PURPLE_FROM are passed to this script | |
5 | # Which means you should mind security (don't let attackers to execute their messages) | |
6 | # Each line of output is sent as reply to that message | |
7 | # You can try to rewrite this script in PERL or C for better performance | |
8 | # This script have .exe suffix as i hope it can be eventualy replaced by some binary on windows | |
9 | ||
10 | # Basic example can look like this: | |
11 | # echo "<$PURPLE_FROM> $PURPLE_MSG"; | |
12 | ||
13 | # There are lot of hacks that you can do with this simple framework if you know some scripting. eg.: | |
14 | # Forward your instant messages to email, SMS gateway, text-to-speach (eg. espeak) or something... | |
15 | # Smart auto-replying messages based on regular expressions | |
16 | # Remote control your music player (or anything else on your computer) using instant messages | |
17 | # Simple IRC/Jabber/ICQ bot (accepts PM only) | |
18 | # Providing some service (Searching web, Weather info, System status, RPG game...) | |
19 | # BackDoor (even unintentional one - you've been warned) | |
20 | # Loging and analyzing messages | |
21 | # Connect IM with Arduino | |
22 | # Annoy everyone with spam (and probably get banned everywhere) | |
23 | # Anything else that you can imagine... | |
24 | ||
25 | # Maybe you will want to add more hooks for receiving messages, so i've made following script | |
26 | # It just executes all +x files in answerscripts.d directory so you should do your magic there | |
27 | # To disable some of those scripts just use chmod -x script | |
28 | ||
29 | dir="$(dirname "$0")"/answerscripts.d | |
30 | if test -d "$dir"; then | |
31 | for script in "$dir"/*; do | |
32 | test -x "$script" && "$script" | |
33 | done | |
34 | fi | |
35 |