Beispiel #1
1
function getCookie($userData)
{
    $agent = GenerateUserAgent();
    $guid = GenerateGuid();
    $device_id = "android-" . $guid;
    $data = '{"device_id":"' . $device_id . '","guid":"' . $guid . '","username":"******","password":"******","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}';
    $sig = GenerateSignature($data);
    $data = 'signed_body=' . $sig . '.' . urlencode($data) . '&ig_sig_key_version=4';
    $response = SendRequest(array('url' => 'https://i.instagram.com/api/v1/accounts/login/', 'post' => $data, 'agent' => $agent, 'PATH_COOKIE' => $userData['PATH_COOKIE']));
    $data = json_decode($response[1]);
    return array('status' => !empty($data) && $data->status == 'ok' ? 200 : 400, 'data' => $data);
}
Beispiel #2
1
 private function getGroup($timestamp, $url, $offset = 0)
 {
     $count = 100;
     $data = SendRequest(array("url" => $this->urlApi . "wall.get", "get" => ["v" => $this->versionApi, 'filter' => 'all', 'domain' => $url, 'count' => $count, 'offset' => $offset]));
     $posts = json_decode($data[1])->response->items;
     $lastItem = array_slice($posts, -1, 1);
     $lastDate = $lastItem[0]->date;
     if ($lastDate > $timestamp) {
         $offset += $count;
         $posts = array_merge($posts, $this->getGroup($timestamp, $url, $offset));
     }
     return $posts;
 }
