Advertisement
Guest User

a

a guest
Dec 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <?php
  2. // Copyright © 2019 by Ali Deym <ali.deym.gm@gmail.com>
  3.  
  4. // Disallow direct api calls.
  5. defined("APICALL") || die("Invalid direct request.");
  6.  
  7. global $db_connection;
  8.  
  9. // Check for steamid parameter.
  10. if (!isset($_POST["steamid"])) {
  11. die (json_encode(array(
  12. "status" => "argumentfail",
  13. "response" => "Arguments invalid."
  14. )
  15. ));
  16. }
  17.  
  18. $steamid = $_POST["steamid"];
  19.  
  20. $contents = file_get_contents("https://steamcommunity.com/profiles/$steamid/?xml=1");
  21.  
  22. $contents = str_replace("<br/>", ": ", $contents);
  23.  
  24.  
  25.  
  26. echo json_encode(array(
  27. "status" => "success",
  28. "response" => $contents
  29. )
  30. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement