Example #1
0
function slack_incoming_hook_post_with_attachments($uri, $user, $channel, $icon, $payload, $attachments)
{
    $data = array("text" => $payload, "channel" => "#" . $channel, "username" => $user, "icon_url" => $icon, "attachments" => array($attachments));
    $data_string = "payload=" . json_encode($data, JSON_HEX_AMP | JSON_HEX_APOS | JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT);
    mylog('sent.txt', $data_string);
    return curl_post($uri, $data_string);
}
Example #2
0
 public function setProjectFilter($filter)
 {
     $url = $this->ws_url() . 'ws/set_project_filter';
     $data = array('is_project_filter' => $this->input->post('is_project_filter'));
     $response = curl_post($url, $data, TRUE);
     return json_decode($response);
 }
Example #3
0
 public function editKey($key, $data)
 {
     $url = $this->ws_url() . 'ws/key_post/' . $key;
     $data['keybase_user_id'] = $this->ci->session->userdata('id');
     $response = curl_post($url, $data, TRUE);
     return json_decode($response);
 }
Example #4
0
 /**
  * 百度翻译
  */
 public function translate()
 {
     $query = \Input::get('w');
     if (!$query) {
         echo 'Word Is Required' . PHP_EOL;
         exit;
     }
     //www.xunshu.org/xunshu/22/22665/7844538.html
     $res = curl_post('http://fanyi.baidu.com/v2transapi', ['from' => 'en', 'to' => 'zh', 'query' => $query, 'transtype' => 'realtime', 'simple_means_flag' => '3']);
     $result = [];
     $data = json_decode($res, 1);
     if (isset($data['dict_result']['simple_means']['symbols'][0])) {
         $symbols = $data['dict_result']['simple_means']['symbols'][0];
         $result['[En]'] = '[' . $symbols['ph_en'] . ' ]';
         $result['[Am]'] = '[' . $symbols['ph_am'] . ' ]';
         //echo -e "\e[1;31m skyapp exist \e[0m"
         echo PHP_EOL . " [{$query} ]" . PHP_EOL;
         if ($symbols['ph_en']) {
             echo ' ' . "【英】[{$symbols['ph_en']} ],【美】[{$symbols['ph_am']} ]" . PHP_EOL;
         }
         foreach ($symbols['parts'] as $k => $v) {
             $result['means'][$k] = $v['part'];
             foreach ($v['means'] as $k1 => $v1) {
                 $result['means'][$k] .= ($k1 ? "," : '') . $v1;
             }
             echo ' ' . $result['means'][$k] . PHP_EOL;
         }
         echo PHP_EOL;
     }
     exit;
 }
Example #5
0
function getAccessToken($code, $client_id, $client_secret, $url)
{
    $curl_post_data = array('code' => $code, 'client_id' => $client_id, 'client_secret' => $client_secret);
    $json = curl_post($url, $curl_post_data);
    $response = json_decode(removeTrailingCommas(utf8_encode($json)));
    return $response->{access_token};
}
Example #6
0
function getAccessToken($code, $client_id, $client_secret)
{
    echo $code . $client_id . $client_secret;
    $curl_post_data = array('code' => $code, 'client_id' => $client_id, 'client_secret' => $client_secret);
    $response = curl_post($_GET["access_token_url"], $curl_post_data);
    echo 'token: ' . $response;
    return $response["access_token"];
}
Example #7
0
function query($query, $post)
{
    $args = array();
    foreach (json_decode($post) as $k => $v) {
        $args[$k] = $v;
    }
    $data = curl_post($query, $args);
    return $data;
}
function dnspod_update_ip($record_id, $ip, $line)
{
    $url = 'https://dnsapi.cn/Record.Modify';
    $post = array('login_email' => USERNAME, 'login_password' => PASSWORD, 'format' => 'json', 'lang' => 'cn', 'error_on_empty' => 'no', 'domain_id' => DOMAIN_ID, 'sub_domain' => SUB_DOMAIN, 'record_id' => $record_id, 'record_type' => 'A', 'record_line' => $line, 'value' => $ip, 'ttl' => '120');
    $json_result = curl_post($url, $post);
    $array_result = json_decode($json_result, TRUE);
    $result = $array_result['status']['code'];
    return $result == 1;
}
Example #9
0
 public function loginCms()
 {
     $post_fields['username'] = USERNAME;
     $post_fields['password'] = PASSWD;
     $post_fields['code'] = 'abcd';
     $url = LOGINURL . '&dosubmit=1';
     $res = curl_post($url, $post_fields);
     if (!strpos($res, "登录成功")) {
         return false;
     }
     return $res;
 }
 public function info()
 {
     $data = array();
     $data['typeid'] = I('get.id');
     $data['puid'] = I('get.puid');
     $result = curl_post($data, rtrim(C('API_PATH'), '/') . '/?s=Supply/Index/index&api=SupplyBom.selbyusertypeid');
     $arr = json_decode($result, TRUE);
     //        echo "<pre>";
     //      print_r($arr);
     $this->assign('info', $arr['api_result']);
     $this->display();
 }
