Pages: 1 2 :: [one page] |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
![Barth3zzzNL Barth3zzzNL](/images/people/img9.png)
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 Barth3zzzNL](/images/people/img1.png)
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 Barth3zzzNL](/images/people/img13.png)
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 LNX Flocki](/images/people/img3.png)
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 LNX Flocki](/images/people/img16.png)
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 LNX Flocki](/images/people/img14.png)
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 Barth3zzzNL](/images/people/img2.png)
Barth3zzzNL
|
Posted - 2004.07.14 23:14:00 -
[7]
hmm that could be possible. :/ ---------------------------
[Coreli Corporation Mainframe] |
![Barth3zzzNL Barth3zzzNL](/images/people/img5.png)
Barth3zzzNL
|
Posted - 2004.07.14 23:14:00 -
[8]
hmm that could be possible. :/ ---------------------------
[Coreli Corporation Mainframe] |
![Barth3zzzNL Barth3zzzNL](/images/people/img16.png)
Barth3zzzNL
|
Posted - 2004.07.14 23:14:00 -
[9]
hmm that could be possible. :/ ---------------------------
[Coreli Corporation Mainframe] |
![Psyanna Psyanna](/images/people/img16.png)
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 ![Very Happy](/images/icon_biggrin.gif)
|
|
![Psyanna Psyanna](/images/people/img12.png)
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 ![Very Happy](/images/icon_biggrin.gif)
|
![Psyanna Psyanna](/images/people/img8.png)
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 ![Very Happy](/images/icon_biggrin.gif)
|
![Asthal Asthal](/images/people/img16.png)
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 Asthal](/images/people/img7.png)
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 Asthal](/images/people/img7.png)
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 Psyanna](/images/people/img12.png)
Psyanna
|
Posted - 2004.07.19 05:57:00 -
[16]
Cool, thanks for the pointer. I'm no php guru :)
|
![Psyanna Psyanna](/images/people/img6.png)
Psyanna
|
Posted - 2004.07.19 05:57:00 -
[17]
Cool, thanks for the pointer. I'm no php guru :)
|
![Psyanna Psyanna](/images/people/img11.png)
Psyanna
|
Posted - 2004.07.19 05:57:00 -
[18]
Cool, thanks for the pointer. I'm no php guru :)
|
![Psyanna Psyanna](/images/people/img7.png)
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 Psyanna](/images/people/img8.png)
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 Psyanna](/images/people/img16.png)
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 Azriel Spite](/images/people/img12.png)
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 Azriel Spite](/images/people/img12.png)
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 Azriel Spite](/images/people/img10.png)
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 Zorrax Jones](/images/people/img15.png)
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 Zorrax Jones](/images/people/img15.png)
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 Zorrax Jones](/images/people/img6.png)
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 Islay](/images/people/img12.png)
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 Islay](/images/people/img4.png)
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 Islay](/images/people/img6.png)
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
|
|
![Psyanna Psyanna](/images/people/img4.png)
Psyanna
|
Posted - 2004.08.01 19:16:00 -
[31]
Originally by: Zorrax Jones 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.
That is basically a php snippet. You can pretty much use that code in a vanilla php file and output your xml straight to the screen. You do need to have openssl libs installed along with lib_curl.
If you're a C# developer have a look at System.Net.HttpWebRequest This has support for SSL enabled pages.
All you have to do is make your initial request to the urls in the code above, store the initial responses cookies, then simply add these to the System.Net.CookieContainer object on the next request ( for the actual xml page ).
If you don't have any joy then I'll see if I can knock you an example up. ( if I have some spare time! )
HTH
|
![Psyanna Psyanna](/images/people/img8.png)
Psyanna
|
Posted - 2004.08.01 19:16:00 -
[32]
Originally by: Zorrax Jones 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.
That is basically a php snippet. You can pretty much use that code in a vanilla php file and output your xml straight to the screen. You do need to have openssl libs installed along with lib_curl.
If you're a C# developer have a look at System.Net.HttpWebRequest This has support for SSL enabled pages.
All you have to do is make your initial request to the urls in the code above, store the initial responses cookies, then simply add these to the System.Net.CookieContainer object on the next request ( for the actual xml page ).
If you don't have any joy then I'll see if I can knock you an example up. ( if I have some spare time! )
HTH
|
![Psyanna Psyanna](/images/people/img9.png)
Psyanna
|
Posted - 2004.08.01 19:16:00 -
[33]
Originally by: Zorrax Jones 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.
That is basically a php snippet. You can pretty much use that code in a vanilla php file and output your xml straight to the screen. You do need to have openssl libs installed along with lib_curl.
If you're a C# developer have a look at System.Net.HttpWebRequest This has support for SSL enabled pages.
All you have to do is make your initial request to the urls in the code above, store the initial responses cookies, then simply add these to the System.Net.CookieContainer object on the next request ( for the actual xml page ).
If you don't have any joy then I'll see if I can knock you an example up. ( if I have some spare time! )
HTH
|
![Psyanna Psyanna](/images/people/img14.png)
Psyanna
|
Posted - 2004.08.03 16:57:00 -
[34]
Edited by: Psyanna on 03/08/2004 17:01:43 Well, while tinkering with it in .NET I discovered that all you need is the session Id and you can pass that back in the query string when you make the request to the xml page.
Therefore you don't actually have to worry about using cookies at all!
Here some sample code with C#
-------- See code in url below, sorry but it screwed up the forum formatting -------
For the sake of example I dumped it to a datagrid. To prove it works I uploaded it to my dotnet space:
http://aspnetgirl.europe.webmatrixhosting.net/GetXml.aspx
Should get you started anyway :)
|
![Psyanna Psyanna](/images/people/img4.png)
Psyanna
|
Posted - 2004.08.03 16:57:00 -
[35]
Edited by: Psyanna on 03/08/2004 17:01:43 Well, while tinkering with it in .NET I discovered that all you need is the session Id and you can pass that back in the query string when you make the request to the xml page.
Therefore you don't actually have to worry about using cookies at all!
Here some sample code with C#
-------- See code in url below, sorry but it screwed up the forum formatting -------
For the sake of example I dumped it to a datagrid. To prove it works I uploaded it to my dotnet space:
http://aspnetgirl.europe.webmatrixhosting.net/GetXml.aspx
Should get you started anyway :)
|
![Psyanna Psyanna](/images/people/img5.png)
Psyanna
|
Posted - 2004.08.03 16:57:00 -
[36]
Edited by: Psyanna on 03/08/2004 17:01:43 Well, while tinkering with it in .NET I discovered that all you need is the session Id and you can pass that back in the query string when you make the request to the xml page.
Therefore you don't actually have to worry about using cookies at all!
Here some sample code with C#
-------- See code in url below, sorry but it screwed up the forum formatting -------
For the sake of example I dumped it to a datagrid. To prove it works I uploaded it to my dotnet space:
http://aspnetgirl.europe.webmatrixhosting.net/GetXml.aspx
Should get you started anyway :)
|
![Inanna Sumer Inanna Sumer](/images/people/img8.png)
Inanna Sumer
|
Posted - 2004.08.06 19:50:00 -
[37]
if you just pull xml2.asp it'll provide the info for your 'default' character, then you can use the resulting XML to pull data on other characters...
http://www.starshadow.com/~ragnar/fetch_eve.phps
doesn't do anything with the other characters, uses PHP with PEAR's HTTP_Client to fetch the data.
|
![Inanna Sumer Inanna Sumer](/images/people/img11.png)
Inanna Sumer
|
Posted - 2004.08.06 19:50:00 -
[38]
if you just pull xml2.asp it'll provide the info for your 'default' character, then you can use the resulting XML to pull data on other characters...
http://www.starshadow.com/~ragnar/fetch_eve.phps
doesn't do anything with the other characters, uses PHP with PEAR's HTTP_Client to fetch the data.
|
![Inanna Sumer Inanna Sumer](/images/people/img9.png)
Inanna Sumer
|
Posted - 2004.08.06 19:50:00 -
[39]
if you just pull xml2.asp it'll provide the info for your 'default' character, then you can use the resulting XML to pull data on other characters...
http://www.starshadow.com/~ragnar/fetch_eve.phps
doesn't do anything with the other characters, uses PHP with PEAR's HTTP_Client to fetch the data.
|
![Barth3zzzNL Barth3zzzNL](/images/people/img2.png)
Barth3zzzNL
|
Posted - 2004.08.06 23:32:00 -
[40]
Ah sweet, lotsa replies. Ill screw around with this some more in the morning. See if i can turn this into a siggy that shows off my l33t sk33ls and Char info ![Smile](/images/icon_smile.gif) ---------------------------
[Coreli Corporation Mainframe] |
|
![Barth3zzzNL Barth3zzzNL](/images/people/img7.png)
Barth3zzzNL
|
Posted - 2004.08.06 23:32:00 -
[41]
Ah sweet, lotsa replies. Ill screw around with this some more in the morning. See if i can turn this into a siggy that shows off my l33t sk33ls and Char info ![Smile](/images/icon_smile.gif) ---------------------------
[Coreli Corporation Mainframe] |
![Barth3zzzNL Barth3zzzNL](/images/people/img13.png)
Barth3zzzNL
|
Posted - 2004.08.06 23:32:00 -
[42]
Ah sweet, lotsa replies. Ill screw around with this some more in the morning. See if i can turn this into a siggy that shows off my l33t sk33ls and Char info ![Smile](/images/icon_smile.gif) ---------------------------
[Coreli Corporation Mainframe] |
![Lord Alderaan Lord Alderaan](/images/people/img3.png)
Lord Alderaan
|
Posted - 2005.12.22 13:27:00 -
[43]
The curl script doesn't seem to work anymore.
I'm not getting a cookiejar file and the second url opens a object move page with an url back to the login page.
I think the login page is update somehow because a simple html form doesn't allow me to login with just the username, password and Check POSTed.
----------------------------- <form method=post action=https://myeve.eve-online.com/login.asp> <input name=Check value=Ok> <input name=username> <input name=password> <input type=submit> </form> -----------------------------
Might it be a correct referer is required? Is it because of a server change in the SSL?
Anybody any idea or a working php script?
|
![Gorgosti Gorgosti](/images/people/img9.png)
Gorgosti
|
Posted - 2005.12.28 17:53:00 -
[44]
is there actually now a real script that can be implemented on your own webpage that shows you your skills? cause this is all confusing me a bit... sorry if i sound disturbing, just curious
|
![Ralitge boyter Ralitge boyter](/images/people/img7.png)
Ralitge boyter
|
Posted - 2005.12.29 15:07:00 -
[45]
I have done it in perl but it should work in all languages, login, use the cookie to get the special cookie from the news servers and use that cookie to download the XML.
It is a 3 step process but it works and should keep on working even when CCP makes changes to the system, where as the other quicker way migth get borked once CCP makes changes.
------------------------------------------- Should you disagree with me, well I guess that is because I disagree with you. If you have a problem with that please feel free not to tell me. |
![Selvin Selvin](/images/people/img4.png)
Selvin
|
Posted - 2005.12.29 18:57:00 -
[46]
it works in .NET ![Cool](/images/icon_cool.gif)
System.Net.HttpWebRequest hreq = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create("https://myeve.eve-online.com/login.asp?username=USER&password=PASS&Check=OK"); System.Net.HttpWebResponse wres = (System.Net.HttpWebResponse)hreq.GetResponse(); System.IO.StreamReader sr = new System.IO.StreamReader( wres.GetResponseStream()); string resp = sr.ReadToEnd(); System.Text.RegularExpressions.Regex rx = new System.Text.RegularExpressions.Regex("\\?sid=(\\d+)"); string sid = rx.Matches(resp)[0].Groups[1].Value; hreq = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create("http://myeve.eve-online.com/character/xml.asp?characterid=CHARID&sid="+sid); wres = (System.Net.HttpWebResponse)hreq.GetResponse(); sr = new System.IO.StreamReader( wres.GetResponseStream()); string xml = sr.ReadToEnd(); //we got whole xml in ziz string
|
![Lord Alderaan Lord Alderaan](/images/people/img13.png)
Lord Alderaan
|
Posted - 2006.01.03 14:45:00 -
[47]
/me slaps himself!!!!
OMG... I got through the login... solution: Use GET instead of POST.
The problem was that the POST kept redirecting me without loging me in. And curl doesn't excecute redirection. It leaves that to the browser.
Thanks for the help guys. Especially Selvin for the idea of trying get instead of post.
Greetz, Lord Alderaan
---start of code---
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "c:/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL,"https://myeve.eve-online.com/login.asp?username=USER&password=PASSWORD&Check=OK"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
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, "c:/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL,"http://myeve.eve-online.com/character/xml.asp?characterID=123456789");
$buf2 = curl_exec ($ch);
curl_close ($ch); header("Content-Type: text/xml"); echo $buf2; ?>
---end of code---
notes: Using php on apache with curl enabled. Make sure the folder for the cookie exists (in this case c:/tmp/) Replace the USER and PASSWORD in the upper string with ur login credentials and the 123456789 with your character ID.
|
![Elai Elai](/images/people/img16.png)
Elai
|
Posted - 2006.04.20 23:50:00 -
[48]
Thanks a lot for the information in this thread. It was really helpful when I wrote a little perlscript to get my characters xml-file.
For those that are interested, here is one way to get the xmlfile using perl. It uses the same method as Lord Alderaans phpcode above, perhaps someone here will find it useful. ![Smile](/images/icon_smile.gif)
--------------------------------------------------- #!/usr/bin/perl -w use strict; require LWP::UserAgent; require HTTP::Cookies;
my ($username, $password, $charid) = ("your_username", "your_password", "1234567890");
my $ua = LWP::UserAgent->new; $ua->cookie_jar({});
my $req = HTTP::Request->new(GET => "https://myeve.eve-online.com/login.asp?username=$username&password=$password&Check=OK"); my $res = $ua->request($req); ($res->is_success) or die($res->status_line . "\n");
$req = HTTP::Request->new(GET => "http://myeve.eve-online.com/character/xml.asp?characterID=$charid"); $res = $ua->request($req); ($res->is_success) or die($res->status_line . "\n");
print $res->content; ---------------------------------------------------
|
![Narusegawa Naru Narusegawa Naru](/images/people/img16.png)
Narusegawa Naru
|
Posted - 2006.05.24 15:31:00 -
[49]
Anyone got a working PHP script to download the xml to a file?
|
![Cenaurille Cenaurille](/images/people/img16.png)
Cenaurille
|
Posted - 2006.05.24 19:23:00 -
[50]
You need to parse out the SID from the login response, and pass that to the attempt to fetch the character XML. Like so:
$cookie_file = tempnam("/tmp", "eve-c-"); $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
$url="https://myeve.eve-online.com/login.asp"; $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "username=".$username."&password=".$password."&Check=OK&login=Login"); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$content = explode("\n", curl_exec($ch)); preg_match('/sid=[0-9]*/', $content[1], $matches); curl_close($ch); unset($ch);
$url="http://myeve.eve-online.com/character/xml.asp?characterID=".$charid.'&'.$matches[0]; $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_URL, $url); $content = curl_exec($ch); curl_close($ch); unset($ch);
unlink($cookie_file);
|
|
![BillywWhizz BillywWhizz](/images/people/img1.png)
BillywWhizz
|
Posted - 2006.05.30 14:30:00 -
[51]
Hi,
I am trying to get the asp one to work. When I run the script, which has the right username and password in, i get an internal server error.
I am new to this asp stuff and wonder if someone could point me in the right direction.
Thanks.
|
|
|
|
Pages: 1 2 :: [one page] |