CharacterProfiler Roster Upload Script (+LINUX / Mac OS X)

Miscellaneous code snippets and examples that members have posted

CharacterProfiler Roster Upload Script (+LINUX / Mac OS X)

Postby netmonkey » Fri Sep 28, 2007 6:47 am

This thread seeks to provide a means for automating the update of WoW Guild Roster information via CharacterProfiler data for cross-platform users (Windows, Mac OS X or other LINUX/UNIX flavors).

I've looked at a couple different options out there and hadn't found a whole lot. I really like the direction UniUploader was going in, but it's still a client application with more features than what I was looking for.

Overall their Windows implementation is great, but caches your WoW information which makes a few people reluctant to use it (apparently this is to automatically launch WoW for you). The Java interface is cumbersome, doesn't work consistently and requires a version of Java not yet available to Mac OS X.

I then discovered a posting by ScratchMonkey, illustrating the use of cURL to post information to the "update.php" URL on the guild server:

http://www.wowroster.net/Forums/viewtop ... html#16139

For now, anyone looking to do this on Mac OS X can use the following, provided they have CURL already installed (included with Mac OS X).

CURL can be found at: http://curl.haxx.se/

Simply copy the contents into a file named "cp-update.sh" (be sure to use chmod +x cp-update.sh):

Code: Select all

#!/bin/sh

WOW_ACCOUNT=YourWowAccountName
WOW_ROOT="/Applications/World of Warcraft"

UPDATE_URL=http://guild.site.org/roster/update.php

UPDATE_FILE=/tmp/CharacterProfiler.lua.gz
UPDATE_OUTPUT=/tmp/cp-update.html

echo
echo -=[ `date`

echo
echo -=[ Compressing character information...
if [ -f ${UPDATE_FILE} ] ; then
  rm -rf ${UPDATE_FILE}
fi
gzip --stdout "${WOW_ROOT}/WTF/Account/${WOW_ACCOUNT}/SavedVariables/CharacterProfiler.lua" > ${UPDATE_FILE}
if [ -f ${UPDATE_FILE} ] ; then
  echo
  echo "  done."
else
  echo "  ERROR: Unable to create update package (${UPDATE_FILE}), please try again."
  exit
fi

echo
echo -=[ Uploading character information to ${UPDATE_URL}...
echo
curl -F CharacterProfiler=@${UPDATE_FILE} -F submit=Upload ${UPDATE_URL} -o ${UPDATE_OUTPUT}
if [ -f ${UPDATE_OUTPUT} ] ; then
  echo
  echo "  response received from server."
else 
  echo
  echo "  ERROR: Output file not created (${UPDATE_OUTPUT}), please try again."
  exit
fi

echo
echo -=[ Results...
echo
grep "Updating Character" ${UPDATE_OUTPUT} |grep "<strong>" | sed -e "s/<[^>]*>//g" | sed -e "s/^Updating/  Updated/g"
echo



This will produce the following output (which can be piped to a logfile):

Code: Select all

$ ./cp-update.sh

-=[ Thu Sep 27 18:35:49 EDT 2007

-=[ Compressing character information...

  done.

-=[ Uploading character information to http://guild.site.org/roster/update.php...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  112k    0 13623  100   98k   3571  26500  0:00:03  0:00:03 --:--:-- 28207

  response received from server.

-=[ Results...

  Updated Character [Spike]
  Updated Character [Faye]
  Updated Character [Jet]
  Updated Character [Edward]



From here I hope to write a small app for basic functionality which will do the following:

- Run entirely in the background with minimal system resources
- Invoke update after recognizing WoW has exited
- Monitor for changes to the CharacterProfile.lua (timestamp or hash)
- Allow multiple accounts to be configured (or automatically scan)
- Attempt to be cross-platform
- XML debug option to allow user to copy and paste into an HTML form for problem resolution

This is partially implemented in both a shell-script and Perl for a prototype, while testing options for either single Java or multiple .NET / Cocoa / cron implementations.

Any ideas or suggestions would be appreciated.
Last edited by netmonkey on Fri Sep 28, 2007 7:21 am, edited 1 time in total.
netmonkey
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Fri Sep 28, 2007 5:22 am

CharacterProfiler Roster Upload Script (+LINUX / Mac OS X)

Postby ScratchMonkey » Wed Oct 10, 2007 2:58 am

If you do want to create it in C++, you might look at the wxWindows or QT frameworks. I've been using wx under Win32 and it's pretty nice to work with. Check out wxFormBuilder, a really nice dialog designer that takes advantage of the wx sizer framework.

I'd also suggest building it as a front-end and back-end, with the back-end a tiny headless program running in the background, and a GUI front-end that's used to configure it. (They need not be written in the same language.)
User avatar
ScratchMonkey
WR.net Expert
WR.net Expert
 
Posts: 212
Joined: Wed Jul 05, 2006 4:32 pm
Location: San Pablo, CA

CharacterProfiler Roster Upload Script (+LINUX / Mac OS X)

Postby bryanc » Wed Dec 05, 2007 8:28 am

With the version of WoWRoster I have, I had add an argument to the curl command line
Code: Select all
curl -F process=process  <same stuff>
and change the url:
Code: Select all
UPDATE_URL=http://guild.site.org/roster/index.php?p=update


Works great! Thanks.
Last edited by bryanc on Wed Dec 05, 2007 8:28 am, edited 1 time in total.
bryanc
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Tue Dec 04, 2007 9:57 am

CharacterProfiler Roster Upload Script (+LINUX / Mac OS X)

Postby Sansalas » Fri Dec 28, 2007 12:57 am

Code: Select all
hm don't seem to work for me

power-mac-g5:Desktop user$ ./cp-update.sh

-=[ Do 27 Dez 2007 16:37:01 CET

-=[ Compressing character information...

  done.

-=[ Uploading character information to http://scanningsdone.de/wow/index.php?p=update...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 66021    0 21016  100 45005  17321  37093  0:00:01  0:00:01 --:--:-- 38172

  response received from server.

-=[ Results...


power-mac-g5:Desktop user$


Then I have reloaded the page (empty cache also). but no info about an update :/
User avatar
Sansalas
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Thu Dec 27, 2007 3:34 am

CharacterProfiler Roster Upload Script (+LINUX / Mac OS X)

Postby Sansalas » Fri Dec 28, 2007 12:57 am

hm I guess I know the reason for it.... no password is given!

how do I implement it in the code, plz?
User avatar
Sansalas
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Thu Dec 27, 2007 3:34 am

CharacterProfiler Roster Upload Script (+LINUX / Mac OS X)

Postby ScratchMonkey » Fri Dec 28, 2007 9:49 am

My original thread illustrates use of a password. But you only need that if you're updating the guild list. It's not needed to update your own data.
User avatar
ScratchMonkey
WR.net Expert
WR.net Expert
 
Posts: 212
Joined: Wed Jul 05, 2006 4:32 pm
Location: San Pablo, CA

Re: CharacterProfiler Roster Upload Script (+LINUX / Mac OS

Postby starfish » Thu Feb 14, 2008 5:06 pm

Hello

I'm very happy, thanks mr ScratchMonkey :D

Everytime I quit WoW, this script auto uploads, my Character Profiler, the Guild roster changes and also the PvP log to the webserver.

I have manged to put a Automator Workflow together combined with a Action folder and instructions.

I would like a few beta testers before we roll this out. Any Mac OS X 10.4 peeps want get in touch with me.

PM your email address and I'll send you a copy.


Cheers


Starfish
starfish
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Wed Sep 26, 2007 7:04 pm


Return to Code Cache

Who is online

Users browsing this forum: No registered users and 0 guests

cron