
upbloat.sh
By: a guest on Jan 28th, 2012 | syntax:
Bash | size: 0.75 KB | hits: 37 | expires: Never
#!/bin/bash
if [ $# -eq 3 ] ; then
#curl -d user=$1 -d passwd=$2 -c Cookie.txt http://www.reddit.com/api/login
#curl -o $3.txt http://www.reddit.com/user/$3/.json
uh=$(cat $3.txt | sed -e 's/\"modhash\": \"/\n/g' | sed -e 's/\".*//' | sed -e 's/{//' | tr -d '\r' | tr -d '\n')
echo "uh> $uh"
arr=$(cat $3.txt | sed -e 's/\"id\": \"/\n/g' | sed -e 's/\".*//' | sed -e 's/{//')
for x in $arr
do
curl -b Cookie.txt -i -H "Accept: application/json" -X POST -d "id=$x&dir=1&uh=$uh" http://www.reddit.com/api/vote
done
else
echo "Please enter three args"
echo "1. your reddit username"
echo "2. your reddit password"
echo "3. the reddit user we're upbloating"
echo "e.g. ./upbloat.sh yourusername yourpassword reddituser123"
fi