|
Geekathome
|
1. Post |
2009-08-14 13:25:51 |
User-ID: 1
Function: Admin
Group: Developer
Posts: 172
|
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.
New source: http://profiles.us.playstation.com/playstation/psn/profiles/{AnyPsnId}/trophies
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
Geekathome
|
2. Post |
2009-08-16 15:04:17 |
User-ID: 1
Function: Admin
Group: Developer
Posts: 172
|
The new source isn't available 24/7. So, sometimes the unstable output shows some PHP warnings.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
Geekathome
|
3. Post |
2009-08-16 16:43:39 |
User-ID: 1
Function: Admin
Group: Developer
Posts: 172
|
The trophy overview from sony supported games is now included: (Unstable v0.3.000)
Output example: http://api.geekweb.org/psn/getinfos/unstable/out.php?psnid=Geekathome&cat=trophy
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
ThOmAsZz050
|
4. Post |
2009-08-18 23:47:54 |
User-ID: 12
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
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
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
Function: Admin
Group: Developer
Posts: 172
|
Yeah, on the unstable code is an error by using PSN-IDs with numbers.
Take a look at the following bug: http://psnapi.org/?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.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
ThOmAsZz050
|
8. Post |
2009-08-19 12:52:15 |
User-ID: 12
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
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
Function: Admin
Group: Developer
Posts: 172
|
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.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
ThOmAsZz050
|
11. Post |
2009-08-19 13:53:30 |
User-ID: 12
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
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
Function: Admin
Group: Developer
Posts: 172
|
The new source (us trophies) isn't included on the best way at the time.
The trophy including process isn't finish yet: http://psnapi.org/?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 :).
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
Sly--Ripper
|
14. Post |
2009-08-19 15:33:13 |
User-ID: 13
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
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
Function: Admin
Group: Developer
Posts: 172
|
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.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
Geekathome
|
17. Post |
2009-08-20 04:53:16 |
User-ID: 1
Function: Admin
Group: Developer
Posts: 172
|
So, there is a new unstable (v0.3.1)
In this version the errors, by getting the trophies from the US site, are resolved.
@ThOmAsZz050: For your error404 ... check the new version out.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
ThOmAsZz050
|
18. Post |
2009-08-21 02:03:34 |
User-ID: 12
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
Function: Admin
Group: Developer
Posts: 172
|
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.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
ThOmAsZz050
|
20. Post |
2009-08-21 13:31:52 |
User-ID: 12
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
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
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
Function: Admin
Group: Developer
Posts: 172
|
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'.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
Geekathome
|
24. Post |
2009-08-23 19:49:04 |
User-ID: 1
Function: Admin
Group: Developer
Posts: 172
|
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
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
Sly--Ripper
|
25. Post |
2009-09-02 17:33:10 |
User-ID: 13
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
Function: Admin
Group: Developer
Posts: 172
|
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?
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
Geekathome
|
27. Post |
2010-03-07 22:28:19 |
User-ID: 1
Function: Admin
Group: Developer
Posts: 172
|
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.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
dose420420
|
28. Post |
2010-03-09 06:48:17 |
User-ID: 55
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
Function: Author
Group: Default
Posts: 2
|
dose420420 : You have the solution for getInfos with the (new) US site ?
|
|
|
dose420420
|
30. Post |
2010-03-20 11:18:37 |
User-ID: 55
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
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
Function: Admin
Group: Developer
Posts: 172
|
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?
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
dose420420
|
33. Post |
2010-04-04 03:31:13 |
User-ID: 55
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
Function: Admin
Group: Developer
Posts: 172
|
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.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
Stuey08
|
35. Post |
2010-04-09 22:07:41 |
User-ID: 70
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
Function: Admin
Group: Developer
Posts: 172
|
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
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
DoSe420
|
37. Post |
2010-04-12 05:04:24 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
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
Function: Author
Group: Default
Posts: 59
|
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
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
Function: Author
Group: Default
Posts: 59
|
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
Function: Admin
Group: Developer
Posts: 172
|
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://psnapi.org/?page=forum&forum=4&topic=18#post:158 and http://psnapi.org/?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'.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
Stuey08
|
42. Post |
2010-04-16 00:00:39 |
User-ID: 70
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
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
Function: Author
Group: Default
Posts: 10
|
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
Function: Admin
Group: Developer
Posts: 172
|
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().
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
KlotX
|
46. Post |
2010-05-03 21:29:33 |
User-ID: 82
Function: Author
Group: Default
Posts: 10
|
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
Function: Admin
Group: Developer
Posts: 172
|
@KlotX: If you want to help on the GetAuthData creation, goto the GetAuthData thread ( http://psnapi.org/?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.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
shadowhorst
|
48. Post |
2010-06-20 14:25:19 |
User-ID: 100
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
Function: Author
Group: Default
Posts: 10
|
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
Function: Admin
Group: Developer
Posts: 172
|
@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).
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
DoSe420
|
51. Post |
2010-06-25 02:58:29 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
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
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
Function: Author
Group: Default
Posts: 59
|
session is valid till you logout i believe..
|
|
|
DoSe420
|
54. Post |
2010-06-25 10:59:41 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
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
Function: Admin
Group: Developer
Posts: 172
|
@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.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
KlotX
|
56. Post |
2010-07-19 12:38:20 |
User-ID: 82
Function: Author
Group: Default
Posts: 10
|
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.
|
|
|
KenComeuRyu
|
57. Post |
2010-09-17 17:10:27 |
User-ID: 128
Function: Author
Group: Default
Posts: 2
|
How you guys are decoding the TICKET cookie?
Appling base64 doesn't brings all information in a readable way.
|
|
|
Geekathome
|
58. Post |
2010-09-19 16:12:47 |
User-ID: 1
Function: Admin
Group: Developer
Posts: 172
|
@KlotX:
That would be usefull. Please post your steps here. I'll do some try maybe soon again.
It would be nice to have all trophy data (and not just the overview) by this function.
@KenComeuRyu:
Why do you want to decode it?
Think that you can't get more than a md5/sha1/.. hash.
And for doing a call you don't need to decode any given cookies.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
KenComeuRyu
|
59. Post |
2010-10-12 02:08:40 |
User-ID: 128
Function: Author
Group: Default
Posts: 2
|
Decoding TICKET cookie you can see who is the owner. I already tried to change the owner but it carries more information to identify the user, so was not enough.
So decode has been discarded for a while.
After that, I made some progress storing the TICKET cookie from users, now I'm able to work like ps3trophies.com, my users have only have to login once to collect data anytime. Next step is find the trick used by yourgamercads.net, and I guess I'm in the right way.
Compare functions on us.playstation offers too much information, now basically I need to discover how to reach on an image having game id and trophy id.
|
|
|
Dead1yAssass1n
|
60. Post |
2010-12-10 21:37:43 |
User-ID: 152
Function: Author
Group: Default
Posts: 3
|
I was also able to get the TICKET cookie from the login. I am simply using a dummy account that I created to do the login. This way, I don't have to ask the user for their login information, but I can still login. Any user can be logged in, not necessarily the user you are looking at.
To get the TICKET cookie(and all 10 cookies from the login), you have to make another GET request to this URL:
http://us.playstation.com/uwps/HandleIFrameRequests?sessionId={TheSessionID}
and the REFERER as
http://us.playstation.com/uwps/PSNTicketRetrievalGenericServlet?sessionId={TheSessionID}
The REFERER could be the same as the REFERER that was used during the login. I didn't try using a different REFERER.
The response of this request will have the cookies.
However, when trying to get the Trophies for a game, I am getting the "<TrophyResponse status=\"4\"/>" response.
|
|
|
DoSe420
|
61. Post |
2010-12-22 05:07:02 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
Im suprised nobody has found the key yet.. Login to the playstation us site, save your TICKET cookie into a text file. Use curl's cookiefile option, point to the text file with your saved TICKET and you can get any users trophies (Minus hidden trophies)
You can use a dummy account if your scared, but your ticket cookie dont give any access to anythin that can be changed. This was what we first started with. Getting hidden trophies and stuff is all on you guys. Consider this my X-mas gift to geekweb, now you guys will be able to get trophies just not all of them.
|
|
|
fabriciols
|
62. Post |
2010-12-29 18:30:36 |
User-ID: 155
Function: Author
Group: Default
Posts: 8
|
im the main developer from the www.myps3t.com.br site, a brazilian ps3 trophy ranking.
I use the process described by Dose420 , but my users can login in sony site and i get the sessionID to get all hidden trophys.
After storing a large base of users with sessionID, you can get all hidden trophys by association...
The problem is, how ta hell ps3trophies.com and psnapi.com.ar can get ALL GAMES, including ones that do not display in sony US site ?
In my site i use the sessionID to log in EU site and retrieve trophy info that sony US miss, but the cookie expire in ~15 minuts, so the user have to login every time he gets new trophy ... and this is annoying
DoSe420, you are a staff member from what site ?
ps.: sry my bad english :P
-- http://www.myps3t.com.br
|
|
|
DoSe420
|
63. Post |
2010-12-31 07:12:59 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
im from yourgamercards.net
|
|
|
TonicDSH
|
64. Post |
2011-02-12 05:12:30 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
Me and dose have no need for this anymore so here you go kiddies.
Requires perl and I believe shell? Can't remember.
<?php
//Our PSN Name
$psn = "Tonic-_-";
//Function that will successfully base64_encode the string
function encode_base64($psn)
{
exec("perl -e 'use MIME::Base64; print(MIME::Base64::encode_base64(\"$psn\"));'", $output);
return $output[0];
}
//Function that creates the generated TICKET
function forge($data)
{
$coded = encode_base64($data);
$username = str_replace("=", "", $coded);
$usr = str_pad($username, "40", "A" , STR_PAD_RIGHT);
$ticket = 'MQAAAAAAAQcwAAC7AAgAFM5EePoeaO%2Fsgqrfgn%2FEdM26C8nzAAEAB' . 'AAAAQAABwAIAAABKfu4ZAMA%0ABwAIAAABKgDevqAAAgAIbzm%2FK9S5VEMABAAg' . $usr . '%0AAAAACAAEdXMAAQAEAARiNgAAAAgAGFVQOTAwMi1OUFdBMDAwMzVfMDAAAAAAADARAAQHxgoC' . 'AAEA%0ABBMAAgAwEAAPBkdNU1RPUAAAASUsW1nQAAAAADACAEQACAAE2%2B8LsgAIADgwNQIZAIT3xt0j1fKW%0A%2Fl90HaWb4nEw%2Ba%2FqJN%2BctQIYIp6iwLaWO2E%2FGLW1YrhfE%2BXEkmJ7sKg7AA%3D%3D';
return $ticket;
}
//Ref
$referer = "http://us.playstation.com/playstation/psn/profiles/" . $psn . "/trophies/";
//Cookie which gives us access and lets us fetch data as the user
$cookie = "TICKET=" . forge($psn);
//Blah blah this should be a no brainer
$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_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec($ch);
curl_close ($ch);
?>
That simple. This will let you fetch trophies, games, etc as the PSN ID user. Basically the whole cookie issue is resolved and the hidden trophies. That CURL above just fetches the basic info but if you do you research you'll get the rest no problem.
|
|
|
N1xx1
|
65. Post |
2011-02-17 17:16:46 |
User-ID: 118
Function: Author
Group: Default
Posts: 40
|
OMG!!!
Well done, it needs a shell but it's good anyway.
If you change
$url = "http://us.playstation.com/playstation/psn/profiles/" . $psn;
to
$url = "http://us.playstation.com/playstation/psn/profile/" . $psn . "/get_ordered_trophies_data";
U can get all the trophy.
Thank you!
|
|
|
N1xx1
|
66. Post |
2011-02-17 17:23:53 |
User-ID: 118
Function: Author
Group: Default
Posts: 40
|
EDIT:
You can use the base64_encode() php native function reather then the perl one.
So the code now have to be:
<?php
//Our PSN Name
$psn = "N1xx1";
//Function that creates the generated TICKET
function forge($data)
{
$coded = base64_encode($data);
$username = str_replace("=", "", $coded);
$usr = str_pad($username, "40", "A" , STR_PAD_RIGHT);
$ticket = 'MQAAAAAAAQcwAAC7AAgAFM5EePoeaO%2Fsgqrfgn%2FEdM26C8nzAAEAB' . 'AAAAQAABwAIAAABKfu4ZAMA%0ABwAIAAABKgDevqAAAgAIbzm%2FK9S5VEMABAAg' . $usr . '%0AAAAACAAEdXMAAQAEAARiNgAAAAgAGFVQOTAwMi1OUFdBMDAwMzVfMDAAAAAAADARAAQ' . 'HxgoCAAEA%0ABBMAAgAwEAAPBkdNU1RPUAAAASUsW1nQAAAAADACAEQACAAE2%2B8LsgAIADgwNQIZAIT3xt0j1fKW%0A%2Fl90HaWb4nEw%2Ba%2FqJN%2BctQIYIp6iwLaWO2E%2FGLW1YrhfE%2BXEkmJ7sKg7AA%3D%3D';
return $ticket;
}
//Ref
$referer = "http://us.playstation.com/playstation/psn/profiles/" . $psn . "/trophies/";
//Cookie which gives us access and lets us fetch data as the user
$cookie = "TICKET=" . forge($psn);
$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_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec($ch);
curl_close ($ch);
?>
|
|
|
TonicDSH
|
67. Post |
2011-02-17 19:48:02 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
Don't mean to sound rude but by using the PHP base64_encode it's a 50/50 chance of getting users trophies.
Here's why, The PHP's base64_encode internal function cuts off characters, numbers, etc. Say you got a user such as Dose420, it will return dose4. This is why we use perl. Perl's internal base64 encoding process actually fully encodes the proper name no matter what character is in it as to where PHP cuts short some names.
|
|
|
TonicDSH
|
68. Post |
2011-02-17 19:49:58 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
Getting your hosting provider to provide shell if you show them the exact reason I don't see why they wouldn't grant it, seeing as most hosting companies use cPanel which has a lot of security protection on shell and each shell user account, That or make sure the server you are residing on has PHP/Perl. Then you can rewrite the function in perl and call it through your PHP script. We just used shell execution because it was easier and less writing.
|
|
|
N1xx1
|
69. Post |
2011-02-18 13:42:28 |
User-ID: 118
Function: Author
Group: Default
Posts: 40
|
Hmmmmmmmm...
I dont understand u...
Can u explain this... better?
Im not so good in perl and base64 encode...
|
|
|
TonicDSH
|
70. Post |
2011-02-19 07:07:37 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
Query the username DoSe420, look at God of war 3 as the example, you'll notice his hidden trophies won't show. PHP's base64_encode doesn't properly encode a entire string, so Dose420 in base64 becomes Dose4
|
|
|
TonicDSH
|
71. Post |
2011-02-19 07:08:28 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
You'll have to do research on how to call a perl script by PHP, but you can essentially take whats done and rewrite it for Perl if your host won't give you shell access. We had a perl script that .co.uk gave us but I lost it long ago.
|
|
|
N1xx1
|
72. Post |
2011-02-19 14:52:55 |
User-ID: 118
Function: Author
Group: Default
Posts: 40
|
I've made a simple test:
<?php
function encode_base64($psn)
{
exec("perl -e 'use MIME::Base64; print(MIME::Base64::encode_base64(\"$psn\"));'", $output);
return $output[0];
}
$name = "Dose420";
echo $name." ";
echo base64_encode($name)." ";
echo encode_base64($name)." ";
$name = "N1xx1";
echo $name." ";
echo base64_encode($name)." ";
echo encode_base64($name)." ";
$name = "Geekathome";
echo $name." ";
echo base64_encode($name)." ";
echo encode_base64($name)." ";
?>
The output will be:
Dose420
RG9zZTQyMA==
RG9zZTQyMA==
N1xx1
TjF4eDE=
TjF4eDE=
Geekathome
R2Vla2F0aG9tZQ==
R2Vla2F0aG9tZQ==
I dont understand the problem O_O
|
|
|
DoSe420
|
73. Post |
2011-02-19 15:39:29 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
I dunno.. We originally tried using phps base64 encode but it was randomly cutting parts of the names off for whatever reason. Thats why we used perl for that bit
|
|
|
DoSe420
|
74. Post |
2011-03-11 09:03:14 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
For those who know the US site changed again. I dont know what all has changed but here is the main fix. This is only for those who use PHP & CURL.
$psn = $_GET['user']; // Get our user.
$referer = "https://us.playstation.com/playstation/psn/profiles/" . $psn; // This is the refering url
$cookie = "TICKET=" . forge($psn); // This line you must scroll up if you havent seen yet.
$url = "https://us.playstation.com/playstation/psn/profiles/" . $psn;
$ch = curl_init();
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, TRUE); // This line isnt really needed but i left it here.
$html = curl_exec($ch);
curl_close ($ch);
echo $html;
Basically sony changed protocols from http to https. So we just change the urls to https and add curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); to the curl to bypass this change.
|
|
|
saadbashir
|
75. Post |
2011-03-12 07:54:37 |
User-ID: 161
Function: Author
Group: Default
Posts: 3
|
/get_ordered_trophies_data << doesn't seem to work anyone.. can someone help how to fetch the trophies now?
|
|
|
DoSe420
|
76. Post |
2011-03-12 22:35:38 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
Read my last post.. I already posted the fix, change the url to the get_ordered_trophies_data url and make sure to use https
|
|
|
saadbashir
|
77. Post |
2011-03-18 12:34:50 |
User-ID: 161
Function: Author
Group: Default
Posts: 3
|
My bad.. Thank you DoSe420 works great! Btw i was wondering is it possible to get detail of the trophies for a particular game. As to which trophies I have earned for example Call of Duty: Black Ops
|
|
|
Mir-06
|
78. Post |
2011-03-21 13:36:42 |
User-ID: 176
Function: Author
Group: Default
Posts: 2
|
Hi, is it possible to get the recent Trophies you got from a game using this API?
|
|
|
Geekathome
|
79. Post |
2011-03-21 14:43:54 |
User-ID: 1
Function: Admin
Group: Developer
Posts: 172
|
The function 'GetTrophies' in our unstable just have to be updated by someone.
I lost the focus on that functionality because there are signed in information (a valid ticket cookie) needed.
This cookie expires, so we need an automated actualization, a script by cron job that signes in from time to time.
We need a user for that. I've created an account (apiorg) for our tests a long time ago wich we can use here to.
I will take a look at it as soon as possible. If someone else want to do it, just let us know about.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
DoSe420
|
80. Post |
2011-03-22 05:00:21 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
No login is needed to get any of the US playstation info. No saving cookies or anything, all you need to do is include the information me and tonic have been providing.
<?php
//Our PSN Name
$psn = $_GET['psnid'];
//Function that creates the forged cookie
function forge($data)
{
$coded = base64_encode($data);
$username = str_replace("=", "", $coded);
$usr = str_pad($username, "40", "A" , STR_PAD_RIGHT);
$ticket = 'MQAAAAAAAQcwAAC7AAgAFM5EePoeaO%2Fsgqrfgn%2FEdM26C8nzAAEAB' . 'AAAAQAABwAIAAABKfu4ZAMA%0ABwAIAAABKgDevqAAAgAIbzm%2FK9S5VEMABAAg' . $usr . '%0AAAAACAAEdXMAAQAEAARiNgAAAAgAGFVQOTAwMi1OUFdBMDAwMzVfMDAAAAAAADARAAQ' . 'HxgoCAAEA%0ABBMAAgAwEAAPBkdNU1RPUAAAASUsW1nQAAAAADACAEQACAAE2%2B8LsgAIADgwNQIZAIT3xt0j1fKW%0A%2Fl90HaWb4nEw%2Ba%2FqJN%2BctQIYIp6iwLaWO2E%2FGLW1YrhfE%2BXEkmJ7sKg7AA%3D%3D';
return $ticket;
}
//Refering url, needed or you get page moved
$referer = "http://us.playstation.com/playstation/psn/profiles/" . $psn . "/trophies/";
//Forged cookie, lets script login as any user and get all trophy info including hidden trophies.
$cookie = "TICKET=" . forge($psn);
?>
|
|
|
DoSe420
|
81. Post |
2011-03-22 05:14:27 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
Here ya go kilian. Functions for basic user info, users games, and users trophies. Also in my post above i forgot to make the $referer https instead of http
<?php
function get_psnprofile()
{
global $psn, $referer, $cookie;
$url = "https://us.playstation.com/playstation/psn/profiles/" . $psn;
// create curl resource
$ch = curl_init();
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
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=\"/playstation/PSNImageServlet\?avtar=(.*?)\" title=\"(.*?)\"\/>%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['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()
{
global $psn, $referer, $cookie;
$url = "https://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_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
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=\"(.*?)\" title=\"(.*?)\"\/>%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;
}
function get_trophyinfo($titleid)
{
global $psn, $referer, $cookie;
$url = "https://us.playstation.com/playstation/psn/profile/" . $psn . "/get_ordered_title_details_data";
// create curl resource
$ch = curl_init();
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "sortBy=id_asc&titleId=" . $titleid);
$html = curl_exec($ch);
curl_close ($ch);
preg_match_all("%<img border=\"0\" alt=\"(.*?)\" title=\"(.*?)\" src=\"(.*?)\"\/>%s", $html, $matches);
preg_match_all("%<span class=\"trophyTitleSortField\">(.*?)<\/span>(.*?)<br\/>%s", $html, $trophyTitle);
preg_match_all("%<span class=\"subtext\">(.*?)<\/span>%s", $html, $trophyDescription);
preg_match_all("%<div class=\"lastTrophyTime\">(.*?)<\/div>%s", $html, $trophyDate);
preg_match_all("%<span class=\"trophyTypeSortField\" style=\"display:none\">(.*?)<\/span>%s", $html, $trophyType);
$trophyinfo['hidden'] = $trophyTitle['2'];
$trophyinfo['hidden'] = str_replace(array(" ", "\r", "\n", "*"), array("", "", "", "1"), $trophyTitle['2']);
$trophyinfo['status'] = $matches['1'];
$trophyinfo['imageurl'] = $matches['3'];
$trophyinfo['title'] = $trophyTitle['1'];
$trophyinfo['description'] = $trophyDescription['1'];
$trophyinfo['date'] = $trophyDate['1'];
$trophyinfo['type'] = $trophyType['1'];
$trophyinfo['xmborder'] = array_keys($trophyinfo['status']);
$trophyEarned = array_count_values($trophyinfo['status']);
$trophyinfo['earned'] = $trophyEarned["Earned Trophy"];
// Remove Hidden trophies if not earned. Needed or messes up order of things
if($trophyEarned["Hidden Trophy"] > 0)
{
$keys = array_keys($trophyinfo['status'], "Hidden Trophy");
foreach($keys as $value)
{
unset($trophyinfo['status'][$value]);
unset($trophyinfo['imageurl'][$value]);
unset($trophyinfo['date'][$value]);
unset($trophyinfo['type'][$value]);
unset($trophyinfo['xmborder'][$value]);
}
$trophyinfo['status'] = array_values($trophyinfo['status']);
$trophyinfo['imageurl'] = array_values($trophyinfo['imageurl']);
$trophyinfo['date'] = array_values($trophyinfo['date']);
$trophyinfo['type'] = array_values($trophyinfo['type']);
$trophyinfo['xmborder'] = array_values($trophyinfo['xmborder']);
}
return $trophyinfo;
}
?>
|
|
|
Mir-06
|
82. Post |
2011-03-22 08:30:36 |
User-ID: 176
Function: Author
Group: Default
Posts: 2
|
Thanks for this code, it works!
|
|
|
Geekathome
|
83. Post |
2011-03-23 11:22:16 |
User-ID: 1
Function: Admin
Group: Developer
Posts: 172
|
Thanks Dose420. I've kudoed your two posts.
Will take a look at it the next days and release a new unstable with the updated GetTrophies.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
Gladson_MF
|
84. Post |
2011-03-25 18:25:24 |
User-ID: 180
Function: Author
Group: Default
Posts: 1
|
Dose420 changes don't work. The returned numbers of platinum, golden, silver and bronze trophies are zero. I've just noticed that a few days ago Sony has changed the public profile page, now the page loads with zero trophies (when the API gets the information), and then it updates the numbers after the page is fully loaded. propably a javascript function is call on some kind of "onload" method and updates the trophy number divs.
Any idea about how to get it to work now?
|
|
|
DoSe420
|
85. Post |
2011-03-25 21:01:44 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
At the time i posted the code it was working. Ill take a look and see what they changed now, see if i can figure out what they changed.
|
|
|
DoSe420
|
86. Post |
2011-03-25 21:44:49 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
So far i see the cookies required to get info have changed. Before all you needed was TICKET to be valid. Now you need the following cookies to be valid.
ps-qa.si
TICKET
PSNS2TICKET
userinfo
|
|
|
x_sphere
|
87. Post |
2011-03-26 21:37:48 |
User-ID: 181
Function: Author
Group: Default
Posts: 13
|
" and then it updates the numbers after the page is fully loaded. propably a javascript function is call on some kind of "onload" method and updates the trophy number divs. "
No JS function. They moved the trophy counts into an image. They've since gone back to the old format.
Also Sony just switched back to non-SSL connections today.
This is x3sphere from exophase.com, btw.
|
|
|
fabriciols
|
88. Post |
2011-04-02 16:22:25 |
User-ID: 155
Function: Author
Group: Default
Posts: 8
|
the dose ticket generation its working now...
the python equivalent function:
=====================
def gen_TICKET(user):
b64 = base64.b64encode(user);
username = b64.replace("=", "")
usr = username.ljust(40, "A")
ticket = 'MQAAAAAAAQcwAAC7AAgAFM5EePoeaO%2Fsgqrfgn%2FEdM26C8nzAAEAB' + \
'AAAAQAABwAIAAABKfu4ZAMA%0ABwAIAAABKgDevqAAAgAIbzm%2FK9S5VEMABAAg' + usr + \
'%0AAAAACAAEdXMAAQAEAARiNgAAAAgAGFVQOTAwMi1OUFdBMDAwMzVfMDAAAAAAADARAAQ' + \
'HxgoCAAEA%0ABBMAAgAwEAAPBkdNU1RPUAAAASUsW1nQAAAAADACAEQACAAE2%2B8LsgAIADgwNQIZAIT3xt0j1fKW%0A%2Fl90HaWb4nEw%2Ba%2FqJN%2BctQIYIp6iwLaWO2E%2FGLW1YrhfE%2BXEkmJ7sKg7AA%3D%3D'
return ticket
===============
how to get games that do not appear on the site of the us psn?
today im using the psnapi.com.ar for this, but i surely want to know how to do this, to implement by myself.
-- http://www.myps3t.com.br
|
|
|
fabriciols
|
89. Post |
2011-04-02 16:31:12 |
User-ID: 155
Function: Author
Group: Default
Posts: 8
|
btw, i prefer get game trophys in the address:
http://us.playstation.com/playstation/psn/profile/get_user_trophies_with_profile?title=NPWR00400_00&target=USERNAME
besides get_ordered_data.
why ? he returns the ID for the trophy, and is a xml...
-- http://www.myps3t.com.br
|
|
|
TonicDSH
|
90. Post |
2011-04-03 07:42:57 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
The way me and dose get them goes through various steps but we mainly have access directly to the trophy database / server. Lot of steps are taken and requires a lot of work. More work then I think most bargin for. Basically it's pretty high-maintenance. Almost similar to ps3trophycard.com (when it was around). But the owner paid people to do almost everything for him.
|
|
|
x_sphere
|
91. Post |
2011-04-03 20:21:10 |
User-ID: 181
Function: Author
Group: Default
Posts: 13
|
We use the trophy server too. Although it still requires (as far as I know, maybe I haven't looked hard enough) to query the US/EU sites for trophy images. The trophy server only returns IDs. The actual path to images is obfuscated with some kind of hash. That's why our card is missing some games. But I can easily fix this, with having all IDs, just requires some manual work on our part if the US/EU site lacks data.
|
|
|
TonicDSH
|
92. Post |
2011-04-03 21:00:59 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
The obfuscation looks to be SHA-1, I do not own a PS3 so I can crack it open and look around, i'm limited to the SDK and third party people looking through the functions for me. I'm a more hands on person that needs to see the coding myself to piece anything together. All the functions needed for such task is on the PS3 it's self, I just need a PS3 to do it.
|
|
|
N1xx1
|
93. Post |
2011-04-03 21:41:51 |
User-ID: 118
Function: Author
Group: Default
Posts: 40
|
I tried to sniff my ps3 via Wifi. I had no result, problabli it is 'cause I can't recive his packets, or it is a problem of my pc.
Anybody did it? I use WireShark w/ ubuntu 10.10 maverick.
|
|
|
fabriciols
|
94. Post |
2011-04-04 03:14:17 |
User-ID: 155
Function: Author
Group: Default
Posts: 8
|
So, TonicDSH and x_sphere, why do not release to us this method?
I already sniff the ps3 and did some studies have found the addresses of the internal sony trophy API, but I can't pass the authentication ( once / nonce and auth digest) ...
several sites have already achieved that, then I see no reason to NOT pass on to others :)
My site is unique to Brazil, and this will be a good improvement!
-- http://www.myps3t.com.br
|
|
|
TonicDSH
|
95. Post |
2011-04-04 06:40:58 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
The more people that have access the higher chance sony will notice. That simple. So far very few sites actually have it. Ps3trophies.com, Yourgamercards, Playfire and i guess exophase.
Playfire didn't even aquire the information on their own. Pretty much all they did was pay the guy that ran ps3trophycard.com for their source.
psnapi just gets it's data from EU.
using the actual server is more work then what most people bargin for.
|
|
|
DoSe420
|
96. Post |
2011-04-04 06:41:38 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
Giving out the passwords to the servers is not legal.
|
|
|
x_sphere
|
97. Post |
2011-04-04 08:06:49 |
User-ID: 181
Function: Author
Group: Default
Posts: 13
|
"Giving out the passwords to the servers is not legal."
This. Like Tonic said, there's a lot of work involved. Getting the key is only half the battle.
Honestly, if you can't figure out how to access it, you probably should just stick to the regular scraping method.
|
|
|
Geekathome
|
98. Post |
2011-04-04 12:51:08 |
User-ID: 1
Function: Admin
Group: Developer
Posts: 172
|
Wow, nearly 100 posts in this thread. I'm very busy now, but I will take a look at it as soon as possible and hope to get the whole us trophy data back in our GetInfos. Sniff the PS3 is a way too, but scraping official Sony sites that provide our needed information is much easier. I'll keep you updated.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
skippycue
|
99. Post |
2011-04-05 14:44:26 |
User-ID: 165
Function: Author
Group: Default
Posts: 21
|
Actually, I know of several other sites that have (and have been using this data for some time now, including myself)... Honestly, the data that comes from the PS3 is nothing special because it is incomplete. You can get all the games a user has, the earned trophy ids/dates they have for each game, general profile information (avatar, language, country, plus member), and trophy totals/level progress (including level min/max).
What you can't get is game complete percentage, trophy totals for any game (only earned trophies), trophy images/titles/descriptions, friends list. There are .ESFM files for every game that gives trophy info for the game, but I have not been successful breaking this encryption.
So, my point is even with access to the PS3, you STILL need to access the EU/US sites to get actual descriptions and images for trophies. The US site is good because you don't need authentication, but it's missing lots of games. The EU site is good because it has your last 64 games, but requires authentication. There is also another site I access that the android app uses which gives you the last 64 games with no authentication, but does not include trophy images. So... between querying 4 different sources for data and a large user base, you SHOULD be able to develop a semi-decent/accurate site, but you'll always have the problem of new stuff coming out and having to wait for people to earn trophies before you can see them (that is of course without manual adding of new content).
|
|
|
skippycue
|
100. Post |
2011-04-05 15:00:31 |
User-ID: 165
Function: Author
Group: Default
Posts: 21
|
Maybe we should all work together instead of creating competing sites and attracting sony's attention, lol. ;-) We all have the same goal, make a useful, accurate site that SONY should've made from the beginning. Sorry for the double post, no edit button...
|
|
|
Geekathome
|
101. Post |
2011-04-05 15:38:08 |
User-ID: 1
Function: Admin
Group: Developer
Posts: 172
|
First of all we should all work together to have a good working API that returns the needed information. The trophy scraping is a nightmare because as soon as we get it to work, Sony will update their site frontends in ways we have to change our codes again and again. So it will be difficult to get all the trophy data in GetInfos stable. But that's what I want to have one day (and I hope a lot of other people here too). As soon as we have it and it's working good enough to become 'stable', it would be nice to create a project that use the potential of all these usertrophy information in a way no other site did it yet.
-- Become a psnapi.org supporter: http://psnapi.org/?page=supportus
PSN Sign In Service: http://www.psnapi.com/service/signin/
My personal PlayStation page: http://kili.wasi.li/?page=ps
|
|
|
x_sphere
|
102. Post |
2011-04-05 21:59:07 |
User-ID: 181
Function: Author
Group: Default
Posts: 13
|
@skippycue
From looking in the firmware files there are more functions you can send to the trophy server to return data, I just haven't figured out how to use them. I've got all the ones that the PS3 uses by sniffing through wireshark, but there are more.
|
|
|
skippycue
|
103. Post |
2011-04-05 22:36:09 |
User-ID: 165
Function: Author
Group: Default
Posts: 21
|
Oh really? These functions are not sent via http requests then because I've exhausted packet sniffing those. I have to admit that I haven't messed around with ps3 firmware files simply because I don't want to draw attention to myself from sony any more than I already am, lol. Feel free to PM me, maybe we can figure it out together.
|
|
|
fabriciols
|
104. Post |
2011-04-07 18:38:46 |
User-ID: 155
Function: Author
Group: Default
Posts: 8
|
anyone with problem to get the games from the user profile on the sony site? (http://profiles.us.playstation.com/playstation/psn/profile/fabriciols/get_ordered_trophies_data)
since yesterday I can't ... tested with several servers and none have been able to access.
-- http://www.myps3t.com.br
|
|
|
TonicDSH
|
105. Post |
2011-04-07 23:20:17 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
Some IP's were denied by the server as I was fooling around and ours returned 403 or a moved error. Other's are completely blacklisted by Sony. Their network has been suffering DDoS attacks for the past week.
|
|
|
TonicDSH
|
106. Post |
2011-04-07 23:25:29 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
If the server times out add a useragent
$agent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0";
$url = "http://us.playstation.com/playstation/psn/profiles/" . $psn;
// create curl resource
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec($ch);
curl_close ($ch);
|
|
|
KlotX
|
107. Post |
2011-04-08 12:06:21 |
User-ID: 82
Function: Author
Group: Default
Posts: 10
|
@skippycue:
I totally agree that we all should work together, but you know that when money is involved people tend to go blind and keep things for theirselves, and this acts as a snowball effect.
I'm totally willing to participate in any joint activity to work together on this and my only and main motivation is to learn, although I do have a "ranking/leaderboard" site, that is being used solely to learn and apply new knowledge. So count me in.
My first approach, would be to setup some place to share knowledge so that everyone would post anything they know, and we could move on from there. Maybe private, not to draw sony's attention, or public without reveling secret information like passwords and so one.
These are my 0.02 on this issue.
|
|
|
D_PyroUK
|
108. Post |
2011-05-15 23:15:34 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
Is anyone still working on this? I'd like to get trophy info directly from sony's server instead of relying on us.playstation which constantly gets changed.
Looking at skfu's old program this is how he gets the user info:
wget -O info.xml --user-agent='PS3Community-agent/1.0.0 libhttp/1.0.0' --header='Content-Length: (jid-length+111)' --header='Authorization: Digest' --http-user='c7y-basic01' --http-password='(passwordgoeshere)' --post-data="<?xml version='1.0' encoding='utf-8'?><profile platform='ps3' sv='3.60'><jid>user1@a1.us.np.playstation.net</jid><avatar size='l'/></profile>" http://getprof.us.np.community.playstation.net/basic_view/func/get_profile
The problem with this is it doesn't return trophy data:
<?xml version="1.0" encoding="utf-8"?><profile result="00"><onlinename>user1</onlinename><country>ca</country><language1>1</language1><language2/><language3/><aboutme/><avatarurl id="48">http://static-resource.np.community.playstation.net/avatar/WWS_J/J0001.png</avatarurl><ucbgp>000000000000ffff</ucbgp><ptlp>0</ptlp></profile>
I have the password if anyone's wondering. I also have a site that currently relies on the server which the iOS app uses.
http://dpyro.heliohost.org/index.php?psnid=user1 (Yes, I borrowed some of the css code)
|
|
|
Ragowit
|
109. Post |
2011-05-17 13:51:55 |
User-ID: 185
Function: Author
Group: Default
Posts: 10
|
Looks good D_PyroUK, feels slow though, but it's maybe Sonys servers that are being hammered right now since PSN just got back?
Do you have (or working on) a solution that also can get trophy data?
-- Rank: The Game - http://rankthegame.net
|
|
|
D_PyroUK
|
110. Post |
2011-05-17 18:54:09 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
Ya, the problem with relying on the iOS app is the server is slow. This is why I want to get the xml directly from the PSN. The data from the iOS app can be retrieved using the following commands:
https://psxload.central-sq.com/api/S2S?sessionid=&method=GetUserProfile&ticket=&onlineid=user1
https://psxload.central-sq.com/api/S2S?sessionid=&method=GetTrophies&ticket=&onlineid=user1
|
|
|
Ragowit
|
111. Post |
2011-05-17 23:11:35 |
User-ID: 185
Function: Author
Group: Default
Posts: 10
|
Nice, one thing missing from the GetTrophies are individual images for each trophy. But otherwise the information available looks good!
-- Rank: The Game - http://rankthegame.net
|
|
|
D_PyroUK
|
112. Post |
2011-05-18 07:02:16 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
This appears to work even better: http://www.psnapi.com.ar/ps3/api/psn.asmx/getPSNID?sPSNID=user1
There are other commands you can use to get trophy data, last trophy acquired etc. too.
|
|
|
Ragowit
|
113. Post |
2011-05-20 08:36:21 |
User-ID: 185
Function: Author
Group: Default
Posts: 10
|
That looks nice. http://www.psnapi.com.ar/ps3/api/psn.asmx/getTrophies?sPSNID=Ragowit&sGameId=NPWR01719_00
If we could get that kind of stuff into a PHP environment I would be most happy.
-- Rank: The Game - http://rankthegame.net
|
|
|
D_PyroUK
|
114. Post |
2011-05-20 08:49:40 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
http://isthepsndown.tk/test/trophies.php?psnid=User1
|
|
|
Ragowit
|
115. Post |
2011-05-20 10:34:05 |
User-ID: 185
Function: Author
Group: Default
Posts: 10
|
Nice, but I meant more like an opensource so I could download the source code and run on my own server, so I could request the XML-feeds from my own server instead of someone else server. :)
-- Rank: The Game - http://rankthegame.net
|
|
|
D_PyroUK
|
116. Post |
2011-05-20 16:28:40 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
That's what I'm trying to do. I can already get jid and profile info from http://searchjid.usa.np.community.playstation.net/basic_view/func/search_jid and http://getprof.us.np.community.playstation.net/basic_view/func/get_profile but I don't have the right info to access htp://trophy.ww.np.community.playstation.net/trophy/func/get_user_info
|
|
|
x_sphere
|
117. Post |
2011-05-20 21:06:09 |
User-ID: 181
Function: Author
Group: Default
Posts: 13
|
The trophy server doesn't return images, so it's not much use.
What would really be useful is figuring out how the PS3 calculates the hash in image URLs. And also, decrypting ESFM files...
|
|
|
D_PyroUK
|
118. Post |
2011-05-20 23:32:27 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
Um, what? I'm not looking to get images. It get's the friends list info:
<psn_friend>
<onlineid>user1</onlineid>
<quick_friend>false</quick_friend>
<current_presence>offline</current_presence>
<current_game>Last sign in 25 hours ago</current_game>
<current_avatar>/PSN_Images/avatar/WWS_J/J0001.png</current_avatar>
<comment>null</comment>
<trophy>
<level>1</level>
<platinum>0</platinum>
<gold>0</gold>
<silver>0</silver>
<bronze>12</bronze>
</trophy>
</psn_friend>
|
|
|
x_sphere
|
119. Post |
2011-05-21 03:48:58 |
User-ID: 181
Function: Author
Group: Default
Posts: 13
|
I was replying to Ragowit's post
"Nice, one thing missing from the GetTrophies are individual images for each trophy. But otherwise the information available looks good!"
The trophy.ww.np server does not return individual images or detailed trophy information. All it sends is the trophy id and type.
|
|
|
Ragowit
|
120. Post |
2011-05-21 10:20:54 |
User-ID: 185
Function: Author
Group: Default
Posts: 10
|
x_sphere: http://www.psnapi.com.ar/ps3/api/psn.asmx/getTrophies?sPSNID=Ragowit&sGameId=NPWR01719_00 does return images for each trophy. So one server must at least return those images.
-- Rank: The Game - http://rankthegame.net
|
|
|
x_sphere
|
121. Post |
2011-05-21 22:13:24 |
User-ID: 181
Function: Author
Group: Default
Posts: 13
|
Well, no idea what source that site is using (possibly a mix to US/EU data?), but it's incomplete.
Look at this -
http://www.psnapi.com.ar/ps3/api/psn.asmx/getTrophies?sPSNID=AkuDora&sGameId=NPWR01400_00
Returns an error, even though the nick and NPWR id is valid (http://trophy01.np.community.playstation.net/trophy/np/NPWR01400_00_70996CAA67CAB7329BC828AC1C0B0B52A08FD384/D0AE2EA94B98DBCB884E0622443C51D559EF8E9A.PNG). The PS3 itself doesn't get the image URLs from any server, it calculates the hash for the ESFM file based on a certain set of criteria. My guess is it takes the NPWR ID + a random salt to generate the hashes. From there, it decrypts the ESFM and requests individual trophy images.
It's totally possible to figure out if you are good at reverse engineering... as all the PS3 modules can be decrypted now.
|
|
|
DoSe420
|
122. Post |
2011-05-22 05:03:45 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
psnapi.com.ar uses the trophy server to get the ids and all the trophy info, but it also has a iphone app that users login to the EU site and can see their trophies. With the iphone app he fills in the trophy info by scraping the EU site
|
|
|
D_PyroUK
|
123. Post |
2011-05-22 05:56:07 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
Looks like the source code here: http://psnapi.codeplex.com/ may be based on that website.
|
|
|
gameSWAGG
|
124. Post |
2011-05-23 00:58:21 |
User-ID: 188
Function: Author
Group: Default
Posts: 1
|
I wanted to pass some information on..
For http://www.psnapi.com.ar/ps3/api/psn.asmx the trophy data for games (names, images, and descriptions) are gathered manually and entered into his DB.
|
|
|
DoSe420
|
125. Post |
2011-05-23 01:55:51 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
The trophy info isnt manually entered on psnapi.com.ar. The guy has a Iphone app which has its users login to the EU playstation site to verify, he then gets the trophy info from them users and matches it to the game using the NPCOMMID which is found in the image urls. This is the same method that ps3trophies.com uses
|
|
|
KlotX
|
126. Post |
2011-05-26 11:20:22 |
User-ID: 82
Function: Author
Group: Default
Posts: 10
|
x_sphere:
I believe that the image URLs hash are calculated based on the Sce-Np-Trophy-Signature that comes within the TROP.SFM file in TROPHY.TRP package. Of course that trophy Id and NPWR id might be present on that hash, but there are no evidence on how that hash is constructed, we can only guess that this is a SHA-1 of something..
I have no idea on how/what to look for in decrypted sprx files, so I'm kind of stuck in my research. Nevertheless, based on the above "belief", it won't be possible to calculate the image urls for unreleased games, since you need to get your hands on the TROPHY.TRP file.
|
|
|
x_sphere
|
127. Post |
2011-05-27 03:43:48 |
User-ID: 181
Function: Author
Group: Default
Posts: 13
|
@KlotX
Yes that would be logical however I've noticed the PS3 can still download images / basic info for games you've never played when viewing via compare trophies. In this case there's no TROPHY.TRP file to rely on.
When this happens, the PS3 makes a request to an ESFM file, encrypted ver of TROP.SFM. At this point there's still no Sce-Np-Trophy-Signature until the file is downloaded, yet the URL is hashed.
My guess is the Sce-Np-Trophy-Signature is just a unique signature to ensure the trophy set is valid - maybe it's checked while syncing trophies. The URL hash is based on a different set of params, who knows what.
|
|
|
D_PyroUK
|
128. Post |
2011-05-28 03:34:05 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
http://sonycoment-3.vo.llnwd.net/trophy/np/NPWR00117_00/TROP.SFM
http://sonycoment-3.vo.llnwd.net/trophy/np/NPWR00117_00/TROPCONF.SFM
http://sonycoment-3.vo.llnwd.net/trophy/np/NPWR00117_00/TROP_00.SFM
http://sonycoment-3.vo.llnwd.net/trophy/np/NPWR00117_00/TROP_02.SFM
http://sonycoment-3.vo.llnwd.net/trophy/np/NPWR00117_00/TROP_03.SFM
http://sonycoment-3.vo.llnwd.net/trophy/np/NPWR00117_00/TROP_04.SFM
etc...TROP_16.SFM
http://sonycoment-3.vo.llnwd.net/trophy/np/NPWR00117_00/ICON0.PNG
http://sonycoment-3.vo.llnwd.net/trophy/np/NPWR00117_00/TROP000.PNG
http://sonycoment-3.vo.llnwd.net/trophy/np/NPWR00117_00/TROP001.PNG
http://sonycoment-3.vo.llnwd.net/trophy/np/NPWR00117_00/TROP002.PNG
etc...TROP016.PNG
Oh, and I've managed to code something up that gets the jid, user info and trophy info as if you were on a PS3.
Still haven't figured out the SHA-1 thing though...
|
|
|
x_sphere
|
129. Post |
2011-05-28 04:53:50 |
User-ID: 181
Function: Author
Group: Default
Posts: 13
|
@D_PyroUK
Well, that's Sony's old CDN :P They changed it awhile back, like 2 years ago. The old files are still there but nothing for new games.
http://trophy01.np.community.pla ystation.net/trophy/np/NPWR01398_00_25A400EDAC0D4698C239511648F75166AC67F774/66301192DC67A2FCCA5D04D38258298284592652.ESFM
are the new URLs.
|
|
|
D_PyroUK
|
130. Post |
2011-05-28 05:36:11 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
Ok, I found the signature check. You are right.Doesn't seem like the hash is calculated with the signature then:
Checking the Digital Signature
It is possible to check if the trophy pack file has a digital signature correctly appended by setting "Release
Check Mode" to "Release Mode" in the Debug Settings column of the Reference Tool or Debugging Station
system software. When "Release Check Mode" is set to "Release Mode", a trophy pack file that is not
correctly signed will cause an error (SCE_NP_TROPHY_ERROR_VERIFICATION_FAILURE) when an NP
trophy utility API is called. This method can be used to see if there are any unsigned trophy pack files.
During development, set "Release Check Mode" to "Development Mode", in which trophy pack files are
not checked for signatures. Trophy pack files without signatures can be used in this mode during the
development process.
|
|
|
TonicDSH
|
131. Post |
2011-05-28 05:56:01 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
@D_PyroUK
Set something up? Like this :rolleyes:
<?php
function psnjid($psn, $url)
{
preg_match_all('/searchjid.(.*?).np./', $url, $co);
$co = $co['1']['0'];
$co = str_replace("usa", "us", $co);
$co = str_replace("eu", "gb", $co);
$co = str_replace("jpn", "jp", $co);
$ch = curl_init();
$agent = "PS3Community-agent/1.0.0 libhttp/1.0.0";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER,array('Accept-Encoding: identity', 'Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_USERPWD, 'username:password');
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_POSTFIELDS, "<?xml version='1.0' encoding='utf-8'?><searchjid platform='ps3' sv='2.76'><online-id>" . $psn . "</online-id></searchjid>");
$html = curl_exec($ch);
curl_close($ch);
preg_match_all('/<searchjid result=\"(.*?)\"\/>/', $html, $match);
$result = (!empty($match['1']['0'])) ? $match['1']['0'] : "";
if(!$result == "1B")
{
preg_match_all('/<jid>(.*?)<\/jid>/s', $html, $psnid);
$psnid = $psnid['1']['0'];
$data = array("psn" => $psnid, "co" => $co);
return $data;
}
else {
return false;
}
}
function getpsndata($psn)
{
$urls = array('http://searchjid.usa.np.community.playstation.net/basic_view/func/search_jid',
'http://searchjid.eu.np.community.playstation.net/basic_view/func/search_jid',
'http://searchjid.jpn.np.community.playstation.net/basic_view/func/search_jid');
foreach ($urls as $key=>$data)
{
if(!psnjid($psn, $urls[$key]) == false)
{
$psnData = psnjid($psn, $urls[$key]);
break;
}
}
$url = "http://getprof." . $psnData['co'] . ".np.community.playstation.net/basic_view/func/get_profile";
$ch = curl_init();
$agent = "PS3Community-agent/1.0.0 libhttp/1.0.0";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//curl_setopt($ch, CURLOPT_HEADER, true);
// curl_setopt($ch, CURLOPT_HTTPHEADER,array('Accept-Encoding: identity', 'Connection: Keep-Alive'));
curl_setopt($ch, CURLOPT_USERPWD, 'username:password');
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_POSTFIELDS, "<profile platform='ps3' sv='2.35'><jid>" . $psnData['psn'] . "</jid></profile>");
$html = curl_exec($ch);
//Fetch specific final details
preg_match_all('/<country>(.*?)<\/country>/', $html, $country);
preg_match_all('/<aboutme>(.*?)<\/aboutme>/', $html, $aboutme);
preg_match_all('/<plusicon>(.*)<\/plusicon>/', $html, $psplus);
preg_match_all('/<avatarurl id="(.*?)">(.*?)<\/avatarurl>/', $html, $avatar);
//Load them up
$psnpersona['country'] = (!empty($country['1']['0'])) ? $country['1']['0'] : "";
$psnpersona['aboutme'] = (!empty($aboutme['1']['0'])) ? $aboutme['1']['0'] : "";
$psnpersona['psplus'] = (!empty($psplus['1']['0'])) ? $psplus['1']['0'] : "";
$psnpersona['avatar'] = (!empty($avatar['2']['0'])) ? $avatar['2']['0'] : "";
if(empty($psnpersona['psplus']))
{
$psnpersona['psplus'] = "0";
}
if(empty($psnpersona['aboutme']))
{
$psnpersona['aboutme'] = "";
}
return $psnpersona;
}
?>
Naturally I removed the password for the profile portal
|
|
|
D_PyroUK
|
132. Post |
2011-05-28 06:04:14 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
That's actually pretty close to what I used, except the HTTP header is different (Content-Length). I also did a foreach (array($usUrl,$euUrl,$jpUrl) as $url) {
I also used xml functions to get the data instead of preg_match.
|
|
|
TonicDSH
|
133. Post |
2011-05-28 06:18:22 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
Yeah, that's something I wrote long ago, the code that's used now for the website I worked on is different, little bit more cleaner, etc.
|
|
|
D_PyroUK
|
134. Post |
2011-05-28 06:20:43 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
One thing I noticed is yours doesn't get the trophy info..At least not in that code.
|
|
|
TonicDSH
|
135. Post |
2011-05-28 06:25:36 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
It's not my business to post that coding, i'm going to just leave that situation the way it is and let people figure that out on their own just like I had to do.
|
|
|
D_PyroUK
|
136. Post |
2011-05-28 06:27:27 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
That's fine. I had to figure everything out on my own too. :)
http://isthepsndown.tk/getinfo.php?psnid=User3
(I was also trying to figure out the right way to query the psn server to see if it's online or not - still not sure the correct server is used).
|
|
|
DoSe420
|
137. Post |
2011-05-28 06:34:41 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
This was my latest rewrite for the jid and getprof.
public function get_jid($psn)
{
if(!empty($psn))
{
$urls = array( 'us' => 'http://searchjid.usa.np.community.playstation.net/basic_view/func/search_jid',
'gb' => 'http://searchjid.eu.np.community.playstation.net/basic_view/func/search_jid',
'jp' => 'http://searchjid.jpn.np.community.playstation.net/basic_view/func/search_jid'
);
$ch = curl_init();
foreach($urls AS $key => $value)
{
curl_setopt($ch, CURLOPT_USERAGENT, "PS3Community-agent/1.0.0 libhttp/1.0.0");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=UTF-8'));
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $value);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($ch, CURLOPT_USERPWD, self::BasicLogin);
curl_setopt($ch, CURLOPT_POSTFIELDS, "<?xml version='1.0' encoding='utf-8'?><searchjid platform='ps3' sv='" . self::FirmWare . "'><online-id>" . $psn . "</online-id></searchjid>");
$data = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if((!empty($data)) && ($code == '200'))
{
$xml = new SimpleXMLElement($data);
if(!empty($xml->jid))
{
curl_close($ch);
return (object) array('jid' => (string)$xml->jid, 'region' => (string)$key);
break;
}
}
}
}
return false;
}
public function get_prof($region, $jid)
{
if((isset($region)) && (!empty($region)) && ((isset($jid)) && (!empty($jid))))
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, "PS3Community-agent/1.0.0 libhttp/1.0.0");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=UTF-8'));
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "http://getprof." . $region . ".np.community.playstation.net/basic_view/func/get_profile");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($ch, CURLOPT_USERPWD, self::BasicLogin);
curl_setopt($ch, CURLOPT_POSTFIELDS, "<profile platform='ps3' sv='" . self::FirmWare . "'><jid>" . $jid . "</jid></profile>");
$data = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if((!empty($data)) && ($code == '200'))
{
$xml = new SimpleXMLElement($data);
if(!empty($xml))
{
$data = new stdClass();
$data->name = (isset($xml->onlinename)) ? (string)$xml->onlinename : false;
$data->country = (isset($xml->country)) ? (string)$xml->country : false;
$data->aboutme = (isset($xml->aboutme)) ? (string)$xml->aboutme : false;
$data->avatar = (isset($xml->avatarurl)) ? (string)$xml->avatarurl : false;
$data->color = (isset($xml->ucbgp)) ? (string)substr($xml->ucbgp, -8) : false;
$data->psnplus = (isset($xml->plusicon)) ? (int)$xml->plusicon : 0;
curl_close($ch);
return (object)$data;
}
}
return false;
}
return false;
}
http://mystattracker.net/dose/im2.php?psn=dose420
Was tryin my first class lol
|
|
|
D_PyroUK
|
138. Post |
2011-05-28 06:39:35 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
Oh, how'd you get it to list the games? I got another code I could use for that. :)
|
|
|
D_PyroUK
|
139. Post |
2011-05-28 06:43:44 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
Oh wait, it's func/get_latest_trophies :)
|
|
|
DoSe420
|
140. Post |
2011-05-28 06:48:20 |
User-ID: 73
Function: Author
Group: Default
Posts: 59
|
get_latest_trophies i believe is what was called when you hit sync on the ps3.
BTW This is what you get when you query a game for trophies. (Posted for those who dont know)
Array
(
[0] => Array
(
[id] => 15
[type] => bronze
[trophydate] => 1305859057
)
[1] => Array
(
[id] => 16
[type] => bronze
[trophydate] => 1305864533
)
[2] => Array
(
[id] => 17
[type] => bronze
[trophydate] => 1306025621
)
[3] => Array
(
[id] => 18
[type] => bronze
[trophydate] => 1306281727
)
[4] => Array
(
[id] => 19
[type] => bronze
[trophydate] => 1306460599
)
[5] => Array
(
[id] => 20
[type] => bronze
[trophydate] => 1305855233
)
[6] => Array
(
[id] => 22
[type] => bronze
[trophydate] => 1306014441
)
[7] => Array
(
[id] => 24
[type] => bronze
[trophydate] => 1306459162
)
[8] => Array
(
[id] => 25
[type] => bronze
[trophydate] => 1306460637
)
[9] => Array
(
[id] => 26
[type] => silver
[trophydate] => 1306460630
)
[10] => Array
(
[id] => 27
[type] => silver
[trophydate] => 1306460624
)
[11] => Array
(
[id] => 29
[type] => bronze
[trophydate] => 1306026610
)
[12] => Array
(
[id] => 31
[type] => bronze
[trophydate] => 1305865621
)
[13] => Array
(
[id] => 32
[type] => bronze
[trophydate] => 1305865783
)
[14] => Array
(
[id] => 33
[type] => bronze
[trophydate] => 1305854999
)
[15] => Array
(
[id] => 36
[type] => bronze
[trophydate] => 1305859131
)
[16] => Array
(
[id] => 49
[type] => bronze
[trophydate] => 1305863104
)
)
|
|
|
TonicDSH
|
141. Post |
2011-05-28 07:12:42 |
User-ID: 168
Function: Author
Group: Default
Posts: 23
|
Actually dose the type is b,g,s,p remember....
|
|
|
D_PyroUK
|
142. Post |
2011-05-28 07:16:37 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
Ok, can you help me out in PM. need xml data to get trophies :)
|
|
|
skippycue
|
143. Post |
2011-06-04 14:54:31 |
User-ID: 165
Function: Author
Group: Default
Posts: 21
|
OK, since the cat seems to be coming out of the bag quickly I'll add my two cents. ;)
For the user profile information you'll need to use username = "c7y-basic01"
For the user trophy information you'll need to use username = "c7y-trophy01"
The passwords can be found in many places including a post in the following link (won't post them in here in case it's somehow illegal, lol):
http://www.ps3news.com/forums/ps3-hacks-jailbreak/psn-tool-2-0-ps3-now-available-skfu-iqd-115042.html
I've been using the ps3 data, eu data, us data, and psxload data all together to try to automate trophy statistics without any manual intervention required. The only real tough part is trying to determine if I have all the data for any given game since the ps3 data doesn't give a percent complete. The EU data and psxload data DO give percent complete information, but for EU you need to log in and for psxload, it only shows the last 64 games played. This could all be easily done with manual intervention, similar to what they did on ygc.com, but I'd like to be hands off when the site is published. I've done the manual thing and it's really annoying after a while.
At any rate, I'm kinda tired of working alone. My app used to be in ruby on rails, but I've since converted it to php for performance reasons. I'm looking for at least one partner to help out with this project. I'm not looking to train anyone in coding or web development so anyone with php and web design skills is welcome. I'm also looking for someone with CSS skills/graphic skills since I'm pretty unartistic, lol. We talked about working together to make a great site, so no is your chance. The current app is based only on the US site and is located at http://www.ps3trophyleaders.com Please let me know if you're interested... I have much more knowledge to share! :)
|
|
|
D_PyroUK
|
144. Post |
2011-06-06 21:03:06 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
Ya I already got that info by sniffing the network. The only problem is when getting trophy info for games it doesn't show the game name or image, which I guess is contained in the ESFM files. Someone needs to find out how they work and then we could easily get the images and game names/hashes.
|
|
|
skippycue
|
145. Post |
2011-06-06 21:22:45 |
User-ID: 165
Function: Author
Group: Default
Posts: 21
|
|
|
|
skippycue
|
146. Post |
2011-06-06 21:22:51 |
User-ID: 165
Function: Author
Group: Default
Posts: 21
|
Sorry for the blank post... lol, you should check for that! :) At any rate, you didn't get the passwords from sniffing the network, they are encrypted using digest authentication.
|
|
|
D_PyroUK
|
147. Post |
2011-06-06 21:42:51 |
User-ID: 184
Function: Author
Group: Default
Posts: 23
|
Ya I know, but I got everything else from wireshark. Still need the passwords for the rating/ranking servers though if anyone has them ;)
|
|
|
skippycue
|
148. Post |
2011-06-06 22:30:45 |
User-ID: 165
Function: Author
Group: Default
Posts: 21
|
Those are useless, it's just the rating system for games in the playstation store... not a psnid global rank or anything actually useful.
|
|
|
CoOpPartners
|
149. Post |
2011-07-29 18:35:18 |
User-ID: 199
Function: Author
Group: Default
Posts: 8
|
hi guys, I'm following in your foot steps here.
learned quite a bit so far, excited I might be able to power my website with trophy info.
|
|