Pages: [1] 2 :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
Barth3zzzNL
|
Posted - 2004.07.13 22:31:00 -
[1]
Basicly im a n00b at XML. So i picked a bunch of tutorials off the web. The problem is that no matter what i do or which tutorial i try i always get an error on line 19 in the Eve XML file.
The script works fine with small homemade XML files.
Perhaps anyone else is having the same problem or am i doing something wrong: I use the folliwing PHP Code: ------------------------------------------------- <?php $file = "http://myeve.eve-online.com/character/xml2.asp?characterID=1007352023";
function startTag($parser, $data){ echo "<b>"; } function contents($parser, $data){ echo $data; } function endTag($parser, $data){ echo "</b><br />"; }
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startTag", "endTag");
xml_set_character_data_handler($xml_parser, "contents");
$fp = fopen($file, "r");
$data = fread($fp, 80000);
if(!(xml_parse($xml_parser, $data, feof($fp)))){ die("Error on line " . xml_get_current_line_number($xml_parser)); }
xml_parser_free($xml_parser);
fclose($fp);
?> ------------------------------------------------- The PHP File Trying to Parse the Eve file, The PHP File trying to parse my small XML file and my small XML file. ---------------------------
[Coreli Corporation Mainframe] |
Barth3zzzNL
|
Posted - 2004.07.13 22:31:00 -
[2]
Basicly im a n00b at XML. So i picked a bunch of tutorials off the web. The problem is that no matter what i do or which tutorial i try i always get an error on line 19 in the Eve XML file.
The script works fine with small homemade XML files.
Perhaps anyone else is having the same problem or am i doing something wrong: I use the folliwing PHP Code: ------------------------------------------------- <?php $file = "http://myeve.eve-online.com/character/xml2.asp?characterID=1007352023";
function startTag($parser, $data){ echo "<b>"; } function contents($parser, $data){ echo $data; } function endTag($parser, $data){ echo "</b><br />"; }
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startTag", "endTag");
xml_set_character_data_handler($xml_parser, "contents");
$fp = fopen($file, "r");
$data = fread($fp, 80000);
if(!(xml_parse($xml_parser, $data, feof($fp)))){ die("Error on line " . xml_get_current_line_number($xml_parser)); }
xml_parser_free($xml_parser);
fclose($fp);
?> ------------------------------------------------- The PHP File Trying to Parse the Eve file, The PHP File trying to parse my small XML file and my small XML file. ---------------------------
[Coreli Corporation Mainframe] |
Barth3zzzNL
|
Posted - 2004.07.13 22:31:00 -
[3]
Basicly im a n00b at XML. So i picked a bunch of tutorials off the web. The problem is that no matter what i do or which tutorial i try i always get an error on line 19 in the Eve XML file.
The script works fine with small homemade XML files.
Perhaps anyone else is having the same problem or am i doing something wrong: I use the folliwing PHP Code: ------------------------------------------------- <?php $file = "http://myeve.eve-online.com/character/xml2.asp?characterID=1007352023";
function startTag($parser, $data){ echo "<b>"; } function contents($parser, $data){ echo $data; } function endTag($parser, $data){ echo "</b><br />"; }
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startTag", "endTag");
xml_set_character_data_handler($xml_parser, "contents");
$fp = fopen($file, "r");
$data = fread($fp, 80000);
if(!(xml_parse($xml_parser, $data, feof($fp)))){ die("Error on line " . xml_get_current_line_number($xml_parser)); }
xml_parser_free($xml_parser);
fclose($fp);
?> ------------------------------------------------- The PHP File Trying to Parse the Eve file, The PHP File trying to parse my small XML file and my small XML file. ---------------------------
[Coreli Corporation Mainframe] |
LNX Flocki
|
Posted - 2004.07.14 21:43:00 -
[4]
You know you will get an error message from the eve server when you try to fetch the xml file without authentication ? so your script might actually try to parse the 'access denied' page instead of the xml file it was expecting. just a thought, haven't tried it actually.
|
LNX Flocki
|
Posted - 2004.07.14 21:43:00 -
[5]
You know you will get an error message from the eve server when you try to fetch the xml file without authentication ? so your script might actually try to parse the 'access denied' page instead of the xml file it was expecting. just a thought, haven't tried it actually.
|
LNX Flocki
|
Posted - 2004.07.14 21:43:00 -
[6]
You know you will get an error message from the eve server when you try to fetch the xml file without authentication ? so your script might actually try to parse the 'access denied' page instead of the xml file it was expecting. just a thought, haven't tried it actually.
|
Barth3zzzNL
|
Posted - 2004.07.14 23:14:00 -
[7]
hmm that could be possible. :/ ---------------------------
[Coreli Corporation Mainframe] |
Barth3zzzNL
|
Posted - 2004.07.14 23:14:00 -
[8]
hmm that could be possible. :/ ---------------------------
[Coreli Corporation Mainframe] |
Barth3zzzNL
|
Posted - 2004.07.14 23:14:00 -
[9]
hmm that could be possible. :/ ---------------------------
[Coreli Corporation Mainframe] |
Psyanna
|
Posted - 2004.07.17 14:56:00 -
[10]
Edited by: Psyanna on 17/07/2004 15:22:21 Pretty much the only thing you can do unless you have more insight into the https protocol is to manually dump a copy of the xml file to your webserver and parse it there.
I guess the nicer alternative is to write a script that posts your login data to the website, gets the appropriate cookie, then pass this back on the request to the page holding the XML.
I'd say use a PERL script or something that you could run on a CRON/AT job that could go off login and retrieve your XML then copy it back to your webserver for parsing via your php script. Basically automating the manual process.
Would be a lot easier if you could send your username & password in the query string. A bit less secure though and you'd have to trust your webhost a little
|
|
Psyanna
|
Posted - 2004.07.17 14:56:00 -
[11]
Edited by: Psyanna on 17/07/2004 15:22:21 Pretty much the only thing you can do unless you have more insight into the https protocol is to manually dump a copy of the xml file to your webserver and parse it there.
I guess the nicer alternative is to write a script that posts your login data to the website, gets the appropriate cookie, then pass this back on the request to the page holding the XML.
I'd say use a PERL script or something that you could run on a CRON/AT job that could go off login and retrieve your XML then copy it back to your webserver for parsing via your php script. Basically automating the manual process.
Would be a lot easier if you could send your username & password in the query string. A bit less secure though and you'd have to trust your webhost a little
|
Psyanna
|
Posted - 2004.07.17 14:56:00 -
[12]
Edited by: Psyanna on 17/07/2004 15:22:21 Pretty much the only thing you can do unless you have more insight into the https protocol is to manually dump a copy of the xml file to your webserver and parse it there.
I guess the nicer alternative is to write a script that posts your login data to the website, gets the appropriate cookie, then pass this back on the request to the page holding the XML.
I'd say use a PERL script or something that you could run on a CRON/AT job that could go off login and retrieve your XML then copy it back to your webserver for parsing via your php script. Basically automating the manual process.
Would be a lot easier if you could send your username & password in the query string. A bit less secure though and you'd have to trust your webhost a little
|
Asthal
|
Posted - 2004.07.18 02:53:00 -
[13]
With the right extensions, PHP allows for easy access to HTTPS site using fsockopen(), although your server needs to have the extension lib_openssl installed and activated... I successfully recovered the XML data off my characters using my username and password, but I am still wondering about the cacheData part. Is it something useful?
<cacheData> <characterSkills></characterSkills> <characterTraining></characterTraining> <characterAugmentations></characterAugmentations> <characterSkillsInCache></characterSkillsInCache> <characterTrainingInCache></characterTrainingInCache> <characterAugmentationsInCache></characterAugmentationsInCache> </cacheData>
|
Asthal
|
Posted - 2004.07.18 02:53:00 -
[14]
With the right extensions, PHP allows for easy access to HTTPS site using fsockopen(), although your server needs to have the extension lib_openssl installed and activated... I successfully recovered the XML data off my characters using my username and password, but I am still wondering about the cacheData part. Is it something useful?
<cacheData> <characterSkills></characterSkills> <characterTraining></characterTraining> <characterAugmentations></characterAugmentations> <characterSkillsInCache></characterSkillsInCache> <characterTrainingInCache></characterTrainingInCache> <characterAugmentationsInCache></characterAugmentationsInCache> </cacheData>
|
Asthal
|
Posted - 2004.07.18 02:53:00 -
[15]
With the right extensions, PHP allows for easy access to HTTPS site using fsockopen(), although your server needs to have the extension lib_openssl installed and activated... I successfully recovered the XML data off my characters using my username and password, but I am still wondering about the cacheData part. Is it something useful?
<cacheData> <characterSkills></characterSkills> <characterTraining></characterTraining> <characterAugmentations></characterAugmentations> <characterSkillsInCache></characterSkillsInCache> <characterTrainingInCache></characterTrainingInCache> <characterAugmentationsInCache></characterAugmentationsInCache> </cacheData>
|
Psyanna
|
Posted - 2004.07.19 05:57:00 -
[16]
Cool, thanks for the pointer. I'm no php guru :)
|
Psyanna
|
Posted - 2004.07.19 05:57:00 -
[17]
Cool, thanks for the pointer. I'm no php guru :)
|
Psyanna
|
Posted - 2004.07.19 05:57:00 -
[18]
Cool, thanks for the pointer. I'm no php guru :)
|
Psyanna
|
Posted - 2004.07.19 19:13:00 -
[19]
Typical, my version of fsockopen reports back saying it has no support for ssl, even though I have openssl installed.
In the end I retrieved it using lib_curl in php:
$ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL,"https://myeve.eve-online.com/login.asp"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "username=*******&password=********&Check=OK");
ob_start(); // prevent any output curl_exec ($ch); // execute the curl command ob_end_clean(); // stop preventing output
curl_close ($ch); unset($ch);
$ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL,"http://myeve.eve-online.com/character/xml2.asp?characterID=792536083");
$buf2 = curl_exec ($ch);
curl_close ($ch); header("Content-Type: text/xml"); echo $buf2;
This code snippet is taken from the curl homepage http://curl.haxx.se
You might want to change the name of the tmp cookie file in that script in case multiple requests try to write to the same file, but you get the idea. Obviously replace the *****'s with your username/password or use variables/what have you and change your character ID in the url
The XML is left in the $buf2 var and you can parse that as you see fit.
Hope this helps someone at least!
|
Psyanna
|
Posted - 2004.07.19 19:13:00 -
[20]
Typical, my version of fsockopen reports back saying it has no support for ssl, even though I have openssl installed.
In the end I retrieved it using lib_curl in php:
$ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL,"https://myeve.eve-online.com/login.asp"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "username=*******&password=********&Check=OK");
ob_start(); // prevent any output curl_exec ($ch); // execute the curl command ob_end_clean(); // stop preventing output
curl_close ($ch); unset($ch);
$ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL,"http://myeve.eve-online.com/character/xml2.asp?characterID=792536083");
$buf2 = curl_exec ($ch);
curl_close ($ch); header("Content-Type: text/xml"); echo $buf2;
This code snippet is taken from the curl homepage http://curl.haxx.se
You might want to change the name of the tmp cookie file in that script in case multiple requests try to write to the same file, but you get the idea. Obviously replace the *****'s with your username/password or use variables/what have you and change your character ID in the url
The XML is left in the $buf2 var and you can parse that as you see fit.
Hope this helps someone at least!
|
|
Psyanna
|
Posted - 2004.07.19 19:13:00 -
[21]
Typical, my version of fsockopen reports back saying it has no support for ssl, even though I have openssl installed.
In the end I retrieved it using lib_curl in php:
$ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL,"https://myeve.eve-online.com/login.asp"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "username=*******&password=********&Check=OK");
ob_start(); // prevent any output curl_exec ($ch); // execute the curl command ob_end_clean(); // stop preventing output
curl_close ($ch); unset($ch);
$ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL,"http://myeve.eve-online.com/character/xml2.asp?characterID=792536083");
$buf2 = curl_exec ($ch);
curl_close ($ch); header("Content-Type: text/xml"); echo $buf2;
This code snippet is taken from the curl homepage http://curl.haxx.se
You might want to change the name of the tmp cookie file in that script in case multiple requests try to write to the same file, but you get the idea. Obviously replace the *****'s with your username/password or use variables/what have you and change your character ID in the url
The XML is left in the $buf2 var and you can parse that as you see fit.
Hope this helps someone at least!
|
Azriel Spite
|
Posted - 2004.07.28 14:53:00 -
[22]
I'm currently doing some work in the same area, so I'm a bit curious if anyone ever figured out what the <cacheData> section is for. I noticed that the skill part doesn't get updated in any way during training, so perhaps the <characterTrainingInCache> section contains something like how many points have been trained?
|
Azriel Spite
|
Posted - 2004.07.28 14:53:00 -
[23]
I'm currently doing some work in the same area, so I'm a bit curious if anyone ever figured out what the <cacheData> section is for. I noticed that the skill part doesn't get updated in any way during training, so perhaps the <characterTrainingInCache> section contains something like how many points have been trained?
|
Azriel Spite
|
Posted - 2004.07.28 14:53:00 -
[24]
I'm currently doing some work in the same area, so I'm a bit curious if anyone ever figured out what the <cacheData> section is for. I noticed that the skill part doesn't get updated in any way during training, so perhaps the <characterTrainingInCache> section contains something like how many points have been trained?
|
Zorrax Jones
|
Posted - 2004.07.29 15:20:00 -
[25]
I also am trying to do something similar to this. the code that begins with $ch, what kind of file should I put that in? I am completly new to php, but I can write in C# and Java. I just started looking at this 20 mins ago, but any help would be greatly appreciated.
|
Zorrax Jones
|
Posted - 2004.07.29 15:20:00 -
[26]
I also am trying to do something similar to this. the code that begins with $ch, what kind of file should I put that in? I am completly new to php, but I can write in C# and Java. I just started looking at this 20 mins ago, but any help would be greatly appreciated.
|
Zorrax Jones
|
Posted - 2004.07.29 15:20:00 -
[27]
I also am trying to do something similar to this. the code that begins with $ch, what kind of file should I put that in? I am completly new to php, but I can write in C# and Java. I just started looking at this 20 mins ago, but any help would be greatly appreciated.
|
Islay
|
Posted - 2004.08.01 18:32:00 -
[28]
the cacheData tags contain the time until the next cache update/expiration.
when the insider xml feed was overloaded due to the 'succes' of the Character Manager a while back, t20 designed a new xml system that didn't create too much of a load on the server. as a result of this, the actual xml is now updated either once every hour (for the skills and training data) or once every 24 hours (for the implant info).
so the tags are basically info for the receiving application as to when the new data will be available.
regards, Islay ---------------------------- FutureFalcon Enterprises creators of Character Manager/EVE Map tool
|
Islay
|
Posted - 2004.08.01 18:32:00 -
[29]
the cacheData tags contain the time until the next cache update/expiration.
when the insider xml feed was overloaded due to the 'succes' of the Character Manager a while back, t20 designed a new xml system that didn't create too much of a load on the server. as a result of this, the actual xml is now updated either once every hour (for the skills and training data) or once every 24 hours (for the implant info).
so the tags are basically info for the receiving application as to when the new data will be available.
regards, Islay ---------------------------- FutureFalcon Enterprises creators of Character Manager/EVE Map tool
|
Islay
|
Posted - 2004.08.01 18:32:00 -
[30]
the cacheData tags contain the time until the next cache update/expiration.
when the insider xml feed was overloaded due to the 'succes' of the Character Manager a while back, t20 designed a new xml system that didn't create too much of a load on the server. as a result of this, the actual xml is now updated either once every hour (for the skills and training data) or once every 24 hours (for the implant info).
so the tags are basically info for the receiving application as to when the new data will be available.
regards, Islay ---------------------------- FutureFalcon Enterprises creators of Character Manager/EVE Map tool
|
|
|
|
|
Pages: [1] 2 :: one page |
First page | Previous page | Next page | Last page |