Example #11
0
/**
 * @param Array $fomrs
 * @param Boolean $useSSL
 * @return response string
 */
function execPayment($fomrs, $useSSL)
{
    $gofpay_gateway_url = trim(Configuration::get('GOFPAY_GATEWAY_URL')) . '/' . Configuration::get('GOFPAY_GATEWAY_VERSION') . '/gateway';
    if ($useSSL) {
        //crul请求,
        $info = curl_post($gofpay_gateway_url, http_build_query($fomrs, '', '&'));
    } else {
        //普通http请求
        $info = http_post($gofpay_gateway_url, http_build_query($fomrs, '', '&'));
    }
    return explode_return_str($info);
}
function _write_cache_file($files, $cache)
{
    $defaults = array('compilation_level' => 'SIMPLE_OPTIMIZATIONS', 'output_format' => 'json', 'output_info' => 'compiled_code');
    $js = '';
    foreach ($files as $file) {
        $fs_path = dir_path_for('js') . $file;
        if (file_exists($fs_path)) {
            $js .= fread(fopen($fs_path, 'r'), filesize($fs_path));
        }
    }
    $defaults["js_code"] = $js;
    $compiled_reponse = curl_post(GOOGLE_CLOSURE_COMPILER, $defaults);
    fwrite($cache, json_decode($compiled_reponse)->compiledCode);
}
Example #13
0
 public function getSectionsByDept($deptAbbr)
 {
     $params = array('term' => $this->termSlug, 'dept' => str_pad($deptAbbr, 4, ' '), 'crse_time' => 'Courses Offered Any Time', 'submit' => 'Go');
     $url = "https://webcenter.studentservices.tufts.edu/courses/subject_listing.asp";
     // http_build_query ensures the right encoding for the POST
     $result = curl_post($url, http_build_query($params));
     $regex = "/450\\)\"\\>([A-Z]+)\\s*(\\d{4})([A-Z0-9\\-]+)\\s*?<.+?\\d\\.\\d.+?\\'\\>\\<b\\>(.*?)\\&/";
     preg_match_all($regex, $result, $matches, PREG_SET_ORDER);
     $sections = array();
     foreach ($matches as $match) {
         $sections[] = array('CourseNum' => trim($match[2]), 'Num' => trim($match[3]), 'Professor' => formatProfessor($match[4]));
     }
     return $sections;
 }
