Page 1 of 4

Realm data feeds

Posted: Tue Jan 11, 2005 11:31 pm
by Rollie
Please post all your questions and feedback on the <a href='http://www.warcraftrealms.com/dataexport.php'>Realm Data Export</a> feature in this thread.

Posted: Thu Jan 13, 2005 7:43 pm
by InuTracy
It's freaking hard to use! Is there a tutoriol to help? There is no clear way to use this, at all and I really want to display it on my web site for my guild.

Easy

Posted: Sat Feb 05, 2005 9:03 am
by Khael
I found it extremely easy to use ;)

I mean it doesnt get much easier when you are given a comma separated csv file, updated every hour.

This shit rocks, thank you Rollie & Co.

Posted: Wed Feb 09, 2005 5:13 pm
by Tarasque
This feature seems interesting. I was looking something similar, like having the realm status (online/offline) that could be viewed from my site, something like a few fansites have.

Anyways, it would be interesting to use the data, but a guide or tutorial would rock ;) I'm more into design than programming :roll:

Posted: Wed Feb 09, 2005 6:40 pm
by Rollie
The realm data feeds I provide give basic realm statistical information, not if the realm is currently up or not.

The realm data can be retrieved in the same manner as posted in the guild export thread. You would just need to point the save file at the realm data files instead of the guild files.

Posted: Fri Feb 11, 2005 11:45 am
by Kitaka
the guild data is well, but is there any way to show the sex?
i plan a little img for all Chars :wink: and for that i need the gender

Posted: Fri Feb 11, 2005 1:04 pm
by Rollie
Unfortunately there is no way to determine gender (as far as I know).

Broken ?

Posted: Thu Mar 03, 2005 3:55 am
by Keronos
This seems to be broken at the moment ?

I get zero byte files from the links :(

Posted: Thu Mar 03, 2005 9:07 am
by Rollie
ah yeah, I need to do a little work since the move to get it back 100%. Gimme a day or so =)

Posted: Thu Mar 03, 2005 11:53 am
by Keronos
possible to put a sample file up for the meanwhile ?

Posted: Mon Mar 07, 2005 1:29 pm
by thisKman
I have read the terms of use, but Guild data processing is still unclear. Can I use the the link like a file? Is it allowed to use it like this (in PHP):
$data_array = file("http://www.warcraftrealms.com/exports/g ... comes_here"); ?

Posted: Mon Mar 07, 2005 1:37 pm
by Rollie
You need to download the file periodically instead of pulling it each time the page is accessed.

Posted: Mon Mar 07, 2005 2:16 pm
by thisKman
The method is that I download that file once a day, and use my stored one. Is it ok then?

Posted: Mon Mar 07, 2005 2:35 pm
by Rollie
Yup, that'd be great =)

Posted: Mon Mar 07, 2005 3:02 pm
by thisKman
Ok. Thx! I will post again if the code is done.

Posted: Tue Mar 08, 2005 1:56 am
by Keronos
It's still broken though ?

Posted: Tue Mar 08, 2005 9:42 am
by Rollie
Shouldn't be! I fixed it a few days ago!

Posted: Tue Mar 08, 2005 10:53 am
by thisKman
Finally the code is done, so my Guild data processor is working! As agreed it gets the data once a day from warcraftrealms.com, it makes a copy of it then uses the stored one till the next refresh time comes (after 24 hours). Here it is (without the HTML code):

Code: Select all


$now = time&#40;&#41;;

//Setting up the variables
$date_file_name = "some_datefile_name.temp";
$date_file = file&#40;"$date_file_name"&#41;;

$next_day = $date_file&#91;0&#93; + 24*3600;

$link = "http&#58;//www.warcraftrealms.com/exports/guildexport.php?guildid=guild_id";
$filename = "some_file_name.dat";
$title = "Guild_name";

if&#40;$now > $next_day&#41;
&#123;
                $file = $filename;
                $d_file = file&#40;"$link"&#41;;

	$open_file = fopen&#40;$file, "w"&#41;;

	for&#40;$i = 0;$i < count&#40;$d_file&#41;;$i++&#41;
	&#123;
		fwrite&#40;$open_file, "$d_file&#91;$i&#93;"&#41;;
	&#125;

	fclose&#40;$open_file&#41;;


	//Updating the stored date
	$open_file = fopen&#40;"$date_file_name", "w"&#41;;
	fwrite&#40;$open_file, "$now"&#41;;
	fclose&#40;$open_file&#41;;
&#125;else&#123;
               $d_file = file&#40;"$filename"&#41;;
&#125;

...Some html code...

//Printing out the member data
for&#40;$i = 1;$i < count&#40;$d_file&#41;;$i++&#41;
&#123;
	$line = explode&#40;",", $d_file&#91;$i&#93;&#41;;

	list&#40;$month, $day, $year&#41; = explode&#40;"/", $line&#91;4&#93;&#41;;

	echo "the data in the format you like &#40;$line&#91;0..5&#93;&#41;";
&#125;

//The first line contains no member data
$member_count = count&#40;$d_file&#41; - 1;

echo "member count with the format you like";

...Some html code...
That's it. Not too much but it works : ))

Posted: Wed Mar 09, 2005 4:28 am
by Keronos
Rollie wrote:Shouldn't be! I fixed it a few days ago!
But isn't... All of the links for SERVER feeds I tried give zero byte files.

Posted: Wed Mar 09, 2005 4:34 am
by Keronos
To test this, try this:

Code: Select all

gzopen&#40;'http&#58;//www.warcraftrealms.com/exports/download.php?fname=EU-Emerald%20Dream.csv.gz','r'&#41;
I have no trouble opening the guild files, but server files are down