Ejemplo n.º 1
0
            $searchUrl = 'http://weixin.sogou.com/weixin?query=' . $key . '&type=2&page=' . $postPage . '&ie=utf8';
            //echo $searchUrl;
            echo '<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"/><link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css"><link rel="stylesheet" href="../bootstrap/css/bootstrap-theme.min.css"><link rel="stylesheet" type="text/css" href="../test/cssjs/default.css"><title>' . $key . '的微信公众号文章 - by HighSea</title><!--<script src="../test/cssjs/copy.js">--></script><script type="text/javascript" charset="gbk" src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script></head><body><div class="container"><div class="row"><p class="bg-success">以下内容来自微信公众平台</p></div>';
            phpQuery::newDocumentFile($searchUrl);
            $artlist = pq(".results");
            //echo $artlist;
            foreach ($artlist as $li) {
                $description = pq($li)->find('.wx-rb');
                echo '<div class="row alltitle">' . $description->find('.txt-box h4')->html() . '</div>';
                echo '<div class="row">' . $description->find('.img_box2 img')->attr('src');
            }
            echo "</div></body></html>";
            break;
        case 2:
            $searchUrl = 'http://www.liepin.com/zhaopin/?searchField=1&key=' . $key . '&industries=&jobTitles=&dqs=070020&compscale=&compkind=&pubTime=&salary=&searchType=1&clean_condition=&jobKind=&curPage=' . $postPage;
            echo "开发中";
            break;
        case 3:
            echo "开发中";
            break;
        default:
            customJsonRes('400', 'Bad Request:请求参数不合法!', 'null');
    }
}
function customJsonRes($code, $message, $customJson)
{
    $callback = isset($_GET['callback']) ? $_GET['callback'] : 'callback';
    $resultCacheDataJson = array('code' => $code, 'message' => $message, 'data' => $customJson);
    echo $callback . '(' . json_encode($resultCacheDataJson) . ')';
    exit;
}
Ejemplo n.º 2
0
function cResponse($names)
{
    if ($names) {
        return Response::show(200, 'success', $names);
    } else {
        //return Response::show(404, 'not found:没找到数据!', $names);
        customJsonRes('404', 'not found:没找到数据!', 'null', 'null');
    }
}