<?php

require_once '../inc/QueryList/QueryList.class.php';
header('Content-type:text/html;charset=utf-8');
$url = "http://meiriyiwen.com/";
$reg = array("title" => array("#article_show h1", "text"), "author" => array("#article_show .article_author span", "text"), "content" => array("#article_show .article_text", "html"));
$mryw_rst = QueryList::Query($url, $reg);
$mryw_array = $mryw_rst->jsonArr;
if ($mryw_array) {
    $m_title = $mryw_array[0]['title'];
    $m_author = $mryw_array[0]['author'];
    $m_content = $mryw_array[0]['content'];
    $m_md5 = md5($m_content);
    if (empty($m_title) || empty($m_author) || empty($m_content) || empty($m_md5)) {
        echo 'empty mryw, ' . date('Y-m-d H:i:s', time());
    } else {
        require_once '../inc/mryw.inc.php';
        $mryw_dao = new Mryw();
        if ($mryw_dao->is_mryw_exist($m_md5)) {
            echo 'exist mryw, ' . date('Y-m-d H:i:s', time());
        } else {
            $lastest = $mryw_dao->get_lastest_article(true);
            $n_time = strtotime($lastest['m_time']) + 3600 * 23 + 57;
            $mryw_dao->insert_mryw($m_title, $m_content, $m_author, $m_md5, date('Y-m-d H:i:s', $n_time));
            //
            echo 'success mryw, ' . date('Y-m-d H:i:s', time());
            Mysql::closeConn();
        }
    }
}
Exemple #2
0
    }
} elseif ($type === 'text') {
    $keyword = $yixin->msg['Content'];
    // 用户的文本消息内容
    $state = UserState::getUserState($yixin->msg['FromUserName']);
    if ($keyword == 'Hello2BizUser') {
        $reply = $yixin->makeText(cons::$WELCOME_STR);
    } elseif ($keyword == 'q' || $keyword == 'Q') {
        UserState::setUserState($yixin->msg['FromUserName'], '0', '');
        $reply = $yixin->makeText(cons::$WELCOME_STR);
    } else {
        // 主界面
        if ($state['state'] == '0') {
            $reply = chooseFunctionNum($keyword, $yixin);
        } elseif ($state['state'] == '1') {
            $mryw = new Mryw($keyword);
            $rst = $mryw->get();
            $reply = $yixin->makeNews($rst);
        } elseif ($state['state'] == '2') {
            $joke = new Joke($keyword);
            $rst = $joke->getJoke();
            $reply = $yixin->makeNews($rst);
        } elseif ($state['state'] == '3') {
            $beautiful = new Beautiful($keyword);
            $rst = $beautiful->getBeautifulPic();
            $reply = $yixin->makeNews($rst);
        } elseif ($state['state'] == '4') {
            $robot = new Robot($keyword);
            $rst = $robot->getReply();
            if (is_array($rst)) {
                $reply = $yixin->makeNews($rst);
Exemple #3
0
<?php

require_once '../inc/mryw.inc.php';
require_once '../inc/utils.inc.php';
$mryw = new Mryw();
$cnt = $mryw->count_all();
$num = rand(0, $cnt * 2) % $cnt;
$data = $mryw->random_one($num);
$descrip = substr_ext(strip_tags($data['m_content']), 0, 80);
$descrip = preg_replace("/\\s/", "", $descrip);
$data['m_content'] = $descrip . '...';
$data['m_pic'] = 'http://pomelo-setin.stor.sinaapp.com/' . rand(1, 4751) . '.jpg';
echo json_encode($data);
Mysql::close();
Exemple #4
0
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
require_once '../inc/mryw.inc.php';
$mryw_dao = new Mryw();
$start = '2014-11-11 11:11:11';
for ($i = 1; $i < 900; $i++) {
    //$mryw = $mryw_dao->find_by_id($i);
    $n_time = strtotime($start) + 3600 * 5 + 57;
    $start = date('Y-m-d H:i:s', $n_time);
    $mryw_dao->update_m_time($i, $start);
}
echo 'su';
Exemple #5
0
<?php

require_once '../inc/mysql.inc.php';
require_once '../inc/mryw.inc.php';
$content = '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
	   <url>
			<loc>http://www.setin.cn</loc>
			<lastmod>' . date('c') . '</lastmod>
			<changefreq>daily</changefreq>
			<priority>1</priority>
		</url>
';
$mryw_dao = new Mryw();
$total_num = $mryw_dao->count_all_Online();
$mryw = $mryw_dao->get_lastest_article();
$mryws = $mryw_dao->select_4_sitemap();
foreach ($mryws as $item) {
    $content .= create_item($item);
}
$content .= '</urlset>';
echo $content;
Mysql::closeConn();
function create_item($data)
{
    $item = "<url>\n";
    $item .= "<loc>http://www.setin.cn/" . $data['m_id'] . ".html</loc>\n";
    $item .= "<priority>" . 0.9 . "</priority>\n";
    $item .= "<lastmod>" . date("c", strtotime($data['m_time'])) . "</lastmod>\n";
    $item .= "<changefreq>" . 'daily' . "</changefreq>\n";
    $item .= "</url>\n";
Exemple #6
0
<!DOCTYPE html>
<?php 
require_once '../inc/mysql.inc.php';
require_once '../inc/mryw.inc.php';
require_once '../inc/utils.inc.php';
$num = isset($_GET['num']) ? strip_tags(mysql_escape_string($_GET['num'])) : -1;
$mryw_dao = new Mryw();
if ($num == -1) {
    $mryw = $mryw_dao->get_lastest_article();
} else {
    $mryw = $mryw_dao->find_by_id($num);
}
if ($mryw == false) {
    echo "<script>location.href='http://www.setin.cn/';</script>";
    exit;
}
$num = $mryw['m_id'];
$nextid = $mryw_dao->search_next_article_id($num);
$preid = $mryw_dao->search_prev_article_id($num);
$total_num = $mryw_dao->count_all();
if ($total_num == false) {
    $total_num = 0;
}
Mysql::close();
$descrip = substr_ext(strip_tags($mryw['m_content']), 0, 100);
$descrip = preg_replace("/\\s/", "", $descrip);
?>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <meta name="renderer" content="webkit" />