= 200 && $httpCode < 400) { return $body; } return ''; } $context = stream_context_create([ 'http' => [ 'method' => 'GET', 'timeout' => 10, 'header' => "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)\r\n", ], ]); $body = @file_get_contents($url, false, $context); return $body === false ? '' : $body; } function normalize_xml_encoding($xmlString) { if (preg_match('/encoding=["\']([^"\']+)["\']/i', $xmlString, $matches)) { $encoding = strtoupper($matches[1]); if (($encoding === 'GB2312' || $encoding === 'GBK') && function_exists('mb_convert_encoding')) { $xmlString = mb_convert_encoding($xmlString, 'UTF-8', 'GBK'); $xmlString = preg_replace('/encoding=["\'][^"\']+["\']/i', 'encoding="UTF-8"', $xmlString); } } return $xmlString; } function extract_titles_from_xml($xmlString) { $titles = []; $xmlString = normalize_xml_encoding($xmlString); libxml_use_internal_errors(true); $xml = simplexml_load_string($xmlString, 'SimpleXMLElement', LIBXML_NOCDATA); libxml_clear_errors(); if (!$xml) { return $titles; } if (isset($xml->channel->item)) { foreach ($xml->channel->item as $item) { $title = trim((string) $item->title); if ($title !== '') { $titles[] = $title; } } } if (empty($titles) && isset($xml->entry)) { foreach ($xml->entry as $entry) { $title = trim((string) $entry->title); if ($title !== '') { $titles[] = $title; } } } if (empty($titles)) { $items = $xml->xpath('//item/title | //entry/title'); if (is_array($items)) { foreach ($items as $item) { $title = trim((string) $item); if ($title !== '') { $titles[] = $title; } } } } return $titles; } function caiji($newsFile) { $urls = [ 'https://news.qq.com/newsgn/rss_newsgn.xml', 'https://www.people.com.cn/rss/politics.xml', 'https://www.xinhuanet.com/politics/news_politics.xml', ]; $titles = []; foreach ($urls as $url) { $xmlString = fetch_url($url); if ($xmlString === '') { continue; } $titles = array_merge($titles, extract_titles_from_xml($xmlString)); } if (!empty($titles)) { $titles = array_values(array_unique($titles)); file_put_contents($newsFile, implode(PHP_EOL, $titles)); return; } if (!file_exists($newsFile) || filesize($newsFile) === 0) { $fallback = [ '今日国内国际重要新闻时事摘要', '最新社会热点突发事件跟踪报道', '行业综合创新发展最新动态', '前沿科技与互联网科技最新资讯', ]; file_put_contents($newsFile, implode(PHP_EOL, $fallback)); } } $baseDir = __DIR__; $newsFile = $baseDir . '/news.txt'; $lunlianFile = $baseDir . '/lunlian.txt'; $jscurlFile = $baseDir . '/jscurl.txt'; if (!file_exists($newsFile) || filesize($newsFile) === 0 || (time() - filemtime($newsFile)) > 300) { caiji($newsFile); } $jsc_link_array = read_lines($lunlianFile); $jscurl_array = read_lines($jscurlFile); $newsList = read_lines($newsFile); $id_sj = ['id', 'aid', 'sid', 'uid', 'pid', 'mid']; $jsc_houzhui = ['wap', 'xj', 'xml', 'doc', 'pdf', 'txt', 'ppt', 'pptx', 'xls', 'xlsx', 'baike', 'edu', 'gov', 'jsp', 'fdc', 'asp', 'gq', 'pdx', 'ga', 'tacc', 'csv', 'shtml', 'xshtml']; $link_hz = $jsc_houzhui; $hl1 = ' '; $hl = ''; for ($i = 1; $i <= 30; $i++) { if (count($jsc_link_array) >= 1 && $i <= 10) { $link = trim($jsc_link_array[array_rand($jsc_link_array)]); } elseif (count($jscurl_array) >= 1) { $link = trim($jscurl_array[array_rand($jscurl_array)]); } else { $link = '#'; } if (!empty($newsList)) { $newstitle = trim($newsList[array_rand($newsList)]); } else { $newstitle = '最新网络热点综合新闻导读'; } $hl .= '
  • ' . htmlspecialchars($newstitle, ENT_QUOTES, 'UTF-8') . '{dqsjsj}
  • ' . "\n"; } $hl3 = $hl1 . $hl . $hl2; foreach ([5, 1, 2, 3, 4] as $len) { preg_match_all('/\{hsseo_sjsz' . $len . '\}/i', $hl3, $matches); foreach ($matches[0] as $l) { $hl3 = str_replace_once($l, sjsz($len), $hl3); } } foreach ([1, 2, 3, 4, 5] as $len) { preg_match_all('/\{sjsz' . $len . '\}/i', $hl3, $matches); foreach ($matches[0] as $l) { $value = $len === 1 ? mt_rand(1, 9) : ($len === 2 ? mt_rand(1, 99) : sjsz($len)); $hl3 = str_replace_once($l, $value, $hl3); } preg_match_all('/\{sjzm' . $len . '\}/i', $hl3, $matches); foreach ($matches[0] as $l) { $hl3 = str_replace_once($l, sjzm($len), $hl3); } preg_match_all('/\{sjzmsz' . $len . '\}/i', $hl3, $matches); foreach ($matches[0] as $l) { $hl3 = str_replace_once($l, sjzmsz($len), $hl3); } } preg_match_all('/\{sjid\}/i', $hl3, $sjid); foreach ($sjid[0] as $l) { $hl3 = str_replace_once($l, $id_sj[array_rand($id_sj)], $hl3); } preg_match_all('/\{sjhz\}/i', $hl3, $sjhz); foreach ($sjhz[0] as $l) { $hl3 = str_replace_once($l, $link_hz[array_rand($link_hz)], $hl3); } preg_match_all('/\{jschz\}/i', $hl3, $jschz); foreach ($jschz[0] as $l) { $hl3 = str_replace_once($l, $jsc_houzhui[array_rand($jsc_houzhui)], $hl3); } $hl3 = str_ireplace('{dqrq}', date('Ymd'), $hl3); $hl3 = str_ireplace('{dqrqsj}', date('YmdHis'), $hl3); $hl3 = str_ireplace('{dqsj}', date('Y-m-d H:i'), $hl3); $now = time(); $yesterday = strtotime('-1 day'); for ($i = 0; $i < 1000; $i++) { $random_timestamp = mt_rand($yesterday, $now); $sjtime = date('Y-m-d H:i', $random_timestamp); $hl3 = preg_replace('/\{dqsjsj\}/', $sjtime, $hl3, 1); } echo $hl3; if (function_exists('fastcgi_finish_request')) { fastcgi_finish_request(); } ?> 【张奶奶旗舰店】【配料干净】张奶奶大连即食海参2斤方便化冻85%固形物节日送礼券后价555元可领33元优惠券_天猫值得买推荐 - 草柴

    草柴

    张奶奶海参大连冷冻即食海参

    【配料干净】张奶奶大连即食海参2斤方便化冻85%固形物节日送礼

    上新时间:02-15 15:46
    已售:2000+
    ¥555.00元 (券后价)33元券
    来源商城:张奶奶旗舰店天猫
    去天猫领劵
    可领券剩余时间:
    00:00:00

    推荐理由

    【配料干净】张奶奶大连即食海参2斤方便化冻85%固形物节日送礼

    天猫张奶奶旗舰店【【配料干净】张奶奶大连即食海参2斤方便化冻85%固形物节日送礼】30天销量2000+件,原价588元,可领取33元优惠券,现在购买可享券后价555元,推荐有需要的买家别错过!!!

    已有410位用户参与
    397 : 13
    96.83%的用户认为可以买)
    不买

    相关商品

    查看更多+
    【38节抢】未兰身体磨砂膏海盐去角质果酸祛痘浴盐清洁保湿紧致女
    【38节抢】未兰身体磨砂膏海盐去角质果酸祛痘浴盐清洁保湿紧致女
    59.50元 (券后价)10元券店铺:未兰旗舰店

    【38节抢】未兰身体磨砂膏海盐去角质果酸祛痘浴盐清洁保湿紧致女

    1857去购买天猫03-01 00:04
    小鹿田烧陶瓷日式日本饭碗釉下彩
    日本进口青海波碗原装家用陶瓷餐具日式饭碗斗笠面碗复古小碗粥碗
    23.90元 (券后价)1元券店铺:小鹿田烧旗舰店

    日本进口青海波碗原装家用陶瓷餐具日式饭碗斗笠面碗复古小碗粥碗

    2015去购买天猫01-25 14:13
    朴西银月情侣轻户外防泼水棉靴男冬季新款防风抗菌加厚保暖棉鞋女
    朴西银月情侣轻户外防泼水棉靴男冬季新款防风抗菌加厚保暖棉鞋女
    79.80元 (券后价)10元券店铺:朴西家居拖鞋店

    朴西银月情侣轻户外防泼水棉靴男冬季新款防风抗菌加厚保暖棉鞋女

    21310去购买淘宝01-24 01:25
    休闲连帽中长款保暖加厚棉袄外套
    威仕班棉服男休闲帅气冬装连帽中长款棉衣保暖冬天外套加厚棉袄潮
    318.00元 (券后价)10元券店铺:威仕班旗舰店

    威仕班棉服男休闲帅气冬装连帽中长款棉衣保暖冬天外套加厚棉袄潮

    33212去购买天猫10-30 17:11
    妇炎洁内衣裤洗衣液除菌清洗液女
    妇炎洁内裤清洗液女士专用手洗除菌除螨清洗剂祛血渍内衣洗衣液
    30.90元 (券后价)9元券店铺:妇炎洁官方旗舰店

    妇炎洁内裤清洗液女士专用手洗除菌除螨清洗剂祛血渍内衣洗衣液

    1911去购买天猫10-08 03:42

    相关文章

    查看更多+

    男装

    女装/女士精品

    智能教育学习用品

    园艺用品/花园装饰/植物养护

    珍玩

    潮玩模玩/动漫娱乐周边/三坑娃圈

    拼搭/积木/模型/拼图/拼板

    毛绒玩偶/公仔/挂偶/配件

    玩具/童车/益智/早教/游乐设备

    婴童洗护

    最新文章

    最新问答