Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Creator of http://t.me/doroved
- 1. Закидываем скрипт в папку преленда
- 2. Вставляем ссылки ниже в постбек компании в своей тдс
- --лиды--
- http://prelending.ru/it-chocolite/push_lead.php?type=lead&status={status}&campaign_name={keitaro_campaign_name}
- --отмена--
- http://prelending.ru/it-chocolite/push_lead.php?type=rejected&status={status}&campaign_name={keitaro_campaign_name}
- --продажа--
- http://prelending.ru/it-chocolite/push_lead.php?type=sale&status={status}&campaign_name={keitaro_campaign_name}&revenue={revenue}
- */
- //Передаем в переменных: статус лида, имя компании кеитаро, профит, тип
- $status = $_GET['status'];
- $campaign_name = $_GET['campaign_name'];
- $revenue = $_GET['revenue'];
- $type = $_GET['type'];
- //Урл api бота телеграмм
- $TGChatUrl="https://api.telegram.org/bot339938226:AAF1m5dPhOk22rWLuh0YxOQJuc48vb3l9gQ/sendMessage?chat_id=937628563";
- //Конвертируем валюту из рублей в баксы, что бы в пуше были доллары, а не рубли, т.к. в кеитаро мы конвертируем баксы в рубли
- function convertCurrency($amount, $from, $to){
- $url = "https://www.google.com/finance/converter?a=$amount&from=$from&to=$to";
- $data = file_get_contents($url);
- preg_match("/<span class=bld>(.*)<\/span>/",$data, $converted);
- $converted = preg_replace("/[^0-9.]/", "", $converted[1]);
- return round($converted, 3);
- }
- //echo round(convertCurrency($revenue, "RUB", "USD"));
- //Обработка типов запроса
- if($type == 'lead') {
- $sms = "👤 $campaign_name";
- $teleurl=$TGChatUrl."&text=".urlencode($sms);
- $ret=@file_get_contents($teleurl);
- }
- if($type == 'rejected') {
- $sms = "❌ $campaign_name";
- $teleurl=$TGChatUrl."&text=".urlencode($sms);
- $ret=@file_get_contents($teleurl);
- }
- if($type == 'sale') {
- $revenue = round(convertCurrency($revenue, "RUB", "USD"));
- $sms = "✅ $$revenue $campaign_name";
- $teleurl=$TGChatUrl."&text=".urlencode($sms);
- $ret=@file_get_contents($teleurl);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement