1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/**
* 用户搜索结果csv文件下载
* $Id: user_csv_download.php 81403 2015-03-30 10:16:52Z zhouz $
* @author zhouz
* @access public
* @package partner.public_html
*/
// クラス・設定読み込み
require_once("manager_include.inc");
// ログインチェック
require_once("check_login.inc");
//执行日期
$last_registration_date = "2018-12-29 00:00:00";
//接受URL
$api = 'http://data.zz.baidu.com/urls?site=www.beautyplus088.com&token=Fqmo37V2P076dKwX';
$api_mobile = 'http://data.zz.baidu.com/urls?site=mobile.beautyplus088.com&token=Fqmo37V2P076dKwX';
$urls = array();
$urls_mobile = array();
//首页
$urls[] = "http://" . HOST_NAME;
//按分类列表页
$param = array();
$param["delete_flg"] = false;
$param["registration_date_MIN"] = $last_registration_date;
$category_list = ArticleCategoryMst::getList($param, "display_order", "desc");
foreach($category_list as $category) {
$urls[] = "http://" . HOST_NAME . "/index.php/" . $category->category_id . "_1.html";
$urls_mobile[] = "http://" . MOBILE_HOST_NAME . "/index.php/" . $category->category_id . "_1.html";
}
//按标签列表页
$param = array();
$param["delete_flg"] = false;
$param["registration_date_MIN"] = $last_registration_date;
$article_tag_list = ArticleTagsDat::getList($param,"id","desc");
foreach($article_tag_list as $tag) {
$urls[] = "http://" . HOST_NAME . "/tag.php/" . urlencode($tag->tag) . "_1.html";
$urls_mobile[] = "http://" . MOBILE_HOST_NAME . "/tag.php/" . urlencode($tag->tag) . "_1.html";
}
//内容详情页
$param = array();
$param["delete_flg"] = false;
$param["registration_date_MIN"] = $last_registration_date;
$article_dat_list = ArticleDat::getList($param,"id","desc");
foreach($article_dat_list as $article) {
$urls[] = "http://" . HOST_NAME . "/preview.php/" . $article->id . ".html";
$urls_mobile[] = "http://" . MOBILE_HOST_NAME . "/preview.php/" . $article->id . ".html";
}
//批量提交[pc]
$ch = curl_init();
$options = array(
CURLOPT_URL => $api,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => implode("\n", $urls),
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
echo $result;
//批量提交[mobile]
$ch = curl_init();
$options = array(
CURLOPT_URL => $api_mobile,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => implode("\n", $urls_mobile),
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
echo $result;
?>