This is highly unofficial, but if you want to upload your World of Warcraft statistics to WoWHead in Linux, then you might be able to do so by using the following script. You will need curl and wget installed.
#!/bin/sh
#Path to WoW
WOW="/home/user/games/World of Warcraft"
#User name on WoWHead
USER="guest"
#MD5sum of your WoWHead password
PASS="badbeef666badbeef666badbeef666ba"
#You MAC address (without separators, lower case)
MAC="010203040a0b"
#WoW account name
ACC="wowman"
#WoW Locale
LOCALE="enUS"
# Ignoring the update info for now, just downloading it all
wget -q http://client.wowhead.com/files/updates.xml -O /dev/null
rm -rf "$WOW/Interface/Addons/+Wowhead_Looter"
mkdir -p "$WOW/Interface/Addons/+Wowhead_Looter"
wget -q http://client.wowhead.com/files/Wowhead_Looter.lua -O "$WOW/Interface/Addons/+Wowhead_Looter/Wowhead_Looter.lua"
wget -q http://client.wowhead.com/files/+Wowhead_Looter.toc -O "$WOW/Interface/Addons/+Wowhead_Looter/+Wowhead_Looter.toc"
wget -q http://client.wowhead.com/files/Wowhead_Looter.xml -O "$WOW/Interface/Addons/+Wowhead_Looter/Wowhead_Looter.xml"
wget -q http://client.wowhead.com/files/Localization.lua -O "$WOW/Interface/Addons/+Wowhead_Looter/Localization.lua"
# Ignoring authentification errors. This should return "0" on a sucessful login.
wget -nv "http://client.wowhead.com/auth.php?username=$USER&password=$PASS&macAddress=$MAC" -O /dev/null
# Uploading all data
TMPDIR=`mktemp -d`
cd $TMPDIR
cp "$WOW/wtf/Account/$ACC/SavedVariables/+Wowhead_Looter.lua" .
cp "$WOW/Cache/wdb/$LOCALE/creaturecache.wdb" .
cp "$WOW/Cache/wdb/$LOCALE/gameobjectcache.wdb" .
cp "$WOW/Cache/wdb/$LOCALE/itemcache.wdb" .
cp "$WOW/Cache/wdb/$LOCALE/pagetextcache.wdb" .
cp "$WOW/Cache/wdb/$LOCALE/questcache.wdb" .
gzip *
curl -F "file0=@+Wowhead_Looter.lua.gz" -F "file1=@creaturecache.wdb.gz" -F "file2=@gameobjectcache.wdb.gz" -F "file3=@itemcache.wdb.gz" -F "file4=@pagetextcache.wdb.gz" -F "file5=@questcache.wdb.gz" "http://client.wowhead.com/upload.php?username=$USER&password=$PASS&macAddress=$MAC"
cd
rm -rf $TMDIR
To get MD5sum of your password use this:
echo -n "password" | md5sum
Comments
Charles 12 years, 7 months ago
This script works rather well.
Link | ReplyBeware case sensitivity! My WTF and WDB folders were capitalized. Same goes for my login name.
Jeremy 12 years, 3 months ago
Would be nice to get some feedback... maybe parse the wdb files? Or at least say how much of it was new?
Link | Reply(For reference, my WDB and WTF folders were also capitalised.)
Thanks for the script!
Earl 11 years, 12 months ago
Does this still work? When running it, the wget that checks authentication returns a 1 instead of a 0. How do we know this if is being uploaded correctly?
Link | Replyaigarius 11 years, 12 months ago
When you go to your profile, check the "Data uploads:" number before and after running the script. It still looks to be working for me.
Link | ReplyEarl 11 years, 12 months ago
Thanks... looks like it is working.
Link | ReplyBob 11 years, 10 months ago
Great work :D I made a cronjob of parts of it :). By the way, the last cd should be followed by .. else it only works in your homedir
Link | ReplyCheers
Bob 11 years, 10 months ago
never mind about the cd, I red wrong
Link | Replyaigarius 11 years, 10 months ago
Yes, that 'cd' is only needed to exit the TMPDIR which is referenced by absolute path. It is good to see someone check my code (and even more fun to see it still being used to do good). :)
Link | ReplyNew Comment