Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @title guestsess
- @echo off
- :: NOTE: now requires ua.txt which contains a user agent string
- if not exist ua.txt (echo Please make a textfile named ua.txt that contains a User Agent string && goto :done)
- set /p useragent=<ua.txt
- :: guestsess.bat
- :: windows xp batch script
- :: fetches a 26-character guest sessionid from younow, saves it as sessionid.txt, loads it into the variable sessionid
- :: which can later be called in a batch file with %sessionid%
- ::
- :: requires wget, grep, sed (all from GnuWin32) all in PATH or same directory as batch file
- :: or temporarily in PATH with something like below if you uncomment it (remove the ::) and paste their install directory after the ; (without quotes)
- ::SET PATH=%PATH%;
- ::
- @wget -U "%useragent%" -T 10 http://www.younow.com/php/api/younow/user -O - | grep -o ".session.:.[a-z0-9]*." | sed -e "s/.session.:.//" -e "s/.$//" > sessionid.txt
- @set /p sessionid=<sessionid.txt
- :done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement