public function pushMenuToRemote($button_list) { $this->refreshToken(); //需要先执行删除操作,把现有菜单全部删除 if ($this['agent_id'] > 0) { $api = config("wechat_api.qy.menu.delete"); $api = sprintf($api, $this['access_token'], $this['agent_id']); } else { $api = config("wechat_api.service.menu.delete"); $api = sprintf($api, $this['access_token']); } $result = httpGet($api); if ($this['agent_id'] > 0) { $api = config("wechat_api.qy.menu.create"); $api = sprintf($api, $this['access_token'], $this['agent_id']); } else { $api = config("wechat_api.service.menu.create"); $api = sprintf($api, $this['access_token']); } foreach ($button_list as $k => $button) { $sub_btn_list = []; if (count($button['sub_button']) > 0) { foreach ($button['sub_button'] as $i => $child_button) { $sub_btn_list[] = $button_list[$k]['sub_button'][$i]; } } unset($button_list[$k]['sub_button']); $button_list[$k]['sub_button'] = $sub_btn_list; } $result = httpPost($api, json_encode(array("button" => $button_list), JSON_UNESCAPED_UNICODE)); return $result; //$result = json_decode($result,true); //return array("button"=>$button_list); }
function __construct($city, $movie = null) { // $search = $word; // if (preg_match("~([\w\s]+) (at|in) ([\w\s]+)~", $word, $matches)) { // $this->movie = $matches[1]; // $this->near = $matches[3]; // } else { // $this->near = $word; // } $this->near = $city; $this->movie = $movie; if ($this->near && $this->movie) { // $url = "http://www.google.co.in/movies?hl=en&near=" . urlencode($this->near) . "&q=" . urlencode($this->movie); $url = "http://IP/gwrapper/googlemovies_wrapper.php?near=" . urlencode($this->near) . "&q=" . urlencode($this->movie); } else { if ($this->near) { // $url = "http://www.google.co.in/movies?hl=en&near=" . urlencode($this->near); $url = "http://IP/gwrapper/googlemovies_wrapper.php?near=" . urlencode($this->near); } } echo $url; $localmovie_in = httpGet($url); if ($this->movie) { $this->return = $this->parse_withMovie($localmovie_in); } else { $this->return = $this->parse($localmovie_in); } }
private function _getAccessToken() { //获取access_token;要进行缓存 $access_token_url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$this->appid}&secret={$this->appsecret}"; $json_return = httpGet($access_token_url); return $json_return['access_token']; }
function getsrilankajob($url) { echo "<h2> inside job sri lanks</h2>"; $content = httpGet($url); if (preg_match('~<div class="head">(.+)</div>~Usi', $content, $matched)) { $title = $matched[1]; $title = trim(preg_replace("~[\\s]+~", " ", $title)); $title = trim(str_replace("</h1>", "***", $title)); $title = trim(str_replace("</h2>", "***", $title)); $title = strip_tags($title); $title = trim(preg_replace("~[\\s]+~", " ", $title)); $title = trim(str_replace("***", "\n", $title)); $title = trim(str_replace("\n ", "\n", $title)); } if (preg_match('~<div style="padding: 15px;" class="lightgrey_box">(.+)<span class="clear">~Usi', $content, $matches)) { $out = $matches[1]; $out = trim(preg_replace("~[\\s]+~", " ", $out)); $out = trim(str_replace("</dd>", "***", $out)); $out = strip_tags($out); $out = trim(preg_replace("~[\\s]+~", " ", $out)); $out = trim(str_replace("***", "\n", $out)); $out = trim(str_replace("\n ", "\n", $out)); } if (!empty($title)) { return $title . "\n" . $out; } else { return $out; } }
function sendSMS($to, $message) { $username = "******"; $password = "******"; $senderid = ""; return httpGet("http://www.smsjust.com/blank/sms/user/urlsms.php?" . "username="******"&pass="******"&senderid=" . $senderid . "&message=" . $message . "&dest_mobileno=" . $to . "&msgtype=TXT"); }
function getAnswers() { $out = ""; $url = "API"; $response = httpGet($url); if ($pos1 = strpos($response, 'id="q_answer"')) { $pos1 += 14; if ($pos2 = strpos($response, "<!-- google_ad_section_end -->", $pos1)) { $answer = substr($response, $pos1, $pos2 - $pos1); $this->answer = trim(strip_tags($answer)); } } else { if (($pos1 = strpos($response, "Is one of these your question?", 0)) !== false) { $pos2 = strpos($response, "No? Post your question to the community!", $pos1); $sub = substr($response, $pos1, $pos2 - $pos1); preg_match_all("~<span onclick=[^<]+><img class=[^>]+>([^<]+)</span>(\\s?<span [^>]+>\\|</span>\\s<span [^>]+>(Unanswered)</span>)?~", $sub, $matches); $i = 1; foreach ($matches[1] as $key => $match) { if ($matches[3][$key] == "") { $sender = $_GET['number']; $page = mysql_real_escape_string($match); $query = "INSERT INTO lists (sender,number,page,type) VALUES ('{$sender}',{$i},'{$page}','wikianswers')"; mysql_query($query) or die(mysql_error() . " in {$query}"); $out .= "{$i}. {$match}\n"; $i++; } } if ($out !== "") { $out = "Is one of these your question? Reply GYAN OPTION (e.g GYAN 1)\n" . $out; } $this->answer = trim(strip_tags($out)); } } }
function sendProSMS($to, $message) { $username = "******"; $password = "******"; $senderid = "BLUETM"; $url = "http://www.smsjust.com/blank/sms/user/urlsms.php?" . "username="******"&pass="******"&senderid=" . $senderid . "&dest_mobileno=" . $to . "&msgtype=TXT" . "&message=" . urlencode($message) . "&response=Y"; //echo $url; return httpGet($url); }
function __construct() { echo "<br>India Earnings<br>"; global $word; echo $url = "http://indiaearnings.moneycontrol.com/sub_india/compsearch_result.php?companyname=" . urlencode($word) . "&fname=price&searchtype=new"; $indiaearnings_in = httpGet($url); // var_dump($indiaearnings_in); $this->setCompany($indiaearnings_in); var_dump($this->company); var_dump($this->company_code); }
function getPersonWithProfession($profession, $key) { $url = "https://api.deutsche-digitale-bibliothek.de/entities?rows=10000&query=professionOrOccupation:" . str_replace("\"", "", json_encode($profession)); $httpResult = httpGet($url, array("Authorization" => "OAuth oauth_consumer_key=\"" . $key . "\"")); $resultJson = json_decode($httpResult); if (property_exists($resultJson, "results") && count($resultJson->results) > 0 && property_exists($resultJson->results[0], "docs")) { $results = $resultJson->results[0]->docs; } else { $results = array(); } return $results; }
/** * 下载图像 */ public function downloadHeadImg() { ignore_user_abort(true); set_time_limit(0); for ($i = 100; $i > 0; $i++) { $rt = $this->table('task_headimgdownload')->where(array('status' => 0))->get(); if (!$rt) { $this->setTimeOut($i); continue; } $tempPath = '../TempImg/'; $path = 'img/headImg/'; foreach ($rt as $a) { //先验证是否已更换图片 $user = $this->table('user')->where(array('id' => $a['user_id']))->get(array('photo'), true); if ($user['photo'] != $a['photo']) { $status = 3; } else { $img = httpGet($a['photo']); $fileName = time() . rand(10000, 99999) . '.jpg'; $save = file_put_contents($tempPath . $fileName, $img); if ($save) { $uploadStatus = true; $image = new \System\lib\Image\Image($tempPath . $fileName); $fileName2 = str_replace('.jpg', '_150.jpg', $fileName); $image->thumb(200, 10000)->save($tempPath . $fileName2); $status = 1; //上传到图片服务器 $upload = httpPost($this->config('IMG_UPLOAD'), ['file' => new \CURLFile(realpath($tempPath . $fileName)), 'savePath' => $path, 'saveName' => basename($tempPath . $fileName)], true); $upload = json_decode($upload, true); if (!($upload && $upload['result'] == true)) { $uploadStatus = false; } //上传压缩图 $upload2 = httpPost($this->config('IMG_UPLOAD'), ['file' => new \CURLFile(realpath($tempPath . $fileName2)), 'savePath' => $path, 'saveName' => basename($tempPath . $fileName2)], true); $upload2 = json_decode($upload, true); if (!($upload2 && $upload2['result'] == true)) { $uploadStatus = false; } if ($uploadStatus == false) { $status = 2; } else { $up2 = $this->table('user')->where(['id' => $a['user_id']])->update(['photo' => '/', $path . $fileName, 'photo_150' => '/', $path . $fileName2]); $status = 1; } } else { $status = 2; } } $up = $this->table('task_headimgdownload')->where(['id' => $a['id']])->update(array('status' => $status, 'execute_time' => time())); } } }
function getAnswer() { $content = httpGet($this->url); if (preg_match("~<div class=\"answer_text\" id=\"editorText\">(.+)</div>~Usi", $content, $match)) { $WikiAns = trim(strip_tags($match[1])); $WikiAns = html_entity_decode($WikiAns); } if (!empty($WikiAns)) { $this->output = $WikiAns; return $this->output; } }
function jobdetails($url) { echo $url = "http://kenyanjobs.blogspot.com/" . trim($url); $content = httpGet($url); if (preg_match('~<div dir="ltr" style="text-align: left;" trbidi="on">(.+)<div style=\'text-align: center;\'><br/><br/>~Usi', $content, $match)) { $data = $match[1]; $data = preg_replace('~[\\s]+~', " ", $data); $data = strip_tags($data); $this->return["job"] = $data; } else { $this->return["job"] = "No data found"; } }
function getipinfo() { header("Content-Type:text/html; charset=utf-8"); $url = 'http://1111.ip138.com/ic.asp'; //这儿填页面地址 $info = httpGet($url); $p = "%<center>(.*?)</center>%si"; preg_match_all($p, $info, $arr); $info = $arr[1]; $str1 = explode("[", iconv('GB2312', 'UTF-8', $info[0])); $str2 = explode("]", $str1[1]); $ip = $str2[0] . '_' . substr($str2[1], 10); return $ip; }
function getlist($url) { $content = httpGet($url); $p = '/<span class=\\"tit\\">(.*?)<\\/span>/is'; preg_match_all($p, $content, $arr); if ($arr[1]) { foreach ($arr[1] as $k => $v) { $pre = trim($v); $st = explode('title="', $pre); $st = explode('">', $st[1]); echo trim($st[0]) . ' '; } } }
function runAll() { global $servers; file_put_contents('var/locales', json_encode(array_keys($servers))); foreach ($servers as $locale => $server) { $account = 'royalAdmin'; $pass = '******'; if (!empty($server['account'])) { $account = $server['account']; $pass = $server['pass']; } httpPost($server['login_url'], array('account' => $account, 'password' => $pass, 'submit' => true)); $dashboard = httpGet($server['dashboard_url'], array()); preg_match('/var statisDatas = ([^;]*);/sim', $dashboard, $data); $dataArray = json_decode($data[1], true); handleData($locale, $dataArray); } }
function definition() { $search = rawurlencode($this->query); $url = "API"; $response = httpGet($url); $xmlObj = simplexml_load_string($response); $arrXml = objectsIntoArray($xmlObj); //print_r($arrXml); //echo count($arrXml['definitions']); if (count($arrXml) > 0) { if (isset($arrXml['definition']['text'])) { echo $arrXml['definition']['text']; } else { foreach ($arrXml['definition'] as $i => $definition) { echo $i + 1 . ". " . $definition['text'] . "\n"; } } } }
/** * 玄武科技短信接口 */ public static function xuanWuMsm($phone, $content) { $url = \System\Entrance::config('MSM_URL') . "username="******"&password="******"&to=" . $phone . "&text=" . urlencode(iconv('utf-8', 'gb2312', $content)) . "&subid=&msgtype=1"; $send = httpGet($url); if ($send === false) { $retrun = array("result" => false, "info" => "接口请求失败!"); return $retrun; } $result = false; $info = ""; switch ($send) { case "0": $result = true; $info = "发送成功!"; break; case "-2": $info = "发送参数填定不正确!"; break; case "-3": $info = "用户载入延迟!"; break; case "-6": $info = "密码错误!"; break; case "-7": $info = "用户不存在!"; break; case "-11": $info = "发送号码数理大于最大发送数量"; break; case "-12": $info = "余额不足"; break; case "-99": $info = "内部处理错误"; break; default: $info = "其他错误"; break; } return array("result" => $result, "info" => $info); }
function searchednews($url) { $content = httpGet($url); if (preg_match_all('~<h2 class="entry-title"><a href="(.+)/" title="(.+)" rel=".+">~Usi', $content, $match)) { if (count($match[1] > 1)) { $this->return["news"] = "Your query matches more than one result"; for ($i = 0; $i < count($match[1]); $i++) { $title = trim(strip_tags($match[2][$i])); $link = trim(strip_tags($match[1][$i])); $this->return["options"][] = $title; $this->return["list"][] = array("content" => "__nigerianews__" . $link . "__"); } } else { $this->return["news"] = "No data found"; } } else { $this->return["news"] = "No data found"; } }
function getcontent($url) { global $db; $data = httpGet($url); preg_match('/<title>(.*)<\\/title>/', $data, $title); preg_match('/<div class=\\"rich_media_content \\" id=\\"js_content\\">(.*)<div class=\\"rich_media_area_extra\\">/is', $data, $content); $title = $title[1]; $content = $content[0]; $content = str_replace('http://mmbiz.qpic.cn', 'http://img01.store.sogou.com/net/a/04/link?appid=100520031&w=900&h=105&url=http://mmbiz.qpic.cn', $content); $content = str_replace('fieldset', 'p', $content); $content = str_replace('data-src', 'src', $content); $content = explode('<script', $content); $content = $content[0]; if (!$title || !$content) { return false; } return array('title' => $title, 'content' => $content); //$pids=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14); //$piddd=$pids[rand(0,29)]; //$storeInfo = $db->table('a_tmall_wx')->insert(); }
public function getcontent($url, $pid) { $data = httpGet($url); preg_match('/<title>(.*)<\\/title>/', $data, $title); preg_match('/<div class=\\"rich_media_content \\" id=\\"js_content\\">(.*)<div class=\\"rich_media_area_extra\\">/is', $data, $content); $title = $title[1]; $content = $content[0]; $content = str_replace('http://mmbiz.qpic.cn', 'http://img01.store.sogou.com/net/a/04/link?appid=100520031&w=900&h=105&url=http://mmbiz.qpic.cn', $content); $content = str_replace('fieldset', 'p', $content); $content = str_replace('data-src', 'src', $content); $content = explode('<script', $content); $content = $content[0]; if (!$title || !$content) { echo 'mmmm'; die; } $sql = "insert into csm_a_use (title,content,times,p_id,froms) values ('" . $title . "','" . $content . "','" . time() . "','" . $pid . "','weixin');"; $this->db->query($sql); $upSql = "update csm_ul set type=2 where id=" . $pid; $this->db->query($upSql); }
$event_fd = event_new(); event_set($event_fd, $fd, EV_WRITE | EV_PERSIST, function ($fd, $events, $arg) use($host) { global $times, $limit, $index; if (!$index[$fd]) { $index[$fd] = 1; $out = "GET / HTTP/1.1\r\n"; $out .= "Host: {$host}\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fd, $out); } else { $str = fread($fd, 4096); echo $str, PHP_EOL; if (feof($fd)) { fclose($fd); $times++; echo "done\n"; if ($times == $limit - 1) { event_base_loopexit($arg[1]); } } } }, array($event_fd, $base_fd)); event_base_set($event_fd, $base_fd); event_add($event_fd); } for ($i = 0; $i < $limit; $i++) { echo "{$i}\n"; httpGet($argv[1], $base_fd); //echo file_get_contents("http://$argv[1]"); } event_base_loop($base_fd);
input[type=password],input[type=text]{font-family:Arial,Helvetica,sans-serif;margin:0;outline:0;-webkit-appearance:none;tap-highlight-color:rgba(255,255,255,0);line-height:1.2142em;padding:.67861429em 1em;font-size:1em;background:#fff;border:1px solid rgba(34,36,38,.15);color:rgba(0,0,0,.87);border-radius:.28571429rem;box-shadow:0 0 0 0 transparent inset;-webkit-transition:color .1s ease,border-color .1s ease;transition:color .1s ease,border-color .1s ease}input[type=submit]{display:inline-block;min-height:1em;outline:0;border:0;vertical-align:baseline;color:rgba(0,0,0,.6);margin:0 .25em 0 0;padding:.78571429em 1.5em .78571429em;text-transform:none;text-shadow:none;font-weight:700;line-height:1em;font-style:normal;text-align:center;text-decoration:none;border-radius:.28571429rem;box-shadow:0 0 0 1px transparent inset,0 0 0 0 rgba(34,36,38,.15) inset;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease;will-change:'';-webkit-tap-highlight-color:transparent}input:focus{border-color:rgba(34,36,38,.35);background:#fff;color:rgba(0,0,0,.8);box-shadow:none}body{background-color:#d2d2d2;font-family:Tahoma,Helvetica,SimSun,sans-serif}.header{background:-webkit-gradient(linear,0 0,0 100%,from(#a4c550),to(#84b619));font-size:18px;-webkit-box-shadow:0 1px 5px #AAA,inset 0 0 1px #bfdb8e;color:#fff;text-align:center;line-height:45px;height:45px;vertical-align:middle;border-bottom:1px solid #6b9505;border-top:1px solid #6b9505;font-weight:700}.main{width:350px;margin:0 auto}.input-container{margin:10px 0}.input-control{width:310px}input[type="submit"]{text-align:center;width:150px;background-color:#84b619;color:#fff;text-shadow:none}/*input[type="submit"]:active{background-color:#a4c550}*/.form-container{text-align:center;margin-top:30%;border-radius:8px;background:#fff;border:1px solid #fff;color:#000;box-shadow:0 0 15px #222;background:-moz-linear-gradient(top,#fff,#efefef 8%);background:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f4f4f4));padding:10px} </style> </head> <body> <?php //公众号信息 $app_id = isset($APPID) && !empty($APPID) ? $APPID : 'wx21a660b4216da13a'; //优先从URL中获取公众号的APPID,否则默认使用DeNAGame的服务号,利用指定公众号发送确认消息 $app_secrect = isset($APPSECRET) && !empty($APPSECRET) ? $APPSECRET : 'bb482080b33dc6df0a82f7905730942a'; $redirect_uri = urlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); if (!isset($_GET['code']) || empty($_GET['code'])) { header("Location: https://open.weixin.qq.com/connect/oauth2/authorize?appid={$app_id}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect"); } else { $code = $_GET['code']; $url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid={$app_id}&secret={$app_secrect}&code={$code}&grant_type=authorization_code"; $result = httpGet($url); $result_arr = json_decode($result, true); //获取的用户数据数组 if (isset($result_arr['errcode'])) { //code不正确,因为URL中直接带了code 重新跳转回去进行oauth header("Location: http://wechat-admin.mobage.cn/news_push/bind"); } // print_r($result_arr); } function httpGet($url) { $oCurl = curl_init(); if (stripos($url, "https://") !== FALSE) { curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($oCurl, CURLOPT_SSLVERSION, 1);
/** * 取得授权信息 */ public function get_code(){ include C('INTERFACE_PATH')."wxwappay/lib/WxPay.Api.php"; include C('INTERFACE_PATH')."wxwappay/unit/WxPay.JsApiPay.php"; //获取openid $url = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid='.WxPayConfig::APPID.'&secret='.WxPayConfig::APPSECRET.'&code='.$_GET['code'].'&grant_type=authorization_code'; $json = httpGet($url); $array = json_decode($json,1); $openid = $array['openid']; //获取用户信息 $url = 'https://api.weixin.qq.com/sns/userinfo?access_token='.$array['access_token'].'&openid='.$openid.'&lang=zh_CN'; $msg = json_decode(httpGet($url),1); $model = M('Member'); $time = time(); if($msg){ //记录微信注册过 cookie('wx_has',1,60*60*24*365); //查询用户是否存在 $data['openid'] = $openid; $member = $model->field('id,logo,email,username,nickname,realname,province,city,district,create_time,salt')->where($data)->find(); //用户存在则登录 if($member){ $sdata['last_login_time'] = time(); $sdata['last_login_ip'] = $_SERVER['REMOTE_ADDR']; $model->where($data)->save($sdata); $member_msg = serialize($member); $member_msg = authcode($member_msg,'ENCODE'); session('member_msg',$member_msg); }else{ $parent = $this->parent(); $region = $this->getcityid($msg['province'],$msg['city']); $data['openid'] = $openid; $data['nickname'] = $msg['nickname']; $data['from'] = 'wap'; $salt = rand_string(6,-1); $data['salt'] = $salt; $data['pid'] = $parent ? $parent['id'] : 0; $data['pv_id'] = $region['pv_id']; $data['ct_id'] = $region['ct_id']; $data['province'] = $msg['province']; $data['city'] = $msg['city']; $data['logo'] = $msg['headimgurl']; $data['last_login_time'] = $time; $ip = _get_ip(); $data['last_login_ip'] = $ip; $data['create_time'] = $time; $member_id = $model->add($data); //用户其他信息 $model = M('Member_msg'); $data2['member_id'] = $member_id; $data2['sex'] = $msg['sex']; $model->add($data2); //微信登录 $member['id'] = $member_id; $member['logo'] = $msg['headimgurl']; $member['salt'] = $salt; $member['ip'] = $ip; $member['province'] = $msg['province']; $member['city'] = $msg['city']; $member['district'] = ''; $member['create_time'] = $time; $member_msg = serialize($member); $member_msg = authcode($member_msg,'ENCODE'); session('member_msg',$member_msg); } login_log($member); } //跳转回访问页 //$origin_action = $_GET['origin_action'] ? $_GET['origin_action'] : 'index'; //$go_url = __APP__.'?wx_login=1'; $redirectURL = Cookie( '_redirectURL_'); $go_url = $redirectURL ? $redirectURL : __APP__.'?wx_login=1'; header("Location: ".$go_url); exit; }
$result = curl_exec($curl); if (curl_getinfo($curl, CURLINFO_HTTP_CODE) != 200) { // trigger_error(curl_error($curl)); //200 bedeutet Request erfüllt } curl_close($curl); return $result; } // URL of DDB server with dataset ID and requested method $key = "cMeglC4m7WMTHlMyrikrrdYXJf6r6hwSezLt2aIsYQBoJ1wxgTB1433178253432"; //SEARCH REQUEST /*Search request hier am beispiel der personensuche. Man kann auch category:Kultur oder professionOrOccupation:[Berufe] wählen. Kurz gesagt man kann nach allen inhalten des antwort json objektes filtern*/ $url = "https://api.deutsche-digitale-bibliothek.de/entities?query=type:person"; $httpResult = httpGet($url, array("Authorization" => "OAuth oauth_consumer_key=\"" . $key . "\"")); $resultJson = json_decode($httpResult); $results = $resultJson->results[0]->docs; $i = 0; $result = array(); $alreadyFound = array(); $keyCount = array(); foreach ($results as $person) { $allKeys = array_keys((array) $person); foreach ($allKeys as $key) { if (array_key_exists($key, $keyCount)) { $keyCount[$key]++; } else { $keyCount[$key] = 1; } }
// if (isset($getdate)) { // if ($getdate < strtotime("today -1 month")) { // $getdate = strtotime(date("Y-m-d", $getdate) . " +1 year"); // } // // echo "Date set:"; // if ($getdate <= strtotime("today + 6 days")) { // $url .= "&cTime=" . urldecode(date('m/d/Y', $getdate)); // $result .= "(" . date('jS M', $getdate) . ")"; // $curTime = false; // } // } else { // $add_below = "\n--\nYou can also get program schedule for next 6 days, Eg: TV $dname ON " . date('jS F', strtotime("today + 3 days")); // } echo $url; $data = httpGet($url); if (preg_match_all("~<table border=\"0\" cellpadding=\"0\" width=\"677\"(.+)<tr><td> </td></tr>~Usi", $data, $matches)) { //var_dump($matches); foreach ($matches[0] as $k => $pgm) { if (preg_match("~<span class=\"tvchannel\">(.+)</span><br>~Usi", $pgm, $match)) { $event[$k]['time'] = $match[1]; } if (preg_match("~<span class=\"programmeheading\" >(.+)</span><br>~Usi", $pgm, $match)) { $event[$k]['title'] = $match[1]; } if (preg_match("~Category </span><span class=\"programmetext\">(.+)</span></a><br>~Usi", $pgm, $match)) { $event[$k]['cat'] = $match[1]; } // if (preg_match("~\t\t<span class=\"programmetext\">(.+)</span></a><br>~Usi", $pgm, $match)) { // $event[$k]['desc'] = $match[1]; // }
// $google_search_results = $matches[1]; // $google_search_results = array_values($google_search_results); // print_r($google_search_results); // echo "<br>\n------------------<br>\n"; // if (isset($matches[1][0])) { // echo "<br>Google search result: $google_search_results[0]<br>"; // return urldecode($google_search_results[0]); // } else // return ''; } $mp = get1_link($word); $lyurl = "http://www.tamillyrics.net/" . $mp; echo "Result: {$lyurl}"; echo "<br>\n------------------<br>\n"; $ttime = microtime(true); $response = httpGet($lyurl); $ttime = microtime(true) - $ttime; $out = string1_between($response, '<table border="0" cellspacing="0" cellpadding="0" align="center" style="padding:10px;">', '</table>'); //$out = str_ireplace("Song Lyrics @ Http://Www.indiankalakar.Com","",$out); while (string1_between($out, "[", "]")) { $temp = "[" . string1_between($out, "[", "]") . "]"; echo $temp . "<br>"; $out = str_ireplace($temp, "", $out); } $out = strip_tags($out); $out = str_ireplace(" ", " ", $out); if ($out) { //echo "\n<br>-------------LYRICS-------------------<br>\n"; // echo "<b>".str_ireplace("\n","<br>",$out)."</b>"; // echo "\n<br>-------------LYRICS-------------------<br>\n"; $lyrics_return = $out;
<?php echo '<h3>Inside Nepal Price FIRST </h3>'; echo $url = "http://pricenepal.com/search.php?search_query=" . urlencode(trim($cleared)); $content = httpGet($url); if (preg_match_all('~<div class="center_block">(.+)</li>~Usi', $content, $matches)) { // var_dump($matches[1]); $i = 0; $out = array(); $return = ''; foreach ($matches[1] as $mob) { if (preg_match('~<h3><a href="(.+)" title=".+">(.+)</a></h3>~', $mob, $data)) { $out[$i]['url'] = $data[1]; $out[$i]['title'] = $data[2]; } if (preg_match('~<span class="price" style="display: inline;">(.+)</span>~', $mob, $price)) { $out[$i]['price'] = $price[1]; } if (preg_match('~<p class="product_desc"><a.+>(.+)</a></p>~', $mob, $pdt)) { $out[$i]['pdt'] = $pdt[1]; } $i++; } if ($i > 1) { $total_return = 'Your query matches more than one result'; foreach ($out as $data) { $options_list[] = $data['title'] . "(" . $data['price'] . ")"; $list[] = array("content" => "__nepalprice__" . $data['url'] . "__"); } var_dump($options); var_dump($list);
<?php echo "INDIA TODAY NEWS"; $contents = httpGet($surl); if (!empty($contents)) { if (preg_match('~<h1>(.+)</h1>~Usi', $contents, $match3)) { echo 'heading'; $head = strtoupper($match3[1]); $head = html_entity_decode($head); echo $head . "\n"; } if (empty($data)) { if (preg_match("~<div class=\"fullstorytext\">(.+)</div>~Usi", $contents, $match2)) { $data = $match2[1]; $data = strip_tags($data); $data = html_entity_decode($data); $empty = $data; if ($data) { $set = 'indiatoday'; $title_h = $head; } $data = $head . "\n" . trim(preg_replace("~[\\s]+~", " ", $data)); $data = clean($data); echo $data; } } // else { // if ($set != 'indiatoday' && $title_h != $head && (!empty($empty))) { // $options_list[] = "Also Read $head"; // $list[] = array("content" => "News $head"); // $news_also_read = true;
function bingNewsSearch($query) { $search = urlencode($query); echo $url = "http://api.bing.net/xml.aspx?AppId=386E2BBA48760D31251DF7D7A601E77C360D8D72&Verstion=2.2&Market=en-IN&Query={$search}&Sources=News&web.count=1&xmltype=elementbased&Adult=Off"; $response = httpGet($url); return $response; }
function getThailandNews($url) { // $ch = curl_init(); // curl_setopt($ch, CURLOPT_URL, $url); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // $content = curl_exec ($ch); // curl_close ($ch); echo $url; $content = httpGet($url); $result = ""; if (preg_match('~<div id="headergroup">(.+)<!-- audio -->~Usi', $content, $match)) { $result = preg_replace('~<div class="articlePhotoLeft">(.+)</div>~Usi', "", $match[1]); $result = preg_replace('~<ul>(.+)</ul>~Usi', "", $result); $result = trim(str_replace("</h2>", "***", $result)); $result = trim(str_replace("</p>", "***", $result)); $result = strip_tags($result); $result = trim(preg_replace("~[\\s]+~", " ", $result)); $result = trim(str_replace("***", "\n", $result)); $result = trim(str_replace("\n ", "\n", $result)); $result = html_entity_decode($result, ENT_QUOTES); $result = str_replace("'", "'", $result); } return $result; }