Example #14
0
function getNamazVakitleri($ulke_id, $sehir_id, $ilce_id = '', $periyot = '')
{
    require_once SITE_PATH . '/simple_html_dom.php';
    $postdata = http_build_query(array('Country' => $ulke_id, 'State' => $sehir_id, 'City' => $ilce_id, 'period' => 'Aylik'));
    $result = curl_post('http://www.diyanet.gov.tr/tr/PrayerTime/PrayerTimesList', $postdata);
    $html = str_get_html($result);
    $deneme = array();
    $deneme[0] = boslukTemizle(@$html->find('table tr', 0)->plaintext);
    $deneme[1] = boslukTemizle(@$html->find('table tr', 1)->plaintext);
    $deneme[0][1] = 'Imsak';
    $deneme[0][2] = 'Gunes';
    $deneme[0][3] = 'Ogle';
    $deneme[0][4] = 'Ikindi';
    $deneme[0][5] = 'Aksam';
    $deneme[0][6] = 'Yatsi';
    $deneme[0][7] = 'Kible';
    if ($periyot == '') {
        // Günlük
        if (empty($deneme[1])) {
            return '[{"error":"Namaz vakitlerine ulaşılamadı. Lütfen tekrar deneyiniz."}]';
        } else {
            return json_turkce(array(array_combine($deneme[0], $deneme[1])));
        }
    } elseif ($periyot == 'haftalik') {
        // Haftalık
        $combine = array();
        for ($i = 1; $i < 8; $i++) {
            $veri = array_combine($deneme[0], boslukTemizle($html->find('table tr', $i)->plaintext));
            if ($veri) {
                $combine[] = $veri;
            }
        }
        echo json_encode($combine);
    } elseif ($periyot == 'aylik') {
        // Aylık
        $combine = array();
        for ($i = 1; $i < 34; $i++) {
            $veri = array_combine($deneme[0], boslukTemizle($html->find('table tr', $i)->plaintext));
            if ($veri) {
                $combine[] = $veri;
            }
        }
        echo json_encode($combine);
    }
}
Example #15
0
function getresult($url)
{
    $postData = "------WebKitFormBoundaryy9zMscQCwUGxoejM\r\n";
    $postData .= "Content-Disposition: form-data; name=\"urllink\"\r\n\r\n";
    $postData .= $url . "\r\n";
    $postData .= "------WebKitFormBoundaryy9zMscQCwUGxoejM\r\n";
    $postData .= "Content-Disposition: form-data; name=\"url-2txt\"\r\n\r\n\r\n\r\n";
    $postData .= "------WebKitFormBoundaryy9zMscQCwUGxoejM--\r\n";
    $post_url = "http://deeplearning.cs.toronto.edu//api/url.php";
    $header = array("Host: deeplearning.cs.toronto.edu", "Content-Length: " . strlen($postData), 'X-Requested-With: XMLHttpRequest', 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryy9zMscQCwUGxoejM', 'Accept-Language: zh-CN,zh;q=0.8', 'X-Requested-With: XMLHttpRequest', 'X-Requested-With: XMLHttpRequest');
    $str = curl_post($header, $postData, $post_url);
    $pattern = '#Sentence:</h4><ul><li>(.*)</li></ul><br/><h4>#';
    $sentence = getPatternResult($pattern, $str);
    if ($sentence == "error") {
        return "error";
    } else {
        return translate($sentence);
    }
}
Example #16
0
 public function syncContent()
 {
     $start = time();
     $id = $this->indexid;
     $wdb = helper::getDB('cmsware');
     $cdb = helper::getDB('phpcms');
     $sql = "select IndexID from cmsware_content_index where IndexID >= {$this->indexid} order by IndexID asc limit 10000";
     $res = $wdb->fetchAll($sql);
     foreach ($res as $k => $v) {
         $id = $v['IndexID'];
         error_log($id . "\n", 3, "process{$this->indexid}.log");
         $url = sprintf(ADDCONENTURL, $id);
         $res = curl_post($url, array());
         $tmp = json_decode($res, true);
         if (!isset($tmp['status']) || $tmp['status'] != 1) {
             error_log($id . "\t" . strip_tags($res) . "\n", 3, "fail_content.log");
         }
     }
     $end = time();
     error_log($end - $start . "\n", 3, "time");
 }
 /**
  * Invalidates object with passed key on CloudFront
  * @param $key   {String|Array} Key of object to be invalidated, or set of such keys
  */
 public function invalidate($keys)
 {
     $this->responseBody = '';
     if (!is_array($keys)) {
         $keys = array($keys);
     }
     $date = gmdate("D, d M Y G:i:s T");
     $requestUrl = $this->serviceUrl . "2010-08-01/distribution/" . $this->distributionId . "/invalidation";
     // assemble request body
     $body = "<InvalidationBatch>";
     foreach ($keys as $key) {
         $key = preg_match("/^\\//", $key) ? $key : "/" . $key;
         $body .= "<Path>" . $key . "</Path>";
     }
     $body .= "<CallerReference>" . time() . "</CallerReference>";
     $body .= "</InvalidationBatch>";
     // make and send request
     $headers = array();
     $headers[] = "Date: " . $date;
     $headers[] = "Authorization: " . $this->makeKey($date);
     $headers[] = "Content-Type: " . "text/xml";
     $this->responseBody = curl_post($requestUrl, $headers, $body);
     return $this->responseCode === 201;
 }
Example #18
0
function msf_cmd($ip, $client_request)
{
    //debug("START Function msf_cmd()</br>");
    $msgpack_data = msgpack_pack($client_request);
    $url = "http://" . $ip . ":55552/api/1.0";
    $port = 55552;
    $httpheader = array("Host: RPC Server", "Content-Length: " . strlen($msgpack_data), "Content-Type: binary/message-pack");
    $postfields = $msgpack_data;
    $return_array = curl_post($url, $port, $httpheader, $postfields);
    $msgunpack_data = msgpack_unpack($return_array['FILE']);
    //debug("END Function msf_cmd()</br>");
    return $msgunpack_data;
}
$album_id = $resp->albums->id;
if (!$album_id) {
    echo "Sorry, error occured.";
    die;
}
// get all images
$resp = curl_get('http://api.imgur.com/2/account/images.json', array(), $cookies);
$resp = json_decode($resp);
$images = array();
if (!empty($resp->images)) {
    foreach ($resp->images as $img) {
        $images[] = $img->links->small_square;
        if (count($images) > 10) {
            break;
        }
    }
}
// upload image
$resp = curl_post('http://api.imgur.com/2/account/images.json', array('image' => '@' . realpath('owned.jpg'), 'type' => 'file', 'name' => 'owned.jpg', 'caption' => '0wn3d by kkotowicz'), $cookies);
$resp = json_decode($resp);
$image_id = $resp->images->image->hash;
$resp = curl_post('http://api.imgur.com/2/account/albums/' . $album_id . '.json', array('add_images' => $image_id), $cookies);
$resp = json_decode($resp);
echo '<div style="border: 3px solid red; padding: 5px;"><h1>Hello, ' . htmlspecialchars($acc->account->url) . "!</h1>";
if ($images) {
    echo "<p>Do these look familiar?</p>";
    foreach ($images as $url) {
        echo "<img src='" . htmlspecialchars($url) . "'> ";
    }
}
echo '<p><a target=_blank href="' . htmlspecialchars($resp->albums[0]->links->imgur_page) . '">Look what you\'ve done!</a></p></div>';
Example #20
0
 function pidsRequest($serviceName, $parameters)
 {
     $userIdentifier = $this->_CI->session->userdata(PIDS_USER_IDENTIFIER);
     $userDomain = $this->_CI->session->userdata(PIDS_USER_DOMAIN);
     $resultXML = '';
     $requestURI = $this->PIDS_SERVICE_BASE_URI . $serviceName . "?" . $parameters;
     $requestBody = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
     $requestBody .= '<request name="' . $serviceName . '">' . "\n";
     $requestBody .= '  <properties>' . "\n";
     $requestBody .= '    <property name="appId" value="' . $this->PIDS_APP_ID . '" />' . "\n";
     $requestBody .= '    <property name="identifier" value="' . $userIdentifier . '" />' . "\n";
     $requestBody .= '    <property name="authDomain" value="' . $userDomain . '" />' . "\n";
     $requestBody .= '  </properties>' . "\n";
     $requestBody .= '</request>';
     $result = curl_post($requestURI, $requestBody, array("Content-Type: text/plain"));
     if ($result) {
         $resultXML = $result;
     }
     return $resultXML;
 }
function check_services()
{
    $CI =& get_instance();
    $solr_status = curl_post(get_config_item('solr_url') . 'admin/ping?wt=json', '', array());
    $solr_status = json_decode($solr_status, true);
    $data['message'] = '';
    if (!$solr_status) {
        $data['message'] = 'SOLR Service is unreachable. please check the SOLR URL in global config: ' . $CI->config->item('solr_url');
    } else {
        if ($solr_status['responseHeader']['status'] != 0) {
            $data['message'] = 'SOLR ping service returns ' . $solr_status['responseHeader']['status'] . ', please check your SOLR configuration';
        } else {
            $data['message'] = 'Unknown error';
        }
    }
    if (!$solr_status || !isset($solr_status['responseHeader']['status']) && !$solr_status['responseHeader']['status'] == 0) {
        $error = $CI->load->view('soft500', $data, true);
        echo $error;
        die;
    }
}
Example #22
0
$siteInfo = json_decode(curl_post('https://database:8888/sites.json'), true);
$siteInfo = $siteInfo['sites'];
$schoolNames = array();
foreach ($sites as $site) {
    // for this site what is your target number of participants?
    $target = 500;
    if (isset($siteInfo[$site]['numTargetPart'])) {
        $target = intval($siteInfo[$site]['numTargetPart']);
    }
    $url = 'https://database:8888/getParticipantsServer.php';
    $params = array();
    $params['action'] = 'load';
    $params['site'] = $site;
    $params['username'] = $user_name;
    $partByDateBySite[$site] = array();
    $participants = json_decode(curl_post($url, $params), true);
    // provide output array with stats
    $output["#" . $site] = array("text", "Total number of " . $site . " participants: " . count($participants));
    // add partitipant dates to partByDateBySite
    foreach ($participants as $part) {
        if (isset($part['entryType']) && $part['entryType'] == 'ABCD') {
            $partByDateBySite[$site][] = $part['events'][0]['serverdate'];
        }
    }
    // get all status codes
    $statuscodes = array();
    foreach ($participants as $c) {
        if (!in_array($c['status'], array_keys($statuscodes))) {
            $statuscodes[$c['status']] = 1;
        } else {
            $statuscodes[$c['status']] = $statuscodes[$c['status']] + 1;
Example #23
0
        echo json_encode($data);
        return 0;
    }
    $member_name = trim(addslashes($_REQUEST['member_name']));
    $password = trim(addslashes($_REQUEST['password']));
    $params['type_name'] = 'm2o';
    $params['member_name'] = $member_name;
    $params['password'] = $password;
}
if ($type == 'sina_weibo') {
    header("location:" . SSO_SINA_LOGIN);
    exit;
}
if ($type == 'qq_weibo') {
    header("location:" . SSO_QQ_LOGIN);
    exit;
}
$reffer = addslashes($_SERVER['HTTP_REFERER']);
$params['reffer'] = $reffer;
$params['login_type'] = $type;
$params['a'] = 'login';
$params['r'] = 'login';
$url = SSO_M2O_LOGIN;
$ch = curl_init();
$ret = curl_post($ch, $url, $params);
curl_close($ch);
echo $ret;
exit;
?>

Example #24
0
File: wap.php Project: nanfs/lt
    require_once ROOTPATH . 'include/export.func.php';
    $met_file = '/dimensional.php';
    //$met_dimensional_logo=$met_weburl.str_replace('../','',$met_dimensional_logo);
    $met_dimensional_logo_file = file_get_contents(ROOTPATH . str_replace('../', '', $met_dimensional_logo));
    $met_dimensional_logo_file = urlencode($met_dimensional_logo_file);
    $met_weburl_mobile = $met_weburl;
    if ($met_wap_tpb) {
        if ($met_langok[$lang][link]) {
            $met_weburl_mobile = $met_langok[$lang][link];
        }
        if ($met_wap_url) {
            $met_weburl_mobile = $met_wap_url;
        }
    }
    $post = array('text' => $met_weburl_mobile, 'w' => $wap_dimensional_size, 'logo' => $met_dimensional_logo_file);
    $re = curl_post($post, 30);
    if (!file_exists('../../../upload/files/')) {
        mkdir('../../../upload/files/');
    }
    file_put_contents('../../../upload/files/dimensional.png', $re);
    require_once $depth . '../include/config.php';
    echo '../../../upload/files/dimensional.png?' . met_rand(4);
    die;
}
if ($action == 'modify') {
    if ($met_wapshowtype == 0) {
        $met_wap_ok = 0;
    } else {
        $query = "update {$met_column} SET wap_ok = '0' where lang='{$lang}'";
        $db->query($query);
        if ($f_columnlist != ',') {
Example #25
0
# MetInfo Enterprise Content Management System
# Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved.
$depth = '../';
require_once $depth . '../login/login_check.php';
require_once ROOTPATH . 'include/export.func.php';
if ($action == 'deqing') {
    $query = "delete from {$met_sms} ";
    $db->query($query);
    metsave('../app/sms/smsnotes.php?lang=' . $lang . '&anyid=' . $anyid . '&cs=' . $cs, '', $depth);
}
$total_pass = $db->get_one("SELECT * FROM {$met_otherinfo} WHERE lang='met_sms'");
if ($total_pass && $action == "getdate") {
    $met_file = '/sms/smsnotes.php';
    $post = array('md5' => $total_pass['authpass']);
    $json = curl_post($post, 30);
    if ($json != 'not') {
        $list = json_decode($json, true);
        foreach ($list as $key => $val) {
            if ($val['content'] != '') {
                $query = "INSERT INTO {$met_sms} SET\n\t\t\t\t\ttime     ='{$val['time']}',\n\t\t\t\t\ttype     ='{$val['type']}',\n\t\t\t\t\tcontent  ='{$val['content']}',\n\t\t\t\t\ttel      ='{$val['tel']}',\n\t\t\t\t\tremark   ='{$val['remark']}'";
                $db->query($query);
            }
        }
    }
    echo 'ok';
    die;
}
$serch_sql = " where time!='' ";
if ($notes_type == NULL) {
    $notes_type = -1;
Example #26
0
 public function syncAdminUser()
 {
     $obj = new adminuser();
     $res = $obj->addRole();
     foreach ($res as $info) {
         $post['dosubmit'] = 1;
         $post['info'] = $info;
         $a = curl_post(ADDROLE, $post);
     }
     $res = $obj->addUser();
     foreach ($res as $info) {
         $post['dosubmit'] = 1;
         $post['info'] = $info;
         curl_post(ADDUSER, $post);
     }
 }
 function addTag()
 {
     header('Cache-Control: no-cache, must-revalidate');
     header('Content-type: application/json');
     set_exception_handler('json_exception_handler');
     $data = json_decode(file_get_contents("php://input"), true);
     $data = $data['data'];
     $data['user'] = $this->user->name();
     $data['user_from'] = $this->user->authDomain() ? $this->user->authDomain() : $this->user->authMethod();
     $fields = '';
     foreach ($data as $key => $value) {
         $fields .= $key . '=' . rawurlencode($value) . '&';
     }
     //build the string
     $content = curl_post(base_url() . 'registry/services/rda/addTag', $fields, array('header' => 'multipart/form-data'));
     $this->_dropCache($data['id']);
     echo $content;
 }
Example #28
0
function getPage($tid, $rn = 2, $pn = 1)
{
    global $bduss;
    $pd = array('BDUSS=' . $bduss, '_client_id=wappc_1414916745130_706', '_client_type=2', '_client_version=6.4.6', '_phone_imei=357143042411618', 'back=0', 'kz=' . $tid, 'net_type=3', 'pn=' . $pn, 'rn=' . $rn, 'with_floor=1');
    return json_decode(curl_post($pd, 'http://c.tieba.baidu.com/c/f/pb/page'));
}
<?php

include "functions.php";
include "config.php";
$data = array('action' => 'woocommerce_json_api', 'proc' => 'get_system_time', 'arguments' => array('token' => $token));
$result = curl_post($url, $data);
echo "Result is: \n\n";
echo $result;
echo "\n\n";
print_r(json_decode($result, true));
echo "\n\n";
switch (json_last_error()) {
    case JSON_ERROR_NONE:
        echo ' - No errors';
        break;
    case JSON_ERROR_DEPTH:
        echo ' - Maximum stack depth exceeded';
        break;
    case JSON_ERROR_STATE_MISMATCH:
        echo ' - Underflow or the modes mismatch';
        break;
    case JSON_ERROR_CTRL_CHAR:
        echo ' - Unexpected control character found';
        break;
    case JSON_ERROR_SYNTAX:
        echo ' - Syntax error, malformed JSON';
        break;
    case JSON_ERROR_UTF8:
        echo ' - Malformed UTF-8 characters, possibly incorrectly encoded';
        break;
    default:
Example #30
0
/**
 * 多URL抓取函数,获取指定urllist的内容。如果urllist内的URL抓取成功则返回,
 * 否则抓取下一个URL;全部失败则报错、程序退出
 *
 * @param array   $url      请求的URL列表(数组),必须是绝对URL
 * @param array   $param    参数列表,是Hash数组的引用
 * @param string  $method   请求的方法, 可选0- GET请求(默认请求方式),1- POST请求
 * @param int     $timeout  超时时间
 * @param array   $headers  HTTP头,是Hash数组的引用
 * @param int     $isdie    失败是否退出发布,
 *                           '1',表示一旦失败则终止发布,此为默认值;
 *                           '0',请求失败也继续发布;
 * @return
 */
function get_urllist_data($urllist, $param = array(), $method = 0, $timeout = 5, $headers = array(), $isdie = 1)
{
    $errors = '';
    foreach ($urllist as $url) {
        if (0 == $method) {
            $re = curl_get($url, $param, $headers, $timeout, $isdie);
        } else {
            $re = curl_post($url, $param, $header, $timeout, $isdie);
        }
        if (false === $re['result']) {
            0 == $isdie && ($errors .= $url . ":\n" . $re['error'] . "\n");
        } else {
            return $re['result'];
        }
    }
    if (1 == $isdie) {
        exit(__FUNCTION__ . '函数操作失败');
    } else {
        return $errors;
    }
}