Beispiel #3
1
function postingImage($conf)
{
    $image = GetPostData($conf['PATH_IMAGE']);
    $agent = GenerateUserAgent();
    $dataUpload = SendRequest(array('url' => 'https://i.instagram.com/api/v1/media/upload/', 'post' => $image, 'agent' => $agent, 'useCookie' => true, 'PATH_COOKIE' => $conf['PATH_COOKIE']));
    $response = json_decode($dataUpload[1]);
    if (empty($response) || $response->status != 'ok') {
        return $response = array('status' => $response->status, 'data' => $response);
    }
    $guid = GenerateGuid();
    $device_id = "android-" . $guid;
    $requestData = '{"device_id":"' . $device_id . '","guid":"' . $guid . '","media_id":"' . $response->media_id . '","caption":"' . trim($conf['title']) . '","device_timestamp":"' . time() . '","source_type":"5","filter_type":"0","extra":"{}","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}';
    $sig = GenerateSignature($requestData);
    $new_data = 'signed_body=' . $sig . '.' . urlencode($requestData) . '&ig_sig_key_version=4';
    $response = SendRequest(['url' => 'https://i.instagram.com/api/v1/media/configure/', 'post' => $new_data, 'agent' => $agent, 'useCookie' => true, 'PATH_COOKIE' => $conf['PATH_COOKIE']]);
    $data = json_decode($response[1]);
    return array('status' => !empty($data) && $data->status == 'ok' ? 200 : 400, 'data' => $data);
}
Beispiel #4
1
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    //    curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE); // начинаем новую сессию и перезаписываем cookies
    ////    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 7); // ждём 30сек. при попытке соединения
    //    curl_setopt($ch, CURLOPT_COOKIEJAR, ".//my_cookies.txt");
    curl_setopt($ch, CURLOPT_COOKIEFILE, ".my_cookies777.txt");
    curl_setopt($ch, CURLOPT_SSLVERSION, 3);
    curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'SSLv3');
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    // не проверять SSL сертификат
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, TRUE);
    $result2 = curl_exec($ch);
    $html1 = str_get_html($result2);
    curl_close($ch);
    return $html1;
}
$url2 = 'https://adm.tlscontact.com/ae2dk/login.php';
$url3 = 'https://adm.tlscontact.com/ae2dk/index.php?fg_id=4253314';
$url4 = 'https://adm.tlscontact.com/ae2dk/index.php?fg_id=4327979';
$url5 = 'https://adm.tlscontact.com/ae2dk/login.php?redir=%2Findex.php%3Ffg_id%3D4327979';
//$dom2=SendRequest($url,$header);
echo $v = SendRequest($url4, $header2);
var_dump($v);
//https://adm.tlscontact.com/ae2dk/login.php?redir=%2Findex.php%3Ffg_id%3D4327979
//https://adm.tlscontact.com/ae2dk/login.php?redir=%2Findex.php%3Ffg_id%3D4327979
//https://adm.tlscontact.com/ae2dk/login.php?redir=%2Findex.php%3Ffg_id%3D4327979
//https://adm.tlscontact.com/ae2dk/login.php?redir=%2Findex.php%3Ffg_id%3D4327979
//https://adm.tlscontact.com/ae2dk/login.php?redir=%2Findex.php%3Ffg_id%3D4327979
Beispiel #5
1
    curl_setopt($ch, CURLOPT_COOKIEJAR, "./_cookies.txt");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    curl_setopt($ch, CURLOPT_HEADER, TRUE);
    $result = curl_exec($ch);
    if (curl_errno($ch)) {
        echo 'Ошибка curl: ' . curl_error($ch);
    }
    $html = str_get_html($result);
    return $html;
}
$url2 = 'https://www.vfsvisaservices.com/Swiss-Global-Appointment/AppScheduling/AppSchedulingGetInfo.aspx';
$formp2 = array('__EVENTTARGET' => 'ctl00$plhMain$cboVisaCategory', '__EVENTARGUMENT' => '', '__LASTFOCUS' => '', '__VIEWSTATE' => 'qfgCsRJoSNc4Ixz1lUaTtv0NxmWi2+dsjpPaAPt6pc0g8ENjoIft+RX8n2hqyy2syt6sL6vxggVLEQTvRntteC3FoI0vidteRlk4Os0pn/7PUipg5zMakXNobVD3Xd8XyEyZ8CJQ5sRKsznvg5xFSivfW4ap6uHhfGPfBT5mw8yijW9eATWTnouyU5PjMMiecACK28qaV95pjZkLCHJ94KSqUt0Iq7oecEgtIjG9dkBd4WKI9eCyeikBiVu/mOqXOJTNElVctGDFgLAGkNuhwI0E0C9d9L3kj/X58VHpKhTF13JsAKkZslfxr5z1BjNM5ZW0wiUeFIEbD6Y8xqsVZOMmfrBy/6wip9IHxvACQjluEWvBjXci+Xx2Av8bfBUweZ1X4Y5JW/2snBTQRuCKvxuK5+hImAvbFQqCjhugB+r5KbVA0r30k0e4MB2G5tTnnLK+UWB77NYZM9QQM3f7Ko61gtPPq+78KPXTXuJCLUJUSZl7QjYN9PE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pAZn/6siWJpC6tb7SmeDnxXuF44DHhFRPz+UY6rlQIJI62gYw2ewnDrCZHwdGgnhVkVmXLMXP8GC5y8sEhvWTkjPkJqm8pZnfdKW2xQV+brUYpjOKIvA9JdGcw+w6hvxzwkd22cHp8Pg2h5BBLR2FM3KmCuo7kVX/f7IILJaKQ17KpUk7AlceEWuEKN+SG4GS3fgIEo9XEwEpIsj4WyYM6VM3v2ztCqZ4Zj2f84pAZ97GqdIfdVK/03B+5kUpapY5Bas9Sb+5Rn68EBw0H6N5+tTRWv23u4LISFWS1mAvUaCn2kPvjuVmNdApVml13yRJpMqyf6dbguZK3v1UcdahoTlF/TSS7SUdXgDjlne50gOrpIM4QF1iTH9qLPHy66mpXzE+EytTo4XSw3HqP4lfQXt/bwVas1RucaA12dDhO67LzDkk5+scfbMmyWzKtn1fuchvcGP3bCNvhHxSqboycz2gtA03JvcY57tWsNWRInHq/KTTw996RjjmIY4fh2qsp83mIotar0idP2y/BSO99oINVn7LvKMAZd7dfQKwv7qbaj+ARtMhgqrQ8oQYqFEatWuW7LplbYKlKe3TPGLUzVBhZhqoILRYJKau19r3nxwVjGQA5Z0=', '____Ticket' => '4', '__VIEWSTATEENCRYPTED' => '', '__EVENTVALIDATION' => 'mHRsAHf6a42DNA9H6fiH+s8QzjMfDxEl18GSxk7YIwvtEkKme3LrkIsUikK/z0kDSpjpfmq52BMhyVfmXLeKif60KqAlezi9HQ92ka+MntL/OSBcrys0T7jJhCwD48Ec2bd9Pvawy6RRXXs3pejf5B/2b89R+Wl0TjeBzHC9krJweAJzJa3O3MXk+F4MKKWPtQhaTA==', 'ctl00$plhMain$tbxNumOfApplicants' => '1', 'ctl00$plhMain$cboVisaCategory' => '32', 'ctl00$plhMain$drpApplicantType' => '0', 'ctl00$plhMain$hdnMode' => 'S');
$formpost = http_build_query($formp2);
$table = SendRequest($url2, $formpost, $header);
$dani = $table->find("span[id=ctl00_plhMain_lblMsg]");
if (is_array($dani)) {
    $m = 1;
    foreach ($dani as $span) {
        $item1 = $span->plaintext;
    }
}
echo "<form method='GET' action='https://www.vfsvisaservices.com/Swiss-Global-Appointment/AppScheduling/AppLogin.aspx?P=59\$0\$213\$146\$75\$161\$201\$226\$237\$96\$19\$227\$249\$189\$242\$12\$243\$221\$232\$103\$69\$195\$161\$132\$85\$203\$173\$114\$142\$77\$235\$145' >\n<table style=border:'1'>\n<tr>\n<th>id</th>\n<th>date</th>\n</tr>";
$item2 = substr($item1, -22);
echo "<tr>" . "";
echo "<td>" . 1 . "</td>";
echo "<td>" . $item2 . "</td>";
echo "<td> <input type=\"submit\" style=\"background-color: rgb(43, 253, 43);\" value=\"Assign\"</td>";
echo "</tr>";
echo "</table>";
$ch = curl_init($request);
curl_setopt_array($ch, array(CURLOPT_POST => TRUE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_USERPWD => $auth_string, CURLOPT_HTTPHEADER => array('Content-type: application/x-www-form-urlencoded'), CURLOPT_POSTFIELDS => $data));
$result = curl_exec($ch);
curl_close($ch);
// Check for errors
if ($response === FALSE) {
    die(curl_error($ch));
}
// Decode the response
$resultData = json_decode($result, TRUE);
$access_token = $resultData["access_token"];
// set up the API call
// get data
if ($_POST["requestBody"]) {
    $data = json_decode($_POST["requestBody"]);
} else {
    $data = array();
}
// get request type or default to GET
if ($_POST["requestType"]) {
    $method = $_POST["requestType"];
} else {
    $method = "GET";
}
// get the URL and authorization info from the form data
$request = $_POST["url"];
// add headers
$headers = array(1 => "Authorization: Bearer {$access_token}", 2 => "Content-type: application/x-www-form-urlencoded");
//send the http request
$result = SendRequest($request, $method, $data, $headers);
echo $result;
Beispiel #7
0
    $n = curl_setopt($ch, CURLOPT_COOKIEFILE, ".//my_cookies777.txt");
    var_dump($n);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($mas1));
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header0);
    curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'SSLv3');
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    // не проверять SSL сертификат
    curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, TRUE);
    $result2 = curl_exec($ch);
    if (curl_errno($ch)) {
        echo 'Ошибка curl: ' . curl_errno($ch);
    }
    echo $html2 = str_get_html($result2);
    //    var_dump($html2);
    $info = curl_getinfo($ch);
    echo $info['url'] . '<br>' . '<br>' . 'це круто коля розумний к ' . $info['request_header'] . '<br>';
    curl_close($ch);
}
$url = 'https://adm.tlscontact.com/ae2dk/login.php';
$url0 = 'https://adm.tlscontact.com/ae2dk/index.php?fg_id=4327979';
$url1 = 'https://adm.tlscontact.com/ae2dk/login.php?redir=%2Findex.php%3Ffg_id%3D4327979';
$url2 = 'https://adm.tlscontact.com/ae2dk/login.php?redir=%2Findex.php%3Ffg_id%3D4327979';
$url3 = 'https://adm.tlscontact.com/ae2dk/css/common.css?date=201409240254';
$mas1 = array('date' => '201409240254');
$mas0 = array('redir' => '/index.php?fg_id=4253314');
$mas = array('process' => 'login', '_sid' => 'e007b35d5d04a45b1ab4042b64eea8e1', 'email' => '*****@*****.**', 'pwd' => 'visaHQ2014');
SendRequest($url, $url0, $url1, $url3, $header, $header0, $mas, $mas0, $mas1);
Beispiel #8
0
function LogOut()
{
    $data = array();
    $info = SendRequest('api/logout', 'android', false, $data);
    if ($info[0] == 504) {
        return "Invalid Token";
    } else {
        // Parse the XML
        $xml = simplexml_load_string($info[1]);
        $json = json_encode($xml);
        $array = json_decode($json, true);
        return $array;
    }
}
Beispiel #9
0
 if (empty($obj)) {
     echo "Could not decode the response";
 } else {
     $status = $obj['status'];
     echo var_dump($status);
     echo "==========================\n\n";
     if ($status == 'ok') {
         // Remove and line breaks from the caption
         $caption = preg_replace("/\r|\n/", "", $caption);
         $media_id = $obj['media_id'];
         $device_id = "android-" . $guid;
         $data = '{"device_id":"' . $device_id . '","guid":"' . $guid . '","media_id":"' . $media_id . '","caption":"' . trim($caption) . '","device_timestamp":"' . time() . '","source_type":"5","filter_type":"0","extra":"{}","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}';
         $sig = GenerateSignature($data);
         $new_data = 'signed_body=' . $sig . '.' . urlencode($data) . '&ig_sig_key_version=4';
         // Now, configure the photo
         $conf = SendRequest('media/configure/', true, $new_data, $agent, true);
         if (empty($conf[1])) {
             echo "Empty response received from the server while trying to configure the image";
         } else {
             if (strpos($conf[1], "login_required")) {
                 echo "You are not logged in. There's a chance that the account is banned";
             } else {
                 $obj = @json_decode($conf[1], true);
                 $status = $obj['status'];
                 echo var_dump($status);
             }
         }
     } else {
         echo "Status isn't okay";
     }
 }
function uploadImage($username, $password, $photo, $caption)
{
    if (!isset($photo) || !is_file($photo)) {
        die("no photo found !");
    } else {
        // $imageInfo = getimagesize($photo);
        // $width = $imageInfo["width"] ;
        // $height = $imageInfo["height"] ;
        list($width, $height) = getimagesize($photo);
    }
    // Set the caption for the photo
    // $caption = "wat";
    // Define the user agent
    $agent = 'Instagram 7.10.0 Android (23/6.0; 515dpi; 1440x2416; huawei/google; Nexus 6P; angler; angler; en_US)';
    // Define the GuID
    $guid = GenerateGuid();
    // Set the devide ID
    $device_id = "android-" . $guid;
    /* LOG IN */
    // You must be logged in to the account that you wish to post a photo too
    // Set all of the parameters in the string, and then sign it with their API key using SHA-256
    $data = '{"device_id":"' . $device_id . '","guid":"' . $guid . '","username":"******","login_attempt_count":"1","password":"******","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}';
    $sig = GenerateSignature($data);
    $data = 'signed_body=' . $sig . '.' . urlencode($data) . '&ig_sig_key_version=4';
    $login = SendRequest('accounts/login/', true, $data, $agent, false);
    preg_match('#Set-Cookie: csrftoken=([^;]+)#', $login[2], $token);
    preg_match('#Set-Cookie: ds_user_id=([^;]+)#', $login[2], $id);
    $userid = $id[1];
    if (strpos($login[1], "Sorry, an error occurred while processing this request.")) {
        echo "Request failed, there's a chance that this proxy/ip is blocked";
    } else {
        if (empty($login[1])) {
            echo "Empty response received from the server while trying to login";
        } else {
            // Decode the array that is returned
            $obj = @json_decode($login[1], true);
            if (empty($obj)) {
                echo "Could not decode the response: " . $body;
            } else {
                // Post the picture
                $boundary = $guid;
                $bodies = [['type' => 'form-data', 'name' => 'upload_id', 'data' => round(microtime(true) * 1000)], ['type' => 'form-data', 'name' => '_uuid', 'data' => $guid], ['type' => 'form-data', 'name' => '_csrftoken', 'data' => $token[1]], ['type' => 'form-data', 'name' => 'photo', 'data' => file_get_contents($photo), 'filename' => basename($photo), 'headers' => ['Content-type: application/octet-stream']]];
                $data = buildBody($bodies, $boundary);
                $post = SendRequest('upload/photo/', true, $data, $agent, true, ['Proxy-Connection: keep-alive', 'Connection: keep-alive', 'Accept: */*', 'Content-type: multipart/form-data; boundary=' . $boundary, 'Accept-Language: en-en', 'Accept-Encoding: gzip, deflate']);
                preg_match('#Set-Cookie: csrftoken=([^;]+)#', $post[2], $token);
                if (empty($post[1])) {
                    echo "Empty response received from the server while trying to post the image";
                } else {
                    // Decode the response
                    $obj = @json_decode($post[1], true);
                    if (empty($obj)) {
                        echo "Could not decode the response";
                    } else {
                        $status = $obj['status'];
                        if ($status == 'ok') {
                            // Remove and line breaks from the caption
                            $caption = preg_replace("/\r|\n/", "", $caption);
                            $media_id = $obj['upload_id'];
                            // Now, configure the photo
                            $data = array('caption' => $caption, 'upload_id' => $media_id, 'source_type' => 3, 'edits' => array('crop_zoom' => 1.0, 'crop_center' => array(0.0, -0.0), 'crop_original_size' => array($width, $height), 'black_pixels_ratio' => 0), 'device' => array('manufacturer' => 'asus', 'model' => 'Nexus 7', 'android_version' => 22, 'android_release' => '5.1'), '_csrftoken' => $token[1], '_uuid' => $guid, '_uid' => $userid);
                            $sig = GenerateSignature(json_encode($data));
                            $new_data = 'signed_body=' . $sig . '.' . urlencode(json_encode($data)) . '&ig_sig_key_version=4';
                            $conf = SendRequest('media/configure/', true, $new_data, $agent, true);
                            if (empty($conf[1])) {
                                echo "Empty response received from the server while trying to configure the image";
                            } else {
                                if (strpos($conf[1], "login_required")) {
                                    echo "You are not logged in. There's a chance that the account is banned";
                                } else {
                                    $obj = @json_decode($conf[1], true);
                                    $status = $obj['status'];
                                    if ($status != 'fail') {
                                        echo "Success";
                                    } else {
                                        echo 'Fail';
                                        echo var_dump($obj);
                                    }
                                }
                            }
                        } else {
                            echo "Status isn't okay";
                            echo var_dump($obj);
                        }
                    }
                }
            }
        }
    }
}
Beispiel #11
0
    //    curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($mas));
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'SSLv3');
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    // не проверять SSL сертификат
    curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, TRUE);
    $result2 = curl_exec($ch);
    $html3 = str_get_html($result2);
    curl_close($ch);
    return $html3;
}
$url2 = 'https://adm.tlscontact.com/ae2dk/index.php?fg_id=4327979';
$html = SendRequest($header2, $url2);
$table = $html->find("li a[class=dispo]");
foreach ($table as $span) {
    $item1['date'] = $span->plaintext;
    $it_time = $span->onclick;
    $item2 = substr($it_time, -82);
    $item3 = substr($item2, 37, 50);
    $item4 = substr($item3, 0, 10);
    $item1['time'] = $item4;
    $max_masiv[] = $item1;
}
if ($max_masiv) {
    conect_table($max_masiv);
}
var_dump($max_masiv);
echo ",k";
Beispiel #12
0
    curl_setopt($ch, CURLOPT_COOKIEFILE, ".//my_cookies.txt");
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($mas));
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    curl_setopt($ch, CURLOPT_HEADER, TRUE);
    if (curl_errno($ch)) {
        echo 'Ошибка curl: ' . curl_error($ch);
    }
    $result = curl_exec($ch);
    $html1 = str_get_html($result);
    echo $html1;
    return $html1;
}
$url = 'https://adm.tlscontact.com/ae2dk/login.php';
$dom = SendRequest($url);
echo $dom;
// var_dump($dom);
//    $input2=$dom->find("div[class=take_appointment] a[class=dispo]");
//    foreach($input2 as $span){
//
//     $item1['time']=$span->plaintext;
//     $item1['date']=substr($span->onclick ,166 , -35);
//        $max_masiv[]=$item1;
//
//}
//if(is_array($input2)){
//    $m=1;
//    foreach($input2 as $span){
//
//        $item1['time']=$span->plaintext;
Beispiel #13
0
$year = date("Y");
$day = date("d");
//echo $day."/".$month_year."<br>";
$cal_days = cal_days_in_month(CAL_GREGORIAN, $manth, $year);
// 31
//echo date("d/m/Y");
while ($day <= $cal_days) {
    //echo $i."/01/2015"."<br>";
    //   echo date("d/m/Y");
    $data = array('__LASTFOCUS' => '', 'ctl00_ScriptManager1_HiddenField' => ';;AjaxControlToolkit, Version=3.5.50401.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-US:beac0bd6-6280-4a04-80bd-83d08f77c177:f2c8e708:de1feab2:720a52bf:f9cec9bc:589eaa30:698129cf:e148b24b:fcf0e993:fb9b4c57:ccb96cf9:987bb99b:a4b66312:35576c48', '__EVENTTARGET' => '', '__VIEWSTATE' => '/wEPDwULLTE1OTc1NTc1MTMPZBYCZg9kFgICAw9kFggCAQ8WAh4FY2xhc3MFBm5vcm1hbGQCHQ9kFgICAQ8WAh4JaW5uZXJodG1sBRBCb29rIEFwcG9pbnRtZW50ZAIhDxYCHgdWaXNpYmxlaGQCIw9kFgYCAw8PFgIeBFRleHRlZGQCBQ8PFgIfA2VkZAIHD2QWCgIHD2QWAgIBD2QWA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ZB8PZ2QQFQEDSVREFQEkMTE4MGUwMDQtZGI3My00ZjM1LThhZGYtMmZiYzE3YmU3ZDA4FCsDAWcWAWZkAgsPZBYCZg9kFgICAQ88KwANAGQCDQ9kFgICAQ88KwANAGQCEQ9kFgJmD2QWAgIDDzwrAA0AZBgEBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUmY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRpbWdCdG5TZWFyY2gFJWN0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkZ3ZBcHBEZXRhaWwPZ2QFJWN0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkZ3ZOZXh0U2xvdHMPZ2QFKGN0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkZ3ZTZWFyY2hSZXN1bHQPZ2TjwkCNXe/rFN8CEYuLhqLYlKD2PQ==', '__EVENTVALIDATION' => '/wEWDwKM25q3AQLMrteFDQL0rvrXDwL/roI8As65xLwPAvn909UCAtvR1dIEApaN3vMPApvZj4cOAqrbjcADAtT/htQEAquKqoQMAuavv9gEAtzgm/QOAtmJ8NUCTTK+9HdjCqW4KAK+NFu9MtwzBvM=', '__VIEWSTATEGENERATOR' => 'CD6DA3C7', 'ctl00$ContentPlaceHolder1$txtNoOfApplicants$txtNoOfApplicants' => 1, 'ctl00$ContentPlaceHolder1$txtNoOfApplicants$vceReq_ClientState' => '', 'ctl00$ContentPlaceHolder1$txtNoOfApplicants$vceReg_ClientState' => '', 'ctl00$ContentPlaceHolder1$ddlAppointmentCategory' => '0773e3d4-bf25-4ea2-9ac5-f514ca19f756', 'ctl00$ContentPlaceHolder1$vceAppointmentCategory_ClientState' => '', 'ctl00$ContentPlaceHolder1$dtpAppointmentDate$dtpAppointmentDate' => $day . "/" . $month_year, 'ctl00$ContentPlaceHolder1$dtpAppointmentDate$vceReg_ClientState' => '', 'ctl00$ContentPlaceHolder1$dtpAppointmentDate$vceCustomdtpAppointmentDate_ClientState' => '', 'ctl00$ContentPlaceHolder1$dtpAppointmentDate$medtpAppointmentDate_ClientState' => '', 'ctl00$ContentPlaceHolder1$dtpAppointmentDate$mewaterdtpAppointmentDate_ClientState' => '', 'ctl00$ContentPlaceHolder1$imgBtnSearch.x' => 40, 'ctl00$ContentPlaceHolder1$imgBtnSearch.y' => 1, 'ctl00_ScriptManager1_HiddenField' => ';;AjaxControlToolkit, Version=3.5.50401.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-US:beac0bd6-6280-4a04-80bd-83d08f77c177:f2c8e708:de1feab2:720a52bf:f9cec9bc:589eaa30:698129cf:e148b24b:fcf0e993:fb9b4c57:ccb96cf9:987bb99b:a4b66312:35576c48');
    $day++;
    $date = $data['ctl00$ContentPlaceHolder1$dtpAppointmentDate$dtpAppointmentDate'];
    // визначаєм дату
    $data2 = http_build_query($data);
    //var_dump($data);
    $html = SendRequest($url, $data2);
    $table = $html->find("table[id=ctl00_ContentPlaceHolder1_gvSearchResult] span");
    if (is_array($table)) {
        $m = 1;
        foreach ($table as $span) {
            $item1['time'] = $span->plaintext;
            $item1['date'] = $date;
            $max_masiv[] = $item1;
            $m++;
        }
    }
}
if ($max_masiv) {
    conect($max_masiv);
}
echo '(' . round(microtime(true) - $btime, 4) . ' sec.)';
Beispiel #14
0
if ($response === FALSE) {
    die(curl_error($ch));
}
// Decode the response
$resultData = json_decode($result, TRUE);
$access_token = $resultData["access_token"];
// set up the API call
// no data to submit
$data = array();
// get current time and 24 hours ago in milliseconds
$to = time() * 1000;
$from = $to - 24 * 60 * 60 * 1000;
$method = "GET";
// get the URL and authorization info from the form data
$request = "https://analytics.api.brightcove.com/v1/data?accounts=20318290001&dimensions=video&limit=6&sort=video_view&fields=video&from={$from}&to={$to}";
// add headers
$headers = array(1 => "Authorization: Bearer {$access_token}", 2 => "Content-type: application/x-www-form-urlencoded");
//send the http request
$result = SendRequest($request, $method, $data, $headers);
// decode the response
$analyticsData = json_decode($result, TRUE);
// now prepare the CMS API request
$videosArray = array();
for ($i = 0; i < count($analyticsData["items"]); $i++) {
    $request = "https://cms.api.brightcove.com/v1/accounts/20318290001/videos/" . $analyticsData["items"][$i]["video"];
    // get the video data and add it to the videos array
    $videosArray[] = SendRequest($request, $method, $data, $headers);
}
var_dump($videosArray);
$videoData = json_encode($videosArray);
echo $videoData;
Beispiel #15
0
function GetRequest_JsonRpc_Lib($host, $port, $passwd, $method, $params)
{
    $reqarr = array('version' => '1.1', 'method' => $method, 'params' => $params);
    $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
    $request = $json->encode($reqarr);
    $file = SendRequest($host, $port, '/jsonrpc', 'nzbget', $passwd, $request);
    if (IsConnectError($file)) {
        return $file;
    }
    $response = $json->decode($file);
    if (is_array($response) && isset($response['error']) && isset($response['error']['code'])) {
        trigger_error('RPC: method "' . $method . '", error ' . $response['error']['code'] . ' - ' . $response['error']['message']);
    } else {
        if (is_array($response) && isset($response['result'])) {
            return $response['result'];
        } else {
            return 'ERROR: Could not decode json-data. Method "' . $method . '".';
        }
    }
}
Beispiel #16
0
//    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
//    curl_setopt($ch, CURLOPT_HEADER, TRUE);
//    $html = curl_exec($ch);
//    if(curl_errno($ch))
//    {
//        echo 'Ошибка curl: ' . curl_error($ch);
//    }
//    $html = str_get_html($html);
//    return $html;
//    preg_match_all('/Location:(.*?)\n/', $html, $matches);
//    if (count($matches[1])>0){
//        $location[]=$matches[1][0];
//        $location=get_all_redirects($matches[1][0],$location);
//        return $location;
//    }
//    else{
//        return $location;
//    }
//    echo "<hr>";
//    echo var_dump(get_headers($url, 1));
//    echo  $html2 = str_get_html($result2);
//}
$url2 = 'https://adm.tlscontact.com/ae2dk/index.php?fg_id=4327979';
$url3 = 'https://adm.tlscontact.com/ae2dk/index.php?fg_id=4253314';
$url4 = 'https://adm.tlscontact.com/ae2dk/login.php';
//$dom2=SendRequest($url,$header);
SendRequest($url4, $header2, $url2);
?>
</body>
</html>