|
Geekathome
|
1. Post |
2009-08-14 13:25:51 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
A new unstable version (2.500) is available. The trophies are now sourced by US too. You don't need to update your EU widget anymore to get the actualy trophy data by this API (just unstable yet). The game trophy details will be included soon. The process to get these data is now created by file_get_contents and simplexml_load_string. A better method will coming soon maybe.
Unstable v0.2.500: http://api.geekweb.org/psn/community/?page=files&item=14&load=file
New source: http://profiles.us.playstation.com/playstation/psn/profiles/{AnyPsnId}/trophies
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
Geekathome
|
2. Post |
2009-08-16 15:04:17 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
The new source isn't available 24/7. So, sometimes the unstable output shows some PHP warnings.
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
Geekathome
|
3. Post |
2009-08-16 16:43:39 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
The trophy overview from sony supported games is now included:
Unstable v0.3.000: http://api.geekweb.org/psn/community/?page=files&item=16&load=file
Output example: http://api.geekweb.org/psn/getinfos/unstable/out.php?psnid=Geekathome&cat=trophy
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
ThOmAsZz050
|
4. Post |
2009-08-18 23:47:54 |
User-ID: 12
Koopman Thom
Function: Author
Group: Default
Posts: 13
|
I can't get the v0.3.00 working on my server.
I get this error:
Warning: file_get_contents(http://profiles.us.playstation.com/playstation/psn/profiles/ThOmAsZz050/trophies) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/thropy/domains/trophyhunters.nl/public_html/v2/unstable/functions.php on line 196
That´s only on the ´get contents´ requests from the us server.
It seems that the file can not be opened beqause it doesn't exist, but when I copy Paste it into the browser it goes to the correct page.
Any idea how to fix this?
I'm glad that someone has succes where I failed. I spent many hours figuring out how to get trophy data from the playstation site. So keep up the good work.
|
|
|
Sly--Ripper
|
5. Post |
2009-08-19 11:48:58 |
User-ID: 13
Matt
Function: Author
Group: Default
Posts: 3
|
ThOmAsZz050, it's a config error, read this for more info: http://phpsec.org/projects/phpsecinfo/tests/allow_url_fopen.html
-- http://www.PS3Trophies.com
|
|
|
ThOmAsZz050
|
6. Post |
2009-08-19 12:17:59 |
User-ID: 12
Koopman Thom
Function: Author
Group: Default
Posts: 13
|
Thanks, but I don't get that error when I just open http://www.us.playstation.com/ or http://www.google.com
http://www.us.playstation.com/playstation/psn/profiles/ -> works
http://www.us.playstation.com/playstation/psn/profiles/{ANY PSN} -> Doesn't
|
|
|
Geekathome
|
7. Post |
2009-08-19 12:47:02 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
Yeah, on the unstable code is an error by using PSN-IDs with numbers.
Take a look at the following bug: http://api.geekweb.org/psn/community/?page=bugs&item=5
I'll take a look at the code the next days and hope to find what (and why it) isn't working well.
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
ThOmAsZz050
|
8. Post |
2009-08-19 12:52:15 |
User-ID: 12
Koopman Thom
Function: Author
Group: Default
Posts: 13
|
http://api.geekweb.org/psn/getinfos/unstable/out.php?psnid=ThOmAsZz050
Works fine
|
|
|
ThOmAsZz050
|
9. Post |
2009-08-19 12:54:38 |
User-ID: 12
Koopman Thom
Function: Author
Group: Default
Posts: 13
|
even as:
http://api.geekweb.org/psn/getinfos/unstable/out.php?psnid=magmar126
Maybe that bug is caused by an unexisting EU Account/widget?
|
|
|
Geekathome
|
10. Post |
2009-08-19 13:06:25 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
Oh, right. I have tested some outs by your server ( http://trophyhunters.nl/v2/unstable/ ). My PSN-ID returns the errors too, so it's not about the existence of the EU widget and not about the numbers in PSN-IDs too.
I really confused that it returns an error 404 ... That seams like the url doesn't exist, but it works on the geekweb server, so ... strange. Have you got special php configurations and witch version do you use? What gets it back if you change the url by file_get_contents to: http://profiles.us.playstation.com/playstation/psn/profiles/ThOmAsZz050/ (without the last folder 'trophies') ... The same errors?
The point is that on this server are the same errors viewed (just for some psnids). So, as soon as I can eliminate these errors the script (new version naturally) will running without these errors on your server too, maybe.
Btw: If you find the problem and correct it, let us know about.
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
ThOmAsZz050
|
11. Post |
2009-08-19 13:53:30 |
User-ID: 12
Koopman Thom
Function: Author
Group: Default
Posts: 13
|
http://www.trophyhunters.nl/v2/unstable/test_contents.php
Contains the following PHP Code:
So that works fine. But as soon as i change it to http://profiles.us.playstation.com/playstation/psn/profiles/ThOmAsZz050 it returns that error.
Warning: file_get_contents(http://profiles.us.playstation.com/playstation/psn/profiles/ThOmAsZz050) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/thropy/domains/trophyhunters.nl/public_html/v2/unstable/test_contents.php on line 3
http://api.geekweb.org/psn/getinfos/unstable/out.php?psnid=Lottje
This one also get errors (different than above).
I think this happens when the specified PSN ID didn't Create an EU Widget, therefore the script not able to read the data. I tested with a few PSN ID without a EU Widget and a few with. The US data is always available, so maybe it's better to split those 2 different data sources?
The stable version works fine on my server btw. But i really want the unstable version to work because of the detailed trophy information.
|
|
|
ThOmAsZz050
|
12. Post |
2009-08-19 14:47:10 |
User-ID: 12
Koopman Thom
Function: Author
Group: Default
Posts: 13
|
Kilian, is it possible to output an game_id as an number and the avatar of the US account?
/trophies/36-Battlefield-Bad-Company
#36 in the case of Battlefield Bad Company etc.
|
|
|
Geekathome
|
13. Post |
2009-08-19 15:12:09 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
The new source (us trophies) isn't included on the best way at the time.
The trophy including process isn't finish yet: http://api.geekweb.org/psn/community/?page=todos&item=5
And for the game details I've to use these gameids, so I'll include it into one of the next unstable versions.
Please don't forget on using unstable: It's unstable :).
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
Sly--Ripper
|
14. Post |
2009-08-19 15:33:13 |
User-ID: 13
Matt
Function: Author
Group: Default
Posts: 3
|
Ok, there is no bug with using PSN IDs with numbers, it only shows an error if the EU PID doesn't exist, I've commented out the part of the script that gets the info from the EU PID since it just uses more CPU/bandwidth.
-- http://www.PS3Trophies.com
|
|
|
ThOmAsZz050
|
15. Post |
2009-08-19 15:47:35 |
User-ID: 12
Koopman Thom
Function: Author
Group: Default
Posts: 13
|
yeah i need that too Sly. Just wanna use the US data, but i still get that anoying error:
Warning: file_get_contents(http://profiles.us.playstation.com/playstation/psn/profiles/ThOmAsZz050/trophies) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/thropy/domains/trophyhunters.nl/public_html/v2/unstable/functions.php on line 150
Your version works ok?
|
|
|
Geekathome
|
16. Post |
2009-08-20 01:11:20 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
If you want to get no php warnings on unstable add error equal to anything by GET:
Geekweb: http://api.geekweb.org/psn/getinfos/unstable/out.php?psnid=ThOmAsZz050&cat=trophy&error=1
YourServer: http://trophyhunters.nl/v2/unstable/out.php?psnid=ThOmAsZz050&cat=trophy&error=1
Or change the first line in out.php to error_reporting(0); (Running error reporting 0 without any if by isset GET error). This doesn't really avert that you can't get the trophies by US, but you don't get any errors. On other cases it's possible that a php warning corrupts the output and without this it works fine.
And I've seen, that I don't get any error404 here ... there are just 'isn't an array' warnings on the Geekweb server. Seams like your server can't connect to the site, but that's really confusing. Once again: Have you special php settings set (modified php.ini using p.e.) and witch php version do you use? Use PHP >= 5.
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
Geekathome
|
17. Post |
2009-08-20 04:53:16 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
So, there is a new unstable (v0.3.1)
Source: http://api.geekweb.org/psn/community/?page=files&item=17&load=file
In this version the errors, by getting the trophies from the US site, are resolved.
@ThOmAsZz050: For your error404 ... check the new version out.
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
ThOmAsZz050
|
18. Post |
2009-08-21 02:03:34 |
User-ID: 12
Koopman Thom
Function: Author
Group: Default
Posts: 13
|
http://trophyhunters.nl/v2/unstable0-3-100/phpinfo.php
I can't edit php.ini because it's not a private server.
I never had any server configuration-related problems before, so i really don't know why I get this 404 warning.
|
|
|
Geekathome
|
19. Post |
2009-08-21 04:34:48 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
OK ... 'allow_url_fopen' is enabled and I see that other file_get_contents() works by your server.
So, check it out with some data by 'context' like:
- set a 'user_agent' value (your server puts FALSE by default, that can be blocked by the url)
- load it by using a proxy (if your server ip is blocked by the url)
...
<?
$opts = array(
'http'=> array(
'proxy' => 'tcp://127.0.0.1:8080',
'request_fulluri' => true,
'user_agent'=> $_SERVER['HTTP_USER_AGENT']
)
);
$context = stream_context_create($opts);
$url = "http://profiles.us.playstation.com/playstation/psn/profiles/" . $_GET['psnid'] . "/trophies";
$content = file_get_contents($url, false, $context);
echo (htmlentities($content));
?>
More about stream-context-create(): http://www.php.net/manual/en/function.stream-context-create.php
If this doesn't help, check the url by using some functions like:
get_headers(): http://www.php.net/manual/en/function.get-headers.php
fsockopen(): http://www.php.net/manual/en/function.fsockopen.php
curl functions: http://www.php.net/manual/en/ref.curl.php
... and report the results here.
Hope this helps.
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
ThOmAsZz050
|
20. Post |
2009-08-21 13:31:52 |
User-ID: 12
Koopman Thom
Function: Author
Group: Default
Posts: 13
|
The first option results in:
Warning: file_get_contents(http://profiles.us.playstation.com/playstation/psn/profiles/ThOmAsZz050/trophies) [function.file-get-contents]: failed to open stream: Connection refused in /home/thropy/domains/trophyhunters.nl/public_html/v2/unstable0-3-100/test.php on line 12
Get_headers():
Array ( [0] => HTTP/1.1 404 Not Found [1] => Content-Language: en-US [2] => Content-Type: text/plain; charset=UTF-8 [3] => Date: Fri, 21 Aug 2009 11:37:38 GMT [4] => Server: Webserver 1 [5] => Content-Length: 0 [6] => Connection: Close ) Array ( [0] => HTTP/1.1 404 Not Found [Content-Language] => en-US [Content-Type] => text/plain; charset=UTF-8 [Date] => Fri, 21 Aug 2009 11:37:38 GMT [Server] => Webserver 1 [Content-Length] => 0 [Connection] => Close )
fsockopen():
Warning: fsockopen() [function.fsockopen]: unable to connect to http://profiles.us.playstation.com/playstation/psn/profiles/ThOmAsZz050/trophies:80 (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in /home/thropy/domains/trophyhunters.nl/public_html/v2/unstable0-3-100/test.php on line 2
Unable to find the socket transport "http" - did you forget to enable it when you configured PHP? (-1215549088)
curl:
Seems to work... working on it
|
|
|
ThOmAsZz050
|
21. Post |
2009-08-21 13:53:30 |
User-ID: 12
Koopman Thom
Function: Author
Group: Default
Posts: 13
|
http://www.trophyhunters.nl/v2/unstable/out.php?psnid=ThOmAsZz050
It works:D
I Changed:
$url = "http://profiles.us.playstation.com/playstation/psn/profiles/".$psnid."/trophies";
to:
$url = "http://www.trophyhunters.nl/v2/unstable/curl_trophies.php?psnid=" . $_GET['psnid'] . "";
curl_trophies.php:
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_URL, "http://profiles.us.playstation.com/playstation/psn/profiles/" . $_GET['psnid'] . "/trophies/");
$buf2 = curl_exec ($ch);
curl_close ($ch);
echo $buf2;
Now moving on to the newest version
|
|
|
ThOmAsZz050
|
22. Post |
2009-08-21 16:08:49 |
User-ID: 12
Koopman Thom
Function: Author
Group: Default
Posts: 13
|
Woot, it works:D
http://www.trophyhunters.nl/v2/unstable0-3-100/out.php?psnid=ThOmAsZz050
I also added the Avatar. ( US profile doesn't work, so i placed it under US trophies)
And added the Game Images.
Thanks a lot for helping me out.
|
|
|
Geekathome
|
23. Post |
2009-08-21 16:45:57 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
Your welcome. Nice, that you got it work. Set any data into the infovars if you change some codes. You have to mark it as a modification and not the original script. P.e. rename the infovar 'name' from 'GetInfosByPsnId Script' into 'GetInfosByPsnId Script [modification]' and change the value of 'creator'.
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
Geekathome
|
24. Post |
2009-08-23 19:49:04 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
OK, I saw that you changed some values. But I can't find the code of your script.
If you have questions about the license, check this out: http://www.gnu.org/licenses/gpl-3.0.html
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
Sly--Ripper
|
25. Post |
2009-09-02 17:33:10 |
User-ID: 13
Matt
Function: Author
Group: Default
Posts: 3
|
Can you ad the URL to the PSN users avatar from here: http://profiles.us.playstation.com/playstation/psn/profiles/Sly-Ripper
Since a user may not have a US Forums account therefore we can't always use the avatar for the US profile.
-- http://www.PS3Trophies.com
|
|
|
Geekathome
|
26. Post |
2009-09-02 17:47:56 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
Sure. The question is just: Where in the existing structure should I include it? A new category 'img' doesn't really make sence, I think. By 'profiles' isn't a good idea too until we haven't a filter option by sources (US,EU ...) about the traffic just for getting the imgurl. And 'trophies' isn't the right category too ...
Any idea?
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
Geekathome
|
27. Post |
2010-03-07 22:28:19 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
Trophies by the (new) US site can't be fetched without a psn authentication anymore.
So I'll remove that from GetInfos and it will be a part for GetAuthData.
PS: If there is allways a way to get these information without a sign in let me know about.
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
dose420420
|
28. Post |
2010-03-09 06:48:17 |
User-ID: 55
{dose420420}
Function: Author
Group: Default
Posts: 4
|
you dont need auth for the us psn page.. you just need the new cookies and a new referer
|
|
|
tosmatrix3
|
29. Post |
2010-03-19 08:37:36 |
User-ID: 62
{tosmatrix3}
Function: Author
Group: Default
Posts: 1
|
dose420420 : You have the solution for getInfos with the (new) US site ?
|
|
|
dose420420
|
30. Post |
2010-03-20 11:18:37 |
User-ID: 55
{dose420420}
Function: Author
Group: Default
Posts: 4
|
heres the fix for the new us site.
using this you will need to refresh the first time just to store the cookie, after the first load the cookie should stick and you can remove the cookiejar
<?php
if(!empty($_GET['user'])) {
$user = strtolower($_GET['user']);
$url = "http://us.playstation.com/playstation/psn/profiles/".$user."/trophies/";
$ref = "http://us.playstation.com/playstation/psn/profiles/".$user."/trophies/";
$cookie = "Z:\www\blah.txt"; /* Replace with path to cookie */
$ch = curl_init();
curl_setopt($ch, CURLOPT_REFERER, $ref);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$html = curl_exec ($ch);
curl_close ($ch);
echo $html;
}
?>
|
|
|
dose420420
|
31. Post |
2010-03-20 11:28:52 |
User-ID: 55
{dose420420}
Function: Author
Group: Default
Posts: 4
|
if you use my snippet please credit yourgamercards.net in the source
http://yourgamercards.net/uspsn.php?user=dose420
|
|
|
Geekathome
|
32. Post |
2010-04-03 16:28:55 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
Yes, you're right dose420420. I'll update the GetTrophiesByUS().
But seams that we can't get trophy by trophy for each game without a sign in anymore.
I can write the needed cookies into a protected file for getting a valid sign in by the PSN-ID 'apiorg'.
Other ideas to retained the trophy detail functionality by GetInfos?
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
dose420420
|
33. Post |
2010-04-04 03:31:13 |
User-ID: 55
{dose420420}
Function: Author
Group: Default
Posts: 4
|
Again not true you dont need to be logged in to get any info.
Our trophy card.
http://www.yourgamercards.net/trophy/a/dose420.png
|
|
|
Geekathome
|
34. Post |
2010-04-04 20:33:26 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
Are we talking about the same? Your gamercard just includes trophy counts but not any trophy details (like title, description, level ...). We can get trophy counts (overall and by game) without any cookies from a signed in user. But we don't know that 'Zone Zeus' is a gold trophy of WipeOut HD (and if the choosen PSN-ID earned it or not) without the proper cookies for a signed in user on the US trophy site. If you are able to fetch these information without using cookies from a signed in user just let us know about how.
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
Stuey08
|
35. Post |
2010-04-09 22:07:41 |
User-ID: 70
{Stuey08}
Function: Author
Group: Default
Posts: 3
|
But they have the trophy images therefore you would be able to get the description, title also...
|
|
|
Geekathome
|
36. Post |
2010-04-12 00:45:46 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
OK. For all the people that doesn't understand the problem.
1. Without a SignIn
- open your webbrowser
- remove all 'playstation' cookies
- goto http://us.playstation.com/publictrophy/index.html?onlinename=Geekathome
- click on a game image in the available list (p.e. 'Dirt 2')
Now you don't see any trophies listed by your choosen game.
(The site creates two cookies 'ARPT' and 'JSESSIONID')
2. With a SignIn
- open your webbrowser
- remove all 'playstation' cookies
- goto http://us.playstation.com/publictrophy/index.html?onlinename=Geekathome
- Sign In with any PSN Account by the top-right SignIn link
- click on a game image in the available list (p.e. 'Dirt 2')
Now you can see any trophies listed by your choosen game.
(The site creates a lot of more cookies)
If you make a call for http://us.playstation.com/playstation/psn/profile/Geekathome/get_ordered_title_details_data by the referer as http://us.playstation.com/playstation/psn/profiles/Geekathome/trophies/1864-DiRT-2 with post data 'sortBy=ASC&titleId=1864-DiRT-2' and the cookies from the first try, you just get '<TrophyResponse status="1"/>' back. If you make the same call with the cookies 'TICKET','ARPT' and 'JSESSIONID' from the second try (the other cookies aren't mandatory), you get the list with the proper data.
Here a request header example for the 'get_ordered_title_details_data' call:
Host us.playstation.com
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 (.NET CLR 3.5.30729)
Accept text/javascript, text/html, application/xml, text/xml, */*
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
X-Requested-With XMLHttpRequest
X-Prototype-Version 1.6.1_rc3
Content-Type application/x-www-form-urlencoded; charset=UTF-8
Referer http://us.playstation.com/playstation/psn/profiles/Geekathome/trophies/1864-DiRT-2
Content-Length 33
Cookie TICKET=[proper value]; ARPT=[proper value]; JSESSIONID=[proper value]
Pragma no-cache
Cache-Control no-cache
[+ the post data string 'sortBy=ASC&titleId=1864-DiRT-2']
That means that the cookie 'TICKET' from the second try is mandatory to get the game trophies item by item.
This cookie is a long encoded string and was created by the sign in.
PS: I used firefox with firebug for that checking
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
DoSe420
|
37. Post |
2010-04-12 05:04:24 |
User-ID: 73
{DoSe420}
Function: Author
Group: Default
Posts: 7
|
ok you totally lost me...
With the info i provided you and just a little change to the url you can get ALL the trophy info.. You can get trophy counts, overall trophies, trophies for every game, trophy images.. you name it you can get it WITHOUT logging in to the playstation site.. All the info you had in the api before can still be got without a login. We are slacking to get our leaderboards and profiles done, due to various things lack of time mostly.. But when it is done i will post a link here showing you..
Hell after i first saw your api you had on here i would of figured with that little snippet i posted you would of had it all figured out again.. The only thing a valid login would be good for is psn friends list and verifying user names for custom reasons.
|
|
|
DoSe420
|
38. Post |
2010-04-12 05:11:04 |
User-ID: 73
{DoSe420}
Function: Author
Group: Default
Posts: 7
|
o i forgot to say look at our trophy card a little closer..
http://www.yourgamercards.net/trophy/a/geekathome.png
See the latest trophies on the card.. That right there is showing you can get trophies per game without signing in.
Ive already provided the stepping stone to gettin it all working again. Finding out the key to using it is on you. Sorry to be an ass about it but with all the work that went into the scripting of the card and making it get the info fast and not use heavy resources i wont be providing any more info.
|
|
|
testovaciNick
|
39. Post |
2010-04-14 11:37:52 |
User-ID: 76
{testovaciNick}
Function: Author
Group: Default
Posts: 1
|
Hi everyone,
so if dose doesnt want to publish his code ill. This script print out info about all users trophies by PSN game nick. Feel free to comment :)
<?php
if(!empty($_POST['user'])) {
$cookie = "test.txt";
$user = strtolower($_POST['user']);
$url = "http://us.playstation.com/playstation/psn/profile/".$user."/get_ordered_trophies_data";
$ref = "http://us.playstation.com/playstation/psn/profiles/".$user."/trophies/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_REFERER, $ref);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$html = curl_exec ($ch);
curl_close ($ch);
$trophies = explode("slotcontent",$html);
foreach($trophies as $key => $trophy)
{
if($key == 0) continue;
//Get image info
$startImageTag = strpos($trophy,"src=") + 5;
$endImageTag = strpos($trophy,'/>',$startImageTag) - 1;
$imageLink = substr($trophy,$startImageTag,$endImageTag-$startImageTag);
echo "Image: ".$imageLink."<br/>";
//Get title info
$startTitleTag = strpos($trophy,"gameTitleSortField",$endImageTag)+20;
$endTitleTag = strpos($trophy,"</span>",$startTitleTag);
$titleTag = substr($trophy,$startTitleTag,$endTitleTag-$startTitleTag);
echo "Title: ".$titleTag."<br/>";
//Get progress info
$startProgressTag = strpos($trophy,"gameProgressSortField",$endTitleTag)+23;
$endProgressTag = strpos($trophy,"</span>",$startProgressTag);
$progressTag = substr($trophy,$startProgressTag,$endProgressTag-$startProgressTag);
echo "Progress: ".$progressTag."%<br/>";
//Get trophy count info
$startTrophyCount = strpos($trophy,"gameTrophyCountSortField",$endProgressTag)+26;
$endTrophyCount = strpos($trophy,"</span>",$startTrophyCount);
$trophyCount = substr($trophy,$startTrophyCount,$endTrophyCount-$startTrophyCount);
echo "Total count: ".$trophyCount."<br/>";
//Get bronz trophy info
$startBronzCount = strpos($trophy,"trophycontent",$endTrophyCount)+15;
$endBronzCount = strpos($trophy,"</div>",$startBronzCount) - 1;
$bronzCount = substr($trophy,$startBronzCount,$endBronzCount-$startBronzCount);
echo "Bronze: ".$bronzCount."<br/>";
//Get silver trophy info
$startSilverCount = strpos($trophy,"trophycontent",$endBronzCount)+15;
$endSilverCount = strpos($trophy,"</div>",$startSilverCount) - 1;
$silverCount = substr($trophy,$startSilverCount,$endSilverCount-$startSilverCount);
echo "Silver: ".$silverCount."<br/>";
//Get gold trophy info
$startGoldCount = strpos($trophy,"trophycontent",$endSilverCount)+15;
$endGoldCount = strpos($trophy,"</div>",$startGoldCount) - 1;
$goldCount = substr($trophy,$startGoldCount,$endGoldCount-$startGoldCount);
echo "Golden: ".$goldCount."<br/>";
//Get platinum trophy info
$startPlatinumCount = strpos($trophy,"trophycontent",$endGoldCount)+15;
$endPlatinumCount = strpos($trophy," </div>",$startPlatinumCount);
$platinumCount = substr($trophy,$startPlatinumCount,$endPlatinumCount-$startPlatinumCount);
echo "Platinum: ".$platinumCount."<br/><br/>";
}
}
?>
|
|
|
DoSe420
|
40. Post |
2010-04-14 23:43:47 |
User-ID: 73
{DoSe420}
Function: Author
Group: Default
Posts: 7
|
woohoo someone finally caught on to it.. I only replied "A small change to the URL is all thats needed"
Now get crackin and get the rest.. Good Job nick on reading.
|
|
|
Geekathome
|
41. Post |
2010-04-15 19:37:47 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
What the hell? It's not really a problem to get these information. But that still doesn't answer my question how to get the information by 'get_ordered_title_details_data' without a the cookie 'TICKET' you got from the signin (posted on http://api.geekweb.org/psn/community/?page=forum&forum=4&topic=18#post:158 and http://api.geekweb.org/psn/community/?page=forum&forum=4&topic=18#post:160 ).
Sorry but by 'get_ordered_trophies_data' you don't know anything about a single trophy.
@DoSe420: I see ... You didn't really talk about 'get_ordered_title_details_data', right?
I'll include a protected file with the mandatory cookies by the PSN-ID 'apiorg' for getting the information from 'get_ordered_title_details_data'.
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
Stuey08
|
42. Post |
2010-04-16 00:00:39 |
User-ID: 70
{Stuey08}
Function: Author
Group: Default
Posts: 3
|
Yes you need a valid ticket (99% sure)...For my script I just signed into sony's site and and got the cookie information by exporting the cookie information. The following are in my cookie.txt file that's accessed via curl...ARPT, SESSIONID, TICKET, S2TICKET
|
|
|
Stuey08
|
43. Post |
2010-04-16 00:04:37 |
User-ID: 70
{Stuey08}
Function: Author
Group: Default
Posts: 3
|
To clarify my last post....I signed in with my web browser and exported the cookie information that way.
|
|
|
KlotX
|
44. Post |
2010-05-02 17:06:29 |
User-ID: 82
{KlotX}
Function: Author
Group: Default
Posts: 5
|
Hi
Do you have any idea if TICKET obtained from a legit signed in expires ?
I'm curious to know how DoSe420 obtain those trophy details without using the TICKET cookie. He's right that we don't need to sign in at the moment we get the information, but we need to have already done it sometime before.
|
|
|
Geekathome
|
45. Post |
2010-05-02 19:36:22 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
I've updated the GetInfos unstable. The us trophy data by 'get_ordered_title_details_data' isn't still a part of the unstable. I've spent too much time for that 'get_ordered_title_details_data' without getting the right data and it will be out of the api until anyone post an updated GetTrophiesByUS().
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
KlotX
|
46. Post |
2010-05-03 21:29:33 |
User-ID: 82
{KlotX}
Function: Author
Group: Default
Posts: 5
|
TICKET cookie expires, so as for now it is needed to get that cookie again and again.. This is definitely to be moved to GetAuthData..
@Geekathome, I'm willing to help you developing this.. where to get started from, and how to move forward ?
|
|
|
Geekathome
|
47. Post |
2010-05-04 17:17:42 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
@KlotX: If you want to help on the GetAuthData creation, goto the GetAuthData thread ( http://api.geekweb.org/psn/community/?page=forum&forum=10&topic=14 ) and add a post with the parts (from the list in post one) you want to do. And add your ideas, if you think there should be other points too. I've added a list about the structure.
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
shadowhorst
|
48. Post |
2010-06-20 14:25:19 |
User-ID: 100
{shadowhorst}
Function: Author
Group: Default
Posts: 2
|
Hi,
well I am also trying to get a full trophy list for a selected game of a special user but I'm stuck on the "get_ordered_title_details_data" like you guys. "TrophyResponse = 1" is the only response i can get ;/ How do all the other PSN-Tropy-Pages like http://ps3trophycard.com/solve that problem? They just ask for the PSN-ID and extract a full featured list of all my trophies. Actually I am very frustrated and running out of ideas.
shadowhorst
|
|
|
KlotX
|
49. Post |
2010-06-22 17:59:10 |
User-ID: 82
{KlotX}
Function: Author
Group: Default
Posts: 5
|
Hi
You need to authenticate and get the trophies...
The problem is how to get the cookies, but if you use firebug you can check every request/reply and replicate it.
The main problem is with hidden trophies, because an authenticated user only is able to see the details of an hidden trophy if that user already have that trophy. Otherwise it'll only see the date earned.
PS3trophies.com is now able to get the information of all trophies, even the hidden ones, but I didn't figured out how to get that data.
|
|
|
Geekathome
|
50. Post |
2010-06-23 02:43:33 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
@KlotX: A way to get the hidden trophies without a user auth that have all hidden unlocked: There are a lot of sites, that lists all trophies (hidden included) for every game. So it's possible to connect the list from the official trophy site with anyone that includes all trophies. You just need to get the name, description, level and icon from a site like these. The earned date is available by the official trophy site.
@shadowhorst: The ticket cookie you need for a trophy by trophy list will be a part in GetAuthData. So I'll include it into GetInfos maybe too (with stored user signin data [psnid 'apiorg'] by the vars.php and may a connection to an all trophy listed site) as soon as it works in GetAuthData (an all trophy site connection can be a point for this api too).
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
DoSe420
|
51. Post |
2010-06-25 02:58:29 |
User-ID: 73
{DoSe420}
Function: Author
Group: Default
Posts: 7
|
ps3trophies.com can get all trophies because you have to login with your psn account, once you are logged in with your account they scrape all your data and store it in their database.
ps3trophycard.com has access to the offical trophy server which is how they get all of a players trophies without the need to login.
P.S Kilian Waser, if you are still interested in doing a commercial project stop by yourgamercards.net and send me a pm on there my username is DoSe over there.
|
|
|
shadowhorst
|
52. Post |
2010-06-25 09:58:04 |
User-ID: 100
{shadowhorst}
Function: Author
Group: Default
Posts: 2
|
Hi,
thanks for your help. I appreciate that very much and I actually solved my issues with stored username and password. Currently I am writing exams so I dont't have so much time for coding, but I will show you my results when I am done with that.
Does anybody of you guys know how long a session on us.playstation.com is valid? A sign-in on every page-hit would be an bad idea i think ;D
cya
shadowhorst
|
|
|
DoSe420
|
53. Post |
2010-06-25 10:35:00 |
User-ID: 73
{DoSe420}
Function: Author
Group: Default
Posts: 7
|
session is valid till you logout i believe..
|
|
|
DoSe420
|
54. Post |
2010-06-25 10:59:41 |
User-ID: 73
{DoSe420}
Function: Author
Group: Default
Posts: 7
|
Heres a couple of our functions for the basic info you already have provided here. Just an alternative, little cleaner.
<?
function get_psnprofile()
/* Copyright yourgamercards.net */
{
global $psn, $referer, $cookie;
$url = "http://us.playstation.com/playstation/psn/profiles/" . $psn;
// create curl resource
$ch = curl_init();
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec($ch);
curl_close ($ch);
// check to see if they have trophies, if they don't just exit
if(preg_match("%<h2 align=\"center\">No User Profile<\/h2>%s", $html))
{
exit;
}
// get level and trophy count
preg_match_all("%<img width=\"57\" height=\"57\" border=\"0\" alt=\"\" src=\"(.*?)\"\/>%s", $html, $imageurl);
preg_match_all("%<div id=\"id-handle\">(.*?)<\/div>%s", $html, $psnname);
preg_match_all("%<div id=\"leveltext\">(.*?)<\/div>%s", $html, $level);
preg_match_all("%<div class=\"progresstext\">(.*?)<\/div>%s", $html, $levelpercent);
preg_match_all("%<div id=\"text\">(.*?)<\/div>%s", $html, $trophies);
preg_match_all("%<div class=\"text platinum\">(.*?) Platinum<\/div>%s", $html, $platinum);
preg_match_all("%<div class=\"text gold\">(.*?) Gold<\/div>%s", $html, $gold);
preg_match_all("%<div class=\"text silver\">(.*?) Silver<\/div>%s", $html, $silver);
preg_match_all("%<div class=\"text bronze\">(.*?) Bronze<\/div>%s", $html, $bronze);
$currentpsninfo['imageurl'] = $imageurl['1']['0'];
$currentpsninfo['imageurl'] = str_replace(
array("http://static-resource.np.community.playstation.net", "_s/", "_s.png", "s.png"),
array("http://assets.np.us.playstation.com", "/", ".png", "l.png"),
$currentpsninfo['imageurl']);
$currentpsninfo['psnname'] = $psnname['1']['0'];
$currentpsninfo['level'] = $level['1']['0'];
$currentpsninfo['levelpercent'] = str_replace(array(" ", "\r\n", "%"), array("", "", ""), $levelpercent['1']['0']);
$currentpsninfo['trophies'] = str_replace(array(" ", "\r\n"), array("", ""), $trophies['1']['0']);
$currentpsninfo['platinum'] = $platinum['1']['0'];
$currentpsninfo['gold'] = $gold['1']['0'];
$currentpsninfo['silver'] = $silver['1']['0'];
$currentpsninfo['bronze'] = $bronze['1']['0'];
$currentpsninfo['points'] = ($currentpsninfo['platinum'] * 180) + ($currentpsninfo['gold'] * 90) + ($currentpsninfo['silver'] * 30) + ($currentpsninfo['bronze'] * 15);
return $currentpsninfo;
}
function get_gameinfo()
/* Copyright yourgamercards.net */
{
global $psn, $referer, $cookie;
$url = "http://us.playstation.com/playstation/psn/profile/" . $psn . "/get_ordered_trophies_data";
// create curl resource
$ch = curl_init();
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec($ch);
curl_close ($ch);
// remove copyright/trademark symbol
$html = str_replace(array("™", "®"), array("", ""), $html);
preg_match_all("%<span class=\"gameTitleSortField\">(.*?)<\/span>%s", $html, $gametitle);
preg_match_all("%<a class=\"compareLink\" href=\"\/playstation\/psn\/profile\/trophies\/(.*?)\/compare%si", $html, $titleid);
preg_match_all("%<img border=\"0\" alt=\"\" src=\"(.*?)\"\/>%s", $html, $imageurl);
preg_match_all("%<span class=\"gameProgressSortField\">(.*?)<\/span>%s", $html, $progress);
preg_match_all("%<span class=\"gameTrophyCountSortField\">(.*?)<\/span>%s", $html, $trophies);
preg_match_all("%<div class=\"trophycontent\">(.*?)<\/div>%s", $html, $type);
$gameinfo['gametitle'] = $gametitle['1'];
$gameinfo['titleid'] = $titleid['1'];
$gameinfo['imageurl'] = $imageurl['1'];
$gameinfo['progress'] = $progress['1'];
$gameinfo['trophies'] = $trophies['1'];
$gameinfo['type'] = $type['1'];
return $gameinfo;
}
?>
|
|
|
Geekathome
|
55. Post |
2010-06-26 01:27:21 |
User-ID: 1
Kilian Waser
Function: Admin
Group: Developer
Posts: 104
|
@shadowhorst: A sessionId is valid just for some minutes.
@DoSe420: '$_COM' is listed as a project here, so I'm still interested in doing a commercial part.
But guys ... This thread is about 'Trophies by US', so keep it topic relevant, thanks.
-- Project overview: http://www.geekweb.org/
Personal PlayStation page: http://www.wasi.li/?page=ps
|
|
|
KlotX
|
56. Post |
2010-07-19 12:38:20 |
User-ID: 82
{KlotX}
Function: Author
Group: Default
Posts: 5
|
The authenticated session in us.playstation.com is valid for 24h.. after that you'll have to login again.
Sony has changed its authentication mechanism last week about 3 times :( It's like playing cat and mouse with sony...
I've been playing around with us.playstation site and until last friday I was able to authenticate myself and get the trophy info.. I was hoping to send that code to Kilian, but as of now it doesn't work :(
If you find it usefull I can post here the steps needed to authenticate using curl, but NOW it is not working, as some cookies are being set by javascript.
|
|