Advertisement
Guest User

Untitled

a guest
Apr 16th, 2018
942
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.18 KB | None | 0 0
  1. <?php
  2. /*
  3. Creator of http://t.me/doroved
  4. 1. Закидываем скрипт в папку преленда
  5. 2. Вставляем ссылки ниже в постбек компании в своей тдс
  6.  
  7. --лиды--
  8. http://prelending.ru/it-chocolite/push_lead.php?type=lead&status={status}&campaign_name={keitaro_campaign_name}
  9.  
  10. --отмена--
  11. http://prelending.ru/it-chocolite/push_lead.php?type=rejected&status={status}&campaign_name={keitaro_campaign_name}
  12.  
  13. --продажа--
  14. http://prelending.ru/it-chocolite/push_lead.php?type=sale&status={status}&campaign_name={keitaro_campaign_name}&revenue={revenue}
  15.  
  16. */
  17.  
  18. //Передаем в переменных: статус лида, имя компании кеитаро, профит, тип
  19. $status = $_GET['status'];
  20. $campaign_name = $_GET['campaign_name'];
  21. $revenue = $_GET['revenue'];
  22. $type = $_GET['type'];
  23.  
  24. //Урл api бота телеграмм
  25. $TGChatUrl="https://api.telegram.org/bot339938226:AAF1m5dPhOk22rWLuh0YxOQJuc48vb3l9gQ/sendMessage?chat_id=937628563";
  26.  
  27. //Конвертируем валюту из рублей в баксы, что бы в пуше были доллары, а не рубли, т.к. в кеитаро мы конвертируем баксы в рубли
  28. function convertCurrency($amount, $from, $to){
  29.     $url  = "https://www.google.com/finance/converter?a=$amount&from=$from&to=$to";
  30.     $data = file_get_contents($url);
  31.     preg_match("/<span class=bld>(.*)<\/span>/",$data, $converted);
  32.     $converted = preg_replace("/[^0-9.]/", "", $converted[1]);
  33.     return round($converted, 3);
  34. }
  35.  
  36. //echo round(convertCurrency($revenue, "RUB", "USD"));
  37.  
  38. //Обработка типов запроса
  39. if($type == 'lead') {
  40. $sms = "👤 $campaign_name";
  41. $teleurl=$TGChatUrl."&text=".urlencode($sms);
  42. $ret=@file_get_contents($teleurl);
  43. }
  44.  
  45.  
  46. if($type == 'rejected') {
  47. $sms = "❌ $campaign_name";
  48. $teleurl=$TGChatUrl."&text=".urlencode($sms);
  49. $ret=@file_get_contents($teleurl);
  50. }
  51.  
  52. if($type == 'sale') {
  53. $revenue = round(convertCurrency($revenue, "RUB", "USD"));
  54. $sms = "✅ $$revenue $campaign_name";
  55. $teleurl=$TGChatUrl."&text=".urlencode($sms);
  56. $ret=@file_get_contents($teleurl);
  57. }
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement