Wednesday, February 17, 2010

Shasteriskt

I don't know what to say... I might have inadvertently written a mildly annoying spam bot for Twitter and/or Identica and other stuff of that nature.

Example:
./shasteriskt 'myusername:mysecretpassword' 2 'Bored!' 'Annoyed!'

will post two messages to each of the services (defined in the script, Twitter and Identica by default.

The only use for this I can think of is bumping up your Cursebird stats.

Also, your login and password are not necessarily safe when using this script.

Code:
 
1 #!/bin/bash
2 #
3 # Shasteriskt
4 #
5 # A quick and dirty way to generate a ton of spam to
6 # microblogging serivces. This is a script of low-grade
7 # evil.
8 #
9 # Parameters:
10 # USERNAME:PASSWORD - credentials to services
11 # NUMBER - number of repeats
12 # WORDS - a list of words to post
13
14 # Depends:
15 # curl
16 #
17 # Author:
18 # Konrad Siek <konrad.siek@gmail.com>
19 #
20 # License information:
21 #
22 # This program is free software: you can redistribute it and/or modify
23 # it under the terms of the GNU General Public License as published by
24 # the Free Software Foundation, either version 3 of the License, or
25 # (at your option) any later version.
26 #
27 # This program is distributed in the hope that it will be useful,
28 # but WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 # GNU General Public License for more details.
31 #
32 # You should have received a copy of the GNU General Public License
33 # along with this program. If not, see <http://www.gnu.org/licenses/>.
34 #
35 # Copyright 2010 Konrad Siek
36
37 URLs=( \
38 'http://twitter.com/statuses/update.json' \
39 'http://identi.ca/api/statuses/update.json' \
40 )
41
42 if [ "$#" -lt 4 ]
43 then
44 echo "Usage: $0 USER:PASSWORD NUMBER WORD [ WORD [...] ]"
45 exit 1
46 fi
47
48 credentials=$1; shift
49 total=$1; shift
50
51 words=( )
52 counter=0
53 while [ -n "$1" ]
54 do
55 words[$counter]="$1"
56 counter=$(($counter+1))
57 shifto
58 done
59
60 for i in $(seq 1 $total)
61 do
62 for w in "${words[@]}"
63 do
64 for url in "${URLs[@]}"
65 do
66 curl --basic \
67 --user "$credentials" \
68 --data status="$w" "$url"
69 done
70 done
71 done


The code is also available at GitHub as bash/shasteriskt.

No comments: