Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $path = "https://api.telegram.org/bot1301203321:AAEzskxJAxAtL5FfJEGrLJg4nzQjE1L6hDI";
- $update = json_decode(file_get_contents("php://input"), TRUE);
- $chatId = $update["message"]["chat"]["id"];
- $message = $update["message"]["text"];
- if (strpos($message, "/value") === 0) {
- $value = explode(' ', $message);
- $url = 'http://simastupen.com/api/apisimas.php?key=inet&value='.$value;
- $curl = curl_init();
- curl_setopt_array($curl, array(
- CURLOPT_URL => $url,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => "",
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 60,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => "GET",
- // CURLOPT_POSTFIELDS => json_encode($data_gopay),
- // CURLOPT_HTTPHEADER => array(
- // "Content-Type: application/json",
- // "cache-control: no-cache",
- // "Authorization: Basic " . base64_encode(MIDTRANS_SERVERKEY . ':')
- // ),
- ));
- $response = curl_exec($curl);
- $result = json_decode($response, true);
- $html = 'Nama : '.$result['namaplg'].'%0a';
- $html.= 'Alamat : '.$result['alamatplg'].'%0a';
- $html.= 'Kode Tracking : '.$result['trackid'].'%0a';
- $html.= 'Simas ID : '.$result['idmtsales'].'%0a';
- $html.= 'Tanggal input Simas : '.$result['tglsales'].'%0a';
- $html.= 'Status Validitas : '.$result['statusvaliditas'].'%0a';
- $html.= 'Status SSCBE : '.$result['statusscbe'].'%0a';
- $html.= 'STO : '.$result['sto'].'%0a';
- $html.= 'STO Area : '.$result['stoarea'].'%0a';
- $html.= 'Koordinat : '.$result['koordplg'].'%0a';
- $html.= 'ODP : '.$result['labelodp'].'%0a';
- $html.= 'Internet : '.$result['inet'].'%0a';
- $html.= 'SC : '.$result['sc'].'%0a';
- if (!$response) {
- $html = 'Data tidak ditemukan';
- }
- file_get_contents(
- $path.
- "/sendmessage?chat_id=".
- $chatId.
- "&text=".$html
- );
- // file_get_contents(
- // $path.
- // "/sendmessage?chat_id=".
- // $chatId.
- // "&text=".$namaWaifu
- // );
- }
- ?>
Add Comment
Please, Sign In to add comment