function stock_val($n) { $snoopy = new snoopy(); $o = ""; $html = '<tr>'; $snoopy->fetch("http://stock.daum.net/item/main.daum?code=" . $n); $txt = $snoopy->results; $rex = "/\\<h2 onclick=\"GoPage.+\"\\>(.*)\\<\\/h2\\>/"; preg_match_all($rex, $txt, $o); //print_r($o[0][0]); $html .= '<td>' . $o[0][0] . '</td>'; $rex = "/\\<em class=\"curPrice.+\"\\>(.*)\\<\\/em\\>/"; preg_match_all($rex, $txt, $o); //print_r($o[0][0]); $html .= '<td>' . $o[0][0] . '</td>'; $html .= '</tr>'; return $html; }
protected function get_info($url) { //优先使用curl模式发送数据 if (function_exists('curl_init') == 1) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($curl, CURLOPT_TIMEOUT, 5); $get_content = curl_exec($curl); curl_close($curl); } else { include "snoopy.php"; $snoopy = new snoopy(); $snoopy->referer = 'http://www.google.com/'; //伪装来源 $snoopy->fetch($url); $get_content = $snoopy->results; } return $get_content; }
function check_smsbao_balance($account) { $user = $account['sms_user']; $pass = md5($account['sms_pass']); $smsapi = smsbao_api_url(); $snoopy = new snoopy(); $sendurl = "http://{$smsapi}/query?u={$user}&p={$pass}"; $snoopy->fetch($sendurl); $result = $snoopy->results; $code = explode("\n", $result); //返回代码类似 0\r 33123,1223 0表示成功,第一个数字表示已发送量,第二个数字表示剩余 if (count($code) === 1) { return smsbao_status($statusStr); } else { if ($code[0] == 0) { $balance = $code[1]; $balance = explode(",", $code[1]); // $already = $balance[0]; // $left = $balance[1]; return $balance; // return array("already" => $already, "left" => $left); } } }
/** * 快递单 * */ function exdelivry() { $id = IReq::get('id'); $tb_delivery_doc = new IQuery('delivery_doc as dd'); $tb_delivery_doc->fields = 'd.name,dd.delivery_code,fc.freight_name'; $tb_delivery_doc->where = 'order_id=' . $id; $tb_delivery_doc->join = 'left join delivery as d on dd.delivery_type=d.id left join freight_company as fc on d.freight_id=fc.id'; $delivery_info = $tb_delivery_doc->find(); $get_content = '暂无相关信息!'; if (count($delivery_info) > 0) { //获得用户申请的id $config = new Config("site_config"); $config_info = $config->getInfo(); $express_key = isset($config_info['express_key']) ? $config_info['express_key'] : ''; if ($express_key) { //获得物流名称和物流单号 $delivery_code = $delivery_info[0]['delivery_code']; $name = $delivery_info[0]['freight_name']; $get_content = '物流公司或者货运单号错误'; $type = '1'; if ($delivery_code != '' && $name != '') { $name = str_replace(' ', '', $name); $delivery_code = str_replace(' ', '', $delivery_code); $sUrl = $this->module->getBasePath(); include $sUrl . 'plugins/freight/company.php'; $company = new Company(); $name = $company->getCompany($name); $AppKey = $express_key; $url = 'http://api.kuaidi100.com/api?id=' . $AppKey . '&com=' . $name . '&nu=' . $delivery_code . '&show=2&muti=1&order=asc'; //请勿删除变量$powered 的信息,否者本站将不再为你提供快递接口服务。 $powered = '查询数据由:<a href="http://kuaidi100.com" target="_blank">KuaiDi100.Com (快递100)</a> 网站提供 '; //优先使用curl模式发送数据 if (function_exists('curl_init') == 1) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($curl, CURLOPT_TIMEOUT, 5); $get_content = curl_exec($curl); $type = '2'; curl_close($curl); } else { include $sUrl . 'plugins/freight/snoopy.php'; $snoopy = new snoopy(); $snoopy->referer = 'http://www.google.com/'; //伪装来源 $snoopy->fetch($url); $get_content = $snoopy->results; $type = '2'; } } } else { $get_content = '您还没有申请ID,请到<a href="http://kuaidi100.com" target="_blank">KuaiDi100.Com (快递100)</a>申请!'; } } $this->setRenderData(array('conent' => $get_content, 'type' => $type)); $this->redirect('exdelivry'); }
/** * Fetches and parses XML from Amazon for the given query. * @param string $query Query string containing variables to search Amazon for. Valid variables: $isbn, $title, $author * @return array Array containing each book's information. */ function query_amazon( $query ) { require_once dirname(__FILE__) . '/sha256.inc.php'; if (!function_exists('hmac')) { function hmac($key, $data, $hashfunc='sha256') { $blocksize=64; if (strlen($key) > $blocksize) $key=pack('H*', $hashfunc($key)); $key=str_pad($key, $blocksize, chr(0x00)); $ipad=str_repeat(chr(0x36), $blocksize); $opad=str_repeat(chr(0x5c), $blocksize); $hmac = pack('H*', $hashfunc(($key^$opad) . pack('H*', $hashfunc(($key^$ipad) . $data)))); return $hmac; } } global $item, $items; $options = get_option('nowReadingOptions'); $using_isbn = false; parse_str($query); if ( empty($isbn) && empty($title) && empty($author) ) return false; if ( !empty($isbn) ) $using_isbn = true; // Our query needs different vars depending on whether or not we're searching by ISBN, so build it here. if ( $using_isbn ) { $isbn = preg_replace('#([^0-9x]+)#i', '', $isbn); $query = "isbn:$isbn"; } else { $query=''; if ( !empty($title) ) $query = 'title:' . urlencode($title); if ( !empty($author) ) $query .= 'author:' . urlencode($author); } // these items MUST be set in the Options screen $AWSAccessKeyId = trim($options['AWSAccessKeyId']); $SecretAccessKey = trim($options['SecretAccessKey']); # // some paramters $method = "GET"; $host = "ecs.amazonaws".$options['domain']; $uri = "/onca/xml"; // additional parameters $params["Service"] = "AWSECommerceService"; // GMT timestamp $params["Timestamp"] = gmdate("Y-m-d\TH:i:s\Z"); // API version $params["Version"] = "2009-03-31"; $params["AssociateTag"] = urlencode($options['associate']); $params["Power"] = $query; $params["Operation"] = "ItemSearch"; $params["SearchIndex"] = "Books"; $params["ResponseGroup"] = "Request,Large,Images,AlternateVersions"; $params["AWSAccessKeyId"] = $AWSAccessKeyId; // Sort paramters ksort($params); // re-build the request $request = array(); foreach ($params as $parameter=>$value) { $parameter = str_replace("_", ".", $parameter); $parameter = str_replace("%7E", "~", rawurlencode($parameter)); $value = str_replace("%7E", "~", rawurlencode($value)); $request[] = $parameter . "=" . $value; } $request = implode("&", $request); $signatureString = $method . chr(10) . $host . chr(10) . $uri . chr(10) . $request; $signature = urlencode(base64_encode(hmac($SecretAccessKey, $signatureString))); $request = "http://" . $host . $uri . "?" . $request . "&Signature=" . $signature; // Fetch the XML using either Snoopy or cURL, depending on our options. if ( $options['httpLib'] == 'curl' ) { if ( !function_exists('curl_init') ) { return new WP_Error('curl-not-installed', __('cURL is not installed correctly.', NRTD)); } else { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $request); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'Now Reading ' . NOW_READING_VERSION); curl_setopt($ch, CURLOPT_HEADER, 0); if ( !empty($options['proxyHost']) ) { $proxy = $options['proxyHost']; if ( !empty($options['proxyPort']) ) { $proxy .= ":{$options['proxyPort']}"; } curl_setopt($ch, CURLOPT_PROXY, $proxy); } $xmlString = curl_exec($ch); curl_close($ch); } } else { require_once ABSPATH . WPINC . '/class-snoopy.php'; $snoopy = new snoopy; $snoopy->agent = 'Now Reading Redux' . NOW_READING_VERSION; if ( !empty($options['proxyHost']) ) $snoopy->proxy_host = $options['proxyHost']; if ( !empty($options['proxyHost']) && !empty($options['proxyPort']) ) $snoopy->proxy_port = $options['proxyPort']; $snoopy->fetch($request); $xmlString = $snoopy->results; } if ( empty($xmlString) ) { do_action('nr_search_error', $query); echo ' <div id="message" class="error fade"> <p><strong>' . __("Oops!") . '</strong></p> <p>' . sprintf(__("For some reason, I couldn't search for your book on amazon%s.", NRTD), $options['domain']) . '</p> <p>' . __("Amazon's Web Services may be down, or there may be a problem with your server configuration.") . '</p> '; if ( $options['httpLib'] ) echo '<p>' . __("Try changing your HTTP Library setting to <strong>cURL</strong>.", NRTD) . '</p>'; echo ' </div> '; return false; } require_once 'xml/IsterXmlSimpleXMLImpl.php'; $impl = new IsterXmlSimpleXMLImpl; $xml = $impl->load_string($xmlString); if ( $options['debugMode'] ) robm_dump("Amazon Search XML:", htmlentities(str_replace(">", ">\n", $xmlString))); $items = $xml->ItemSearchResponse->Items->children(); if (count($items) == 0) { return false; } $results = array(); foreach ($items as $item) { $attr = $item->ItemAttributes; if (!$attr) { continue; } $asin = $item->ASIN->CDATA(); if (empty($asin)) { continue; } // Get full meta-data given the current ISBN. Used to get all editions. $metaData = getMetadataFromIsbn($asin, $AWSAccessKeyId, $SecretAccessKey, urlencode($options['associate'])); if ($options['debugMode']) { robm_dump("Amazon Lookup XML:", htmlentities(str_replace(">", ">\n", $metaData))); } $metaDataParser = new IsterXmlSimpleXMLImpl; $metaDataXml = $metaDataParser->load_string($metaData); if (isset($metadata->ItemLookupResponse->Items->Request->Errors)) { continue;//$metadata->ItemLookupResponse->Items->Request->Errors; } $editions = $metaDataXml->ItemLookupResponse->Items->children(); if (count($editions) == 0) { continue; } // For each edition, add an entry. foreach ($editions as $edition) { if (!isset($edition->ASIN)) { continue; } $asin = $edition->ASIN->CDATA(); if (empty($asin)) { continue; } $title = $edition->ItemAttributes->Title->CDATA(); if (empty($title)) { continue; } $author = ''; if (is_array($edition->ItemAttributes->Author)) { foreach ($edition->ItemAttributes->Author as $a) { if (is_object($a)) { $author .= $a->CDATA() . ', '; } } $author = substr($author, 0, -2); } else { if (is_object($edition->ItemAttributes->Author)) { $author = $edition->ItemAttributes->Author->CDATA(); } } if (empty($author)) { $author = apply_filters('default_book_author', 'Unknown'); } $size = "{$options['imageSize']}Image"; if (empty($item->$size)) { continue; } $image = $item->$size->URL->CDATA(); if (empty($image)) { $image = get_option('siteurl') . '/wp-content/plugins/now-reading-redux/no-image.png'; } $binding = ''; if (isset($edition->ItemAttributes->Binding)) { $binding = $edition->ItemAttributes->Binding->CDATA(); } $ed = ''; if (isset($edition->ItemAttributes->Edition)) { $ed = $edition->ItemAttributes->Edition->CDATA(); } $date = ''; if (isset($edition->ItemAttributes->PublicationDate)) { $date = $edition->ItemAttributes->PublicationDate->CDATA(); } $publisher = ''; if (isset($edition->ItemAttributes->Publisher)) { $publisher = $edition->ItemAttributes->Publisher->CDATA(); } if ($options['debugMode']) { robm_dump("book:", $author, $title, $binding, $ed, $date, $publisher, $asin); } $results[] = apply_filters('raw_amazon_results', compact('author', 'title', 'binding', 'ed', 'date', 'publisher', 'image', 'asin')); } } $results = apply_filters('returned_books', $results); return $results; }
include_once "kuaidi100_config.php"; if (isset($postcom) && isset($getNu)) { $url = 'http://www.kuaidi100.com/applyurl?key=' . $kuaidi100key . '&com=' . $postcom . '&nu=' . $getNu; // echo $url; //请勿删除变量$powered 的信息,否者本站将不再为你提供快递接口服务。 $powered = '查询服务由:<a href="http://www.kuaidi100.com" target="_blank" style="color:blue">快递100</a> 网站提供'; //优先使用curl模式发送数据 if (function_exists('curl_init') == 1) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($curl, CURLOPT_TIMEOUT, 5); $get_content = curl_exec($curl); curl_close($curl); } else { include "snoopy.php"; $snoopy = new snoopy(); $snoopy->fetch($url); $get_content = $snoopy->results; } //$get_content=iconv('UTF-8', 'GB2312//IGNORE', $get_content); //if(strpos($get_content,'地点和跟踪进度')== false){ // echo '查询失败,请重试'; //} echo '<iframe src="' . $get_content . '" width="534" height="340" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"><br/>' . $powered; } else { echo '查询失败,请重试'; } exit;
function Getwuliu($wuliu) { //加载快递公司 $typeCom = $wuliu["logistics"]; $typeNu = $wuliu["logisticsid"]; include_once "ickd_companies.php"; //include 'ickd_companies.php'; $id = '106004'; //请将123456替换成您在http://www.ickd.cn/api/reg.html申请到的id $secret = '9fe2da6307dcb2eed35989466f98c136'; //您在http://www.ickd.cn/api/reg.html申请到的secret $url = 'http://api.ickd.cn/?id=' . $id . '&secret=' . $secret . '&com=' . $typeCom . '&nu=' . $typeNu . '&type=json&ord=desc&ver=2'; //查询开始 //优先使用curl模式发送数据 if (function_exists('curl_init') == 1) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($curl, CURLOPT_TIMEOUT, 5); $content = curl_exec($curl); curl_close($curl); } else { include "snoopy.php"; $snoopy = new snoopy(); $snoopy->referer = $_SERVER['HTTP_REFERER']; $snoopy->fetch($url); $content = $snoopy->results; } $content = mb_convert_encoding($content, 'utf8', 'gbk'); $stat = json_decode($content, true); $wuliustat = $stat['status']; //dump($content); //die; return $wuliustat; }
$args['w'] = 75; } if (isset($args['h']) && ($args['h'] > 1024 || $args['h'] <= 0)) { $args['h'] = 75; } if (!$args['url']) { return; } if (!extension_loaded('gd') && !extension_loaded('gd2')) { trigger_error("GD is not loaded", E_USER_ERROR); exit; } $snoopy = new snoopy(); $snoopy->cookies = $_COOKIE; $args['url'] = trim(str_replace(' ', '%20', $args['url'])); if ($snoopy->fetch($args['url'])) { $image = @imagecreatefromstring($snoopy->results); if ($image) { if (isset($args['w']) && isset($args['h'])) { $oldwidth = imagesx($image); $oldheight = imagesy($image); $newwidth = $oldwidth; $newheight = $oldheight; if ($oldwidth > $oldheight) { $newwidth = $args['w']; $newheight = (double) $newwidth / (double) $oldwidth * $oldheight; } else { $newheight = $args['h']; $newwidth = (double) $newheight / (double) $oldheight * $oldwidth; } $new_image = imagecreatetruecolor($newwidth, $newheight);
function sms_send_smsbao($phone, $content) { global $INI; if (empty($content)) { return '短信内容为空?写点吧~'; } $content = Utility::Content($content); //配置信息 $smsapi = "api.smsbao.com"; //短信网关 $charset = "utf8"; //文件编码 $user = $INI['sms']['smsbao_user']; //短信平台帐号 $pass = md5($INI['sms']['smsbao_pass']); //短信平台密码 $wwwprefix = $INI['system']['wwwprefix']; $statusStr = array( "0" => "短信发送成功", "-1" => "参数不全", "-2" => "服务器空间不支持,请确认支持curl或者fsocket,联系您的空间商解决或者更换空间!", "30" => "密码错误", "40" => "账号不存在", "41" => "余额不足", "42" => "帐户已过期", "43" => "IP地址限制", "50" => "内容含有敏感词" ); if (function_exists('curl_exec') == 1) { //发送地址 $sendurl = "http://{$smsapi}/sms?u={$user}&p={$pass}&m={$phone}&c=".urlencode($content)."&r=".urlencode($wwwprefix."/api/smsbao.php?type=feedback"); $result = Utility::HttpRequest($sendurl); }else{ include_once("snoopy.php"); $snoopy = new snoopy(); $sendurl = "http://{$smsapi}/sms?u={$user}&p={$pass}&m={$phone}&c=".urlencode($content)."&r=".urlencode($wwwprefix."/api/smsbao.php?type=feedback"); $snoopy->fetch($sendurl); $result = $snoopy->results; } if (trim(strval($result))=='') $result='-2'; $code = intval(trim($result)); if($code == 0){ return true; }else{ return $statusStr[$code]; } }
$link = 'http://jee.iitm.ac.in/counseling/marks/iitd/index.php'; $db = mysqli_connect('localhost', 'captnemo_user', 'password', 'captnemo_db'); if (!$db) { die("death"); } $q = "SELECT * FROM results where course <> 'Not Allotted'"; $res = mysqli_query($db, $q); while ($row = mysqli_fetch_row($res)) { $form['Form_No'] = $ff = $row[0]; $name = str_replace(" ", "", trim($row[1])); $name = substr($name, 0, 4); $form['Form_No'] .= $name; $form['submit'] = 'Submit'; //echo $form['Form_No']; $link = "http://jee.iitm.ac.in/allotcourses/courseallot.php?name=" . $form['Form_No']; $snoopy->fetch($link, $form); //$snoopy->fetch("http://jee.iitm.ac.in/allotcourses/courseallot.php?name=".$ff.$name); $page = $snoopy->results; //$course='Unalloted due to various reasons<sup>[1]</sup>'; //echo $page; $course = trim(strip_tags(cut_str($page, 'Course Allotted', 'Degree & Institute'))); if (strlen($course) < 3) { $course = 'Not Allotted'; } //if($course=='') // $course=strip_tags(cut_str($page,'<font color="#ff0000"><b>','</b></font>')); echo "{$ff}--{$name}--{$course}<br>"; flush(); $qu = "UPDATE results SET course='{$course}' where reg='{$ff}'"; //mysqli_query($db,$qu); }
function forumrunner_image($default) { define('MCWD', DIR . '/packages/forumrunner'); require_once MCWD . '/support/utils.php'; require_once MCWD . '/support/Snoopy.class.php'; $args = process_input(array('url' => STRING, 'w' => INTEGER, 'h' => INTEGER)); if (isset($args['w']) && ($args['w'] > 1024 || $args['w'] <= 0)) { $args['w'] = 75; } if (isset($args['h']) && ($args['h'] > 1024 || $args['h'] <= 0)) { $args['h'] = 75; } if (!isset($args['url'])) { die; } if (!extension_loaded('gd') && !extension_loaded('gd2')) { trigger_error("GD is not loaded", E_USER_ERROR); die; } $snoopy = new snoopy(); $snoopy->cookies = $_COOKIE; $args['url'] = trim(str_replace(' ', '%20', $args['url'])); if ($snoopy->fetch($args['url'])) { $image = @imagecreatefromstring($snoopy->results); if ($image) { if (isset($args['w']) && isset($args['h'])) { $oldwidth = imagesx($image); $oldheight = imagesy($image); $newwidth = $oldwidth; $newheight = $oldheight; if ($oldwidth > $oldheight) { $newwidth = $args['w']; $newheight = (double) $newwidth / (double) $oldwidth * $oldheight; } else { $newheight = $args['h']; $newwidth = (double) $newheight / (double) $oldheight * $oldwidth; } $new_image = imagecreatetruecolor($newwidth, $newheight); imagecopyresampled($new_image, $image, 0, 0, 0, 0, $newwidth, $newheight, imagesx($image), imagesy($image)); header('Content-type: image/jpeg'); imagejpeg($new_image); exit; } else { header('Content-type: image/jpeg'); imagejpeg($image); exit; } } } }
/** * Fetches and parses XML from Amazon for the given query. * @param string $query Query string containing variables to search Amazon for. Valid variables: $isbn, $title, $author * @return array Array containing each book's information. */ function query_amazon($query) { global $item, $items; $options = get_option('nowReadingOptions'); $using_isbn = false; parse_str($query); if (empty($isbn) && empty($title) && empty($author)) { return false; } if (!empty($isbn)) { $using_isbn = true; } // Our query needs different vars depending on whether or not we're searching by ISBN, so build it here. $query = ''; if ($using_isbn) { $isbn = preg_replace('#([^0-9x]+)#i', '', $isbn); $query = "isbn:{$isbn}"; } else { if (!empty($title)) { $query = 'title:' . urlencode("{$title} "); } if (!empty($author)) { $query .= 'author:' . urlencode("{$author} "); } } $url = 'http://webservices.amazon' . $options['domain'] . '/onca/xml?Service=AWSECommerceService' . '&AWSAccessKeyId=0BN9NFMF20HGM4ND8RG2&Operation=ItemSearch&SearchIndex=Books&ResponseGroup=Request,Large,Images' . '&Version=2005-03-23&AssociateTag=' . urlencode($options['associate']) . '&Power=' . $query; $url = apply_filters('amazon_search_url', $url); // Fetch the XML using either Snoopy or cURL, depending on our options. if ($options['httpLib'] == 'curl') { if (!function_exists('curl_init')) { return new WP_Error('curl-not-installed', __('cURL is not installed correctly.', NRTD)); } else { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'Now Reading ' . NOW_READING_VERSION); curl_setopt($ch, CURLOPT_HEADER, 0); if (!empty($options['proxyHost'])) { $proxy = $options['proxyHost']; if (!empty($options['proxyPort'])) { $proxy .= ":{$options['proxyPort']}"; } curl_setopt($ch, CURLOPT_PROXY, $proxy); } $xmlString = curl_exec($ch); curl_close($ch); } } else { require_once ABSPATH . WPINC . '/class-snoopy.php'; $snoopy = new snoopy(); $snoopy->agent = 'Now Reading ' . NOW_READING_VERSION; if (!empty($options['proxyHost'])) { $snoopy->proxy_host = $options['proxyHost']; } if (!empty($options['proxyHost']) && !empty($options['proxyPort'])) { $snoopy->proxy_port = $options['proxyPort']; } $snoopy->fetch($url); $xmlString = $snoopy->results; } if (empty($xmlString)) { do_action('nr_search_error', $query); return false; } $xml = new SimpleXMLElement($xmlString); $results = array(); foreach ($xml->Items->Item as $item) { $book = array(); $book['asin'] = (string) $item->ASIN; if (empty($book['asin'])) { continue; } foreach ($item->ItemAttributes->children() as $attribute) { if ($attribute->getName() == 'Author' && !empty($book['author'])) { $book['author'] .= ' and ' . (string) $attribute; continue; } $book[strtolower($attribute->getName())] = (string) $attribute; } $size = "{$options['imageSize']}Image"; $book['image'] = (string) $item->{$size}->URL; if (empty($book['image'])) { $image = get_option('siteurl') . '/wp-content/plugins/now-reading/no-image.png'; } $results[] = apply_filters('raw_amazon_results', $book); } $results = apply_filters('returned_books', $results); return $results; }
<?php /* * 로또 분석 프로그램 * 2015.09.24 - 최초 프로그램 작성 >> 기존의 당첨된 로또번호를 웹에서 가져와서 화면출력 */ include 'class.snoopy.php'; header("Content-Type: text/html; charset=UTF-8"); $snoopy = new snoopy(); $getUrl = "http://www.645lotto.net/lotto645Confirm.do?method=byWin&drwNo=" . $_GET['kai']; $snoopy->fetch($getUrl); $pattern = '/<option value="[0-9]*"\\s*>(.*?)<\\/option>/'; preg_match_all($pattern, $snoopy->results, $out); $select = ''; echo '<select onchange="location.href=\'?kai=\'+this.value">'; echo '<option value="">선택</option>'; for ($i = 0; $i < sizeof($out[0]); $i++) { echo $out[0][$i]; } echo '</select>'; echo $_GET['kai'] ? '<br />' . $_GET['kai'] . '회차<br />' : ''; if ($_GET['kai']) { echo '<p>'; $pattern = '/img src="\\/img\\/common\\/ball_[0-9]*.png/'; preg_match_all($pattern, $snoopy->results, $out); for ($i = 0; $i <= 6; $i++) { $num[$i] = str_replace(".png", "", str_replace('img src="/img/common/ball_', "", $out[0][$i])); echo $i == 6 ? '보너스 : ' : ''; echo $num[$i] . '<br />'; } echo '</p>';