当前位置: 首页>>代码示例>>PHP>>正文


PHP global_common::getDataUrl方法代码示例

本文整理汇总了PHP中global_common::getDataUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP global_common::getDataUrl方法的具体用法?PHP global_common::getDataUrl怎么用?PHP global_common::getDataUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在global_common的用法示例。


在下文中一共展示了global_common::getDataUrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

    echo '<br>';
    echo 'Got Foody stores of cat_' . $catID . '_total_' . $total;
    //return;
    for ($pageIndex = 1; $pageIndex < $count; $pageIndex++) {
        $filePath = $folder . 'Foody/Foody_stores_of_cat_' . $catID . '_page_' . $pageIndex . '.txt';
        if (file_exists($filePath) == false) {
            $hostStores = 'http://www.foody.vn/' . $cityName . '/dia-diem?ds=Restaurant&vt=row&st=1&dt=undefined&c=' . $catID . '&page=' . $pageIndex . '&provinceId=' . $cityid . '&categoryId=' . $catID . '&append=true';
            $headerStores = array('Host: www.foody.vn', 'Connection: keep-alive', 'Accept: application/json, text/javascript, */*; q=0.01', 'CSP: active', 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36', 'X-Requested-With: XMLHttpRequest', 'X-Foody-User-Token: 9d0c3de3-dbc4-41a5-8334-9252ede6c077', 'Cache-Control: no-cache', 'Referer: http://www.foody.vn/' . $cityName . '/quan-an', 'Accept-Encoding: gzip, deflate, sdch', 'Accept-Language: en-US,en;q=0.5');
            //$cookieHeader = 'flg=vn; ASP.NET_SessionId=w1pwfv01xno1sixk2wqxtvwp; __RequestVerificationToken=QXh8ezc4yMSkKxZgBi4waCJJkRuXEPDbL3ISEKdZXXxmTlJTrQJ4UD5S4TT0Vv6eM48t1Eqy5Wbare1yfv4OtJWiEfCtbvnBFt7HL3CYzxM1; gcat=entertain; floc=217';
            //Replace new cookie
            $cookieHeader = 'flg=vn; ASP.NET_SessionId=patvstdo4fbgspgdrwikle4e; gcat=food; floc=217; FOODY.AUTH=4C570C6EC4F0CE54432BDE46511940101605CC450363214566F54425C7369354A15DDB54861CBA0A062DBC227B00BA2C4EDD012031EAE8669A3AADEB6E1DE43B99D7AE303ACEF43151DBF12A401DD738F6CDF0E23142313521071A3D889ADC7343851F95534FE4D655735DD14C331BD3D4415A57BCF5B7DE79F6091D74826B9B9BC367CA4CAF45A284C336B61D6451F781F8E0299CB224ED14D5CF6F45691613E8F351C03B43E09E549678BE9F4F1E3311B4FADEDFEE698EAD1F9AE27D0D59C80164FE3060DCA1A73F8C9CB993C239DF8B0242FD61B724E330B0694613F76BAB; FOODY.RequestVerificationToken=9d0c3de3-dbc4-41a5-8334-9252ede6c077; fbm_395614663835338=base_domain=.foody.vn; _ga=GA1.2.1461401499.1457490421; _gat=1; _gat_ads=1; fbsr_395614663835338=w7ufXZyNTTFPagz45NawdAzn1U2eEIh4zxCCeiJNZW0.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNvZGUiOiJBUUI5M3hGc2lod2x5S202QzU3Q2pzYV9OWTN1TWpYb1dwQzVXVTdYNHVnazgteEJSSktRRFVZZEtuSWFGZHFyMGFiWDZqc0pjX0cwekkyWThSSVg5V3JVQ1NkbHJBLXhxS0hmVnBnZjZ5ZjJPUmNValRCZTNEcUxrb19KbjlIQWpmc2hsa2xSWDlQbExzS0N1WlNsZ2JieWpENHVwcTdXa1pNc29lOGx3Y09FSkFOVG5lajNPcXlpNzNON1BSZjJ6MUllTmc0enJvcGFQa1lJQ1ZZb2hwSU5KZkhuQkJwR0RiUUxkQW9yUXhOZ0NoMHpER2lEZDB4TXlVMkRHTXhQZWFXQV9od182NUNKc3pDajVtYTN5Q1ExRFhHbjd5SktVNVVvUGExcGE2ZXh3M3o1R01iYW9lMUdqdXNRQUVjTkgxSThMVzZ4Z2FvTU1TX3RzcUx0XzY5eSIsImlzc3VlZF9hdCI6MTQ1OTg4NDI5OCwidXNlcl9pZCI6IjEwMDAwMTg1NjA3NTI5OCJ9';
            // echo '<br> Host: ';
            //echo $hostStores;
            //echo '<br>';
            //print_r($headerStores) ;
            $jsonStores = global_common::getDataUrl($hostStores, $headerStores, $cookieHeader);
            //echo $jsonStores;
            global_common::writeToFile($filePath, $jsonStores);
            echo '<br>';
            echo 'Got Foody stores of cat_' . $catID . '_page_' . $pageIndex;
            $allStores = json_decode($jsonStores, true);
            //sleep 10 second
            sleep(30 * (1436885463 % 9 + 1));
            //break;
            // return;
        }
        //break;
        // return;
    }
    //return;
}
开发者ID:vietlethanh,项目名称:KooKooBackEnd,代码行数:31,代码来源:tool_foody.php


注:本文中的global_common::getDataUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。