fork download
  1. <?php
  2.  
  3. $url = "https://w...content-available-to-author-only...a.com/coinorder/api/v4/inventory-results?query=%7B%22query%22%3A%7B%22model%22%3A%22my%22%2C%22condition%22%3A%22new%22%2C%22options%22%3A%7B%7D%2C%22arrangeby%22%3A%22Price%22%2C%22order%22%3A%22asc%22%2C%22market%22%3A%22TR%22%2C%22language%22%3A%22tr%22%2C%22super_region%22%3A%22north%20america%22%2C%22lng%22%3A%22%22%2C%22lat%22%3A%22%22%2C%22zip%22%3A%22%22%2C%22range%22%3A0%7D%2C%22offset%22%3A0%2C%22count%22%3A24%2C%22outsideOffset%22%3A0%2C%22outsideSearch%22%3Afalse%2C%22isFalconDeliverySelectionEnabled%22%3Atrue%2C%22version%22%3A%22v2%22%7D";
  4.  
  5. // $urlABD = "https://w...content-available-to-author-only...a.com/inventory/api/v4/inventory-results?query=%7B%22query%22%3A%7B%22model%22%3A%22my%22%2C%22condition%22%3A%22new%22%2C%22options%22%3A%7B%7D%2C%22arrangeby%22%3A%22Savings%22%2C%22order%22%3A%22asc%22%2C%22market%22%3A%22US%22%2C%22language%22%3A%22en%22%2C%22super_region%22%3A%22north%20america%22%2C%22PaymentType%22%3A%22cash%22%2C%22paymentRange%22%3A70000%7D%2C%22offset%22%3A0%2C%22count%22%3A24%2C%22outsideOffset%22%3A0%2C%22outsideSearch%22%3Afalse%2C%22isFalconDeliverySelectionEnabled%22%3Atrue%2C%22version%22%3A%22v2%22%7D";
  6.  
  7. $headers = [
  8. 'Pragma: no-cache',
  9. 'Accept: */*',
  10. 'Sec-Fetch-Site: same-origin',
  11. 'Accept-Language: en-US,en;q=0.9',
  12. 'Accept-Encoding: gzip, deflate, br',
  13. 'Sec-Fetch-Mode: cors',
  14. 'Cache-Control: no-cache',
  15. 'Host: www.tesla.com',
  16. 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Safari/605.1.15',
  17. 'Referer: https://w...content-available-to-author-only...a.com/tr_TR/inventory/new/my?arrangeby=plh&zip=&range=0',
  18. 'Connection: keep-alive',
  19. 'Cookie: YOUR_COOKIE_INFO'
  20. ];
  21.  
  22. // cURL başlat
  23. $ch = curl_init($url);
  24.  
  25. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  26. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  27. curl_setopt($ch, CURLOPT_ENCODING, ''); // --compressed karşılığı
  28.  
  29. $response = curl_exec($ch);
  30.  
  31. if (curl_errno($ch)) {
  32. echo 'cURL Hatası: ' . curl_error($ch);
  33. }
  34.  
  35.  
  36. $data = json_decode($response, true);
  37. // var_dump($data);
  38.  
  39. if ($data['total_matches_found'] > 0) {
  40. foreach ($data['results'] as $car) {
  41. $price = escapeMarkdownV2('$' . $car['PurchasePrice']);
  42. $priceNew = escapeMarkdownV2('₺' . number_format($car['InventoryPrice'], 0, ',', '.')); // TRY için ₺ ve formatlama
  43.  
  44. $interior = escapeMarkdownV2($car['INTERIOR'][0]);
  45. $paint = escapeMarkdownV2($car['PAINT'][0]);
  46. $vin = escapeMarkdownV2($car['VIN']);
  47. $vinRaw = $car['VIN']; // link için escape'siz
  48.  
  49. $link = "https://w...content-available-to-author-only...a.com/tr_TR/my/order/{$vinRaw}?titleStatus=new&redirect=no#overview";
  50.  
  51. $msg = "*🚗 Tesla Bulundu*\n"
  52. . "*💰 Fiyat:* $priceNew\n"
  53. . "*🎨 Renk:* $paint\n"
  54. . "*🪑 İç Döşeme:* $interior\n"
  55. . "*🔑 VIN:* `$vin`";
  56.  
  57. sendTelegramMsgWithButton($msg, "🔗 Sipariş Linkini Aç", $link);
  58. }
  59. } else {
  60. echo 'araç yok';
  61.  
  62. }
  63.  
  64. function escapeMarkdownV2($text) {
  65. $special_chars = ['_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!'];
  66. foreach ($special_chars as $char) {
  67. $text = str_replace($char, '\\' . $char, $text);
  68. }
  69. return $text;
  70. }
  71.  
  72. function sendTelegramMsg($msg) {
  73. $chatId = "YOUR_TELEGRAM_CHAT_ID";
  74. $token = "YOUR_TELEGRAM_TOKEN";
  75.  
  76. $url = "https://a...content-available-to-author-only...m.org/bot$token/sendMessage";
  77.  
  78. $data = [
  79. 'chat_id' => $chatId,
  80. 'text' => $msg
  81. ];
  82.  
  83. file_get_contents($url . '?' . http_build_query($data));
  84. }
  85.  
  86. function sendTelegramMsgWithButton($msg, $buttonText, $buttonUrl) {
  87. $chatId = "YOUR_TELEGRAM_CHAT_ID";
  88. $token = "YOUR_TELEGRAM_TOKEN";
  89. $url = "https://a...content-available-to-author-only...m.org/bot$token/sendMessage";
  90.  
  91. $data = [
  92. 'chat_id' => $chatId,
  93. 'text' => $msg,
  94. 'parse_mode' => 'MarkdownV2',
  95. 'reply_markup' => json_encode([
  96. 'inline_keyboard' => [
  97. [
  98. ['text' => $buttonText, 'url' => $buttonUrl]
  99. ]
  100. ]
  101. ])
  102. ];
  103.  
  104. $options = [
  105. CURLOPT_URL => $url,
  106. CURLOPT_RETURNTRANSFER => true,
  107. CURLOPT_POST => true,
  108. CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
  109. CURLOPT_POSTFIELDS => json_encode($data),
  110. ];
  111.  
  112. $ch = curl_init();
  113. curl_setopt_array($ch, $options);
  114. curl_exec($ch);
  115. curl_close($ch);
  116. }
Success #stdin #stdout 0.04s 26260KB
stdin
Standard input is empty
stdout
cURL Hatası: Could not resolve host: www.tesla.com