Skip to content

Instantly share code, notes, and snippets.

@sim51
Created April 4, 2012 21:40
Show Gist options
  • Save sim51/2305903 to your computer and use it in GitHub Desktop.
Save sim51/2305903 to your computer and use it in GitHub Desktop.
Comment inverser une chaine de caractère ... avec twitter
#!/bin/bash
STWEET_USER=logisimatest
STWEET_PASS=
while [[ "$phrase" == "" ]]
do
echo
echo "Tapez une phrase :"
read word
done
for (word in $phrase){
size=${#word}
while [ -n "$word" ]
do
DATE=`date +%Y%m%d%H%M%s`
letter=$(printf "%c" "$word")
word=${word#?}
resp=1
while [[ ${#resp} != 0 ]]
do
echo "tweet letter $letter"
curl --silent -u $STWEET_USER:$STWEET_PASS --data-binary "status=$letter@$DATE#" http://api.supertweet.net/1/statuses/update.xml > temp
resp=$(grep '<error>' temp | sed 's/.*<error>\([-a-zA-Z0-9 ._@#]\+\)<\/error>.*/\1/g')
echo $resp
sleep 1
done
done
sleep 4
curl --silent -u $STWEET_USER:$STWEET_PASS http://api.supertweet.net/1/statuses/user_timeline.xml?count=${size} > temp
echo "reverse word is"
echo `grep '<text>' temp` | sed 's/<text>\([-a-zA-Z0-9 ._@#]\+\)\?@[0-9]\+#<\/text>[[:space:]]\?/\1/g'
}
@sim51
Copy link
Author

sim51 commented Apr 6, 2012

Je suis pas réveillé ce matin ... je me demande pourquoi :D

@chanmix51
Copy link

You mean the password is here :p

@sim51
Copy link
Author

sim51 commented Apr 6, 2012

oui celui-là ^^
Pas grave...
Il a été généré pour le compte "supertwitter" qui permet uniquement de tweeter sur mon compte twitter de test ... c'est pas critique ^^

@frinux
Copy link

frinux commented Apr 6, 2012

Oh ben tient je le connais ce mot de passe :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment