Advertisement
Guest User

PSN Update Finder 1.0

a guest
Oct 21st, 2010
2,152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.70 KB | None | 0 0
  1. <?php
  2. /*
  3.     PSN Update Finder 1.0
  4.     Finds PSN links to updates with the title id.
  5.     Based on Awesome Update Finder by NZHawk
  6.    
  7.     Copyright (C) 2010  Yifan Lu
  8.  
  9.     This program is free software: you can redistribute it and/or modify
  10.     it under the terms of the GNU General Public License as published by
  11.     the Free Software Foundation, either version 3 of the License, or
  12.     (at your option) any later version.
  13.  
  14.     This program is distributed in the hope that it will be useful,
  15.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.     GNU General Public License for more details.
  18.  
  19.     You should have received a copy of the GNU General Public License
  20.     along with this program.  If not, see <http://www.gnu.org/licenses/>.
  21. */
  22.  
  23. define('URL' , 'http://localhost/psn_update_finder.php'); // For the "Back" link
  24.  
  25. echo '
  26. <html>
  27. <head>
  28. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  29. <meta name="description" content="Find PS3 game updates instantly." />
  30. <meta name="keywords" content="ps3,psn,update,jailbreak,game,games,updates,playstation,sony,backups,backup" />
  31. <meta name="author" content="Yifan Lu" />
  32. <title>PSN Update Finder</title>
  33. <style type="text/css">
  34. table.content {
  35.     border-width: 1px;
  36.     border-spacing: ;
  37.     border-style: outset;
  38.     border-color: gray;
  39.     border-collapse: separate;
  40.     background-color: white;
  41. }
  42. table.content th {
  43.     border-width: 1px;
  44.     padding: 1px;
  45.     border-style: inset;
  46.     border-color: gray;
  47.     background-color: white;
  48.     -moz-border-radius: ;
  49. }
  50. table.content td {
  51.     border-width: 1px;
  52.     padding: 1px;
  53.     border-style: inset;
  54.     border-color: gray;
  55.     background-color: white;
  56.     -moz-border-radius: ;
  57. }
  58. </style>
  59. </head>
  60. <body>
  61. <h1>PSN Update Finder</h1>
  62. <hr>
  63. ';
  64.  
  65. $titleid = $_GET['titleid'];
  66. $env = $_GET['env'];
  67. if(!empty($titleid)){
  68.     $url = "https://a0.ww." . urlencode($env) . ".dl.playstation.net/tpl/" . urlencode($env) . "/" . $titleid . "/" . $titleid . "-ver.xml";
  69.     try{
  70.         $xml = @new SimpleXMLElement($url, LIBXML_COMPACT, TRUE);
  71.     }catch(Exception $ex){
  72.         die("Invalid title id!");
  73.     }
  74.     echo '<table class="content"><tbody><tr><th>Version</th><th>URL</th><th>Size</th><th>Checksum (SHA1)</th><th>PS3 Min Version</th></tr>';
  75.     foreach ($xml->tag->package as $package){
  76.         echo '<tr>' .
  77.         '<td><strong>' . $package['version'] . '</strong></td>' .
  78.         '<td><a href="' . $package['url'] . '">' . $package['url'] . '</a></td>' .
  79.         '<td>' . $package['size'] . '</td>' .
  80.         '<td>' . $package['sha1sum'] . '</td>' .
  81.         '<td>' . $package['ps3_system_ver'] . '</td>' .
  82.         '</tr>';
  83.         if(!empty($package->paramsfo)){
  84.             $title = htmlentities($package->paramsfo->TITLE);
  85.             $latest = htmlentities($package->paramsfo->TITLE_01);
  86.         }
  87.     }
  88.     echo '</tbody></table><br />';
  89.     echo '<p><strong>Game:</strong>&nbsp;' . $title . '<br /><strong>Latest Version:</strong>&nbsp;' . $latest . '<br /><a href="'. URL .'">&laquo; Back</a></p>';
  90. }else{
  91.     echo '
  92.     <p>Based on/ripped off of <a href="http://nzhawk.mezoka.com/awesomeuf/">NZHawk\'s Awesome Update Finder</a>, just type in the title id (If you don\'t know, it\'s the name of the ripped game\'s folder).</p>
  93.     <form method="GET">
  94.     <label for="titleid">Title ID:<label/>&nbsp;<input type="text" name="titleid" id="titleid" /><br />
  95.     <label for="env">Environment:</label>&nbsp;<select id="env" name="env"><option value="na" selected="true">na (Retail)</option><option value="prod-qa">prod-qa (Debugish)</option><option value="sp-int">sp-int (Debug)</option></select><br />
  96.     <input type="submit" value="Find Updates" />
  97.     </form>
  98.     ';
  99. }
  100. echo '<hr>
  101. <em>Coded by <a href="http://www.yifanlu.com/">Yifan Lu</a></em><br />
  102. </body></html>';
  103. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement