scriptz-team

[PHP] Bit.ly [APi] Mass Url Generator

Jun 18th, 2012
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. <?php
  2. /*
  3. _____ _____ _ _____ _____ _____ _____ _____ _____
  4. ___| | __ |_| _ |_ _|___ ___|_ _| __| _ | |
  5. |_ -| --| -| | __| | | |- _|___| | | | __| | | | |
  6. |___|_____|__|__|_|__| |_| |___| |_| |_____|__|__|_|_|_|
  7. |s C R i P T z - T E A M . i N F O|
  8.  
  9. [PHP] Bit.ly [APi] Mass Url Generator
  10.  
  11. iNFO:
  12. BiT.LY WONT ALLOW GENERATiON OF SHORT URL OF THE SAME URL, SO WE
  13. CODED THiS TO BYPASS THEiR CHECK, NOW WHEN YOU ENTER URL VALUE LiKE
  14. http://scriptz-team.info/ iTS BECOME http://bit.ly/MkxSz9 AND AFTER
  15. REDiRECT iT LOOKS LiKE
  16. http://scriptz-team.info/#8149719#5680541#2008972#7901611#4418029#4551391#2056579#3715820#6291809#4418334
  17. iNTO EVERY NEW GENERATED SHORT URL iS ADDED RANDOM NUMBERS LiKE #8149719 AND ETC...
  18.  
  19. Usage:
  20. DEFiNE "BiTLY_APi_USER" AND "BiTLY_APi_KEY"
  21. */
  22. set_time_limit(0);
  23.  
  24. define("BiTLY_APi_USER", "");
  25. define("BiTLY_APi_KEY", "");
  26.  
  27. function bit_ly_url($url){
  28. $format = 'xml';
  29. $version = '2.0.1';
  30. $bitly = 'http://api.bit.ly/shorten?version='.$version.'&longUrl='.urlencode($url).'&login='.BiTLY_APi_USER.'&apiKey='.BiTLY_APi_KEY.'&format='.$format;
  31. $response = file_get_contents($bitly);
  32. if(strtolower($format) == 'json'){
  33. $json = @json_decode($response,true);
  34. return $json['results'][$url]['shortUrl'];
  35. }else{
  36. $xml = simplexml_load_string($response);
  37. return 'http://bit.ly/'.$xml->results->nodeKeyVal->hash;
  38. }
  39. }
  40. ?>
  41. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  42. <html xmlns="http://www.w3.org/1999/xhtml">
  43. <head>
  44. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  45. <title>Bit.ly [APi] Mass Url Generator</title>
  46. <style type="text/css">
  47. html {
  48. background: #f1f1f1;
  49. }
  50. body {
  51. background: #fff;
  52. margin: 22px auto;
  53. width: 764px;
  54. padding: 22px;
  55. text-align: center;
  56. font-family: Georgia, "Times New Roman", Times, serif;
  57. color: #464646;
  58. }
  59. h2 {
  60. font-size: 3em;
  61. font-weight: normal;
  62. }
  63. </style>
  64. </head>
  65.  
  66. <body>
  67.  
  68. <h2>Bit.ly [APi] Mass Url Generator</h2>
  69. <?php
  70. if (isset($_POST['doit'])&&($_POST['doit']==1)){
  71. $tocreate = $_POST['tocreate'];
  72. $url = $_POST['url'];
  73. echo "<textarea cols='30' rows='15'>";
  74. for ($i=0;$i<$tocreate;$i++){
  75. $url = $url."#".rand(0,9999999);
  76. $link = bit_ly_url($url);
  77. echo $link."\r\n";
  78. }
  79. echo "</textarea><br /><br />";
  80. echo "<a href=''>Create More Links</a>";
  81. exit;
  82. }
  83. echo "<form action='' method='post'><input type='hidden' name='doit' value='1' />";
  84. echo "URL: <input type='text' name='url' size='50' value='' /><br /><br />";
  85. echo "Create X Bit.ly: <input type='text' size='1' name='tocreate' value='10' /><br /><br />";
  86. echo "<input type='submit' value='Create Links' />";
  87. echo "</form><br /><br />";
  88. ?>
  89. </body>
  90. </html>
Add Comment
Please, Sign In to add comment