scriptz-team

[PHP] ENVATO MARKETPLACES APi iTEM DOWNLOADER

Jun 5th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. <?php
  2. /* _____ _____ _ _____ _____ _____ _____ _____ _____
  3. ___| | __ |_| _ |_ _|___ ___|_ _| __| _ | |
  4. |_ -| --| -| | __| | | |- _|___| | | | __| | | | |
  5. |___|_____|__|__|_|__| |_| |___| |_| |_____|__|__|_|_|_|
  6. |s C R i P T z - T E A M . i N F O|----------------------------
  7.  
  8. [PHP] ENVATO MARKETPLACES APi iTEM DOWNLOADER
  9.  
  10. */
  11. if (isset($_GET['username']) && $_GET['username'] != "") {
  12. $url = "http://marketplace.envato.com/api/v3/" . $_GET['username'] . '/' . $_GET['api-key'] . '/download-purchase:' . $_GET['licence_code'] . '.json';
  13. $url = htmlspecialchars($url);
  14.  
  15. $ch = curl_init($url);
  16. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  17. curl_setopt($ch, CURLOPT_HEADER, false);
  18. $data = curl_exec($ch);
  19. $json = json_decode($data, true);
  20. if (isset($json['download-purchase'])) {
  21. if (isset($json['download-purchase']['download_url'])) {
  22. $url = $json['download-purchase']['download_url'];
  23. ?>
  24. [Downloading]
  25. <script>window.location.href="<?php
  26. echo $url;
  27. ?>";</script>
  28. <?php
  29. exit;
  30. }
  31. }
  32. echo "Failed. API or Licence code incorrect";
  33. }
  34. ?>
  35. <form action="" method="GET">
  36. USERNAME: <input type="text" name="username"> <br /><br />
  37. API-KEY: <input type="text" name="api-key"> <br /><br />
  38. LiCENCE CODE: <input type="text" name="licence_code"> <br /><br />
  39. <input type="submit" value="DOWNLOAD">
  40. </form>
Add Comment
Please, Sign In to add comment