kw_new.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>Googo Website Traffic</title>
  8. <!-- Font Awesome -->
  9. <link
  10. href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
  11. rel="stylesheet"
  12. />
  13. <!-- Google Fonts -->
  14. <link
  15. href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
  16. rel="stylesheet"
  17. />
  18. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
  19. integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  20. <!-- MDB -->
  21. <link
  22. href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.css"
  23. rel="stylesheet"
  24. />
  25. <link rel="stylesheet" href="https://unpkg.com/js-datepicker/dist/datepicker.min.css">
  26. <link rel="stylesheet" type="text/css" href="reset.css">
  27. <link rel="stylesheet" type="text/css" href="main.css">
  28. <!-- MDB -->
  29. <script
  30. type="text/javascript"
  31. src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.js"
  32. ></script>
  33. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  34. <script src="echarts.min.js"></script>
  35. </head>
  36. <body class="color__grey">
  37. <div id="myNav" class="overlay">
  38. <div class="overlay-content">
  39. <a href="#">載入資料中,請稍候</a>
  40. </div>
  41. </div>
  42. <!-- Navbar -->
  43. <nav class="navbar navbar-expand-lg navbar-light bg-white">
  44. <!-- Container wrapper -->
  45. <div class="container-fluid">
  46. <!-- Navbar brand -->
  47. <a class="navbar-brand" href="#">Googo Website Traffic</a>
  48. <!-- Toggle button -->
  49. <button class="navbar-toggler" type="button" data-mdb-toggle="collapse"
  50. data-mdb-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
  51. aria-label="Toggle navigation">
  52. <i class="fas fa-bars text-light"></i>
  53. </button>
  54. <!-- Collapsible wrapper -->
  55. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  56. <!-- Left links -->
  57. <ul class="navbar-nav me-auto d-flex flex-row mt-3 mt-lg-0">
  58. <li class="nav-item text-center mx-2 mx-lg-1">
  59. <a class="nav-link active" aria-current="page" href="index.html">
  60. <div>
  61. <i class="fas fa-home fa-lg mb-1"></i>
  62. </div>
  63. Home
  64. </a>
  65. </li>
  66. <li class="nav-item text-center mx-2 mx-lg-1">
  67. <a class="nav-link" href="http://news.google.com">
  68. <div>
  69. <i class="fas fa-globe-americas fa-lg mb-1"></i>
  70. <!-- <span class="badge rounded-pill badge-notification bg-success">11</span> -->
  71. </div>
  72. News
  73. </a>
  74. </li>
  75. <li class="nav-item text-center mx-2 mx-lg-1">
  76. <a class="nav-link" href="keywords.html">
  77. <div>
  78. <i class="fab fa-korvue fa-lg mb-1"></i>
  79. <!-- <span class="badge rounded-pill badge-notification bg-success">11</span> -->
  80. </div>
  81. Keywords
  82. </a>
  83. </li>
  84. </ul>
  85. <!-- Right links -->
  86. </div>
  87. <!-- Collapsible wrapper -->
  88. </div>
  89. <!-- Container wrapper -->
  90. </nav>
  91. <!-- Navbar -->
  92. <div class="container">
  93. <div class="row">
  94. <!-- <div class="col-1 col-lg-1"></div> -->
  95. <div class="col-12 col-12">
  96. <!-- Search form -->
  97. <form id="searchform" class="d-flex input-group search__form align-item-center keyword_add" >
  98. <input type="search" class="form-control search__bar" placeholder="新增追蹤關鍵字" aria-label="Domain Name" id="following_keys"/>
  99. <button class="btn btn-primary search__btn" type="button" data-mdb-ripple-color="dark" id="search__btn">
  100. 加入
  101. </button>
  102. </form>
  103. <div class="keyword_total mx-auto mb-4">目前有 <strong>N</strong> 個追蹤關鍵字</div>
  104. <div class="date__input mb-3">
  105. <label for="daterng">開始日期:</label><input type="text" name="daterng" id="daterng1">
  106. <label for="daterng">結束日期:</label><input type="text" name="daterng" id="daterng2">
  107. <button class='sub__date btn'>套用</button>
  108. </div>
  109. <div class="text-muted mb-2 border-bottom">追蹤關鍵字排名</div>
  110. <div class="row g-5 mb-3">
  111. <div class="col-sm-4">
  112. <div class="card p-3">
  113. <div class="card-body text-center">
  114. <h5 class="card-title card__rank__title mb-2">排名前一頁關鍵字</h5>
  115. <p class="card-text" >
  116. </p>
  117. <span href="#" class="rank__mark"><strong id="globalrank" class="rank_num">1000</strong>個</span>
  118. </div>
  119. </div>
  120. </div>
  121. <div class="col-sm-4">
  122. <div class="card p-3">
  123. <div class="card-body text-center">
  124. <h5 class="card-title card__rank__title mb-2">排名前三頁關鍵字</h5>
  125. <p class="card-text">
  126. </p>
  127. <span href="#" class="rank__mark"><strong id="countryrank" class="rank_num">100</strong>個</span>
  128. </div>
  129. </div>
  130. </div>
  131. <div class="col-sm-4">
  132. <div class="card p-3">
  133. <div class="card-body text-center">
  134. <h5 class="card-title card__rank__title mb-2"><i class="fas fa-tags"></i>排名前十頁關鍵字</h5>
  135. <p class="card-text card__rank__cat" id="category">
  136. </p>
  137. <span href="#" class="rank__mark"><strong id="countryrank" class="rank_num">100</strong>個</span>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. <div class="text-muted mb-2">追蹤關鍵字列表</div>
  143. <table id="dtBasicExample" class="table" cellspacing="0" width="100%">
  144. <thead>
  145. <tr>
  146. <th class="th-sm">關鍵字
  147. </th>
  148. <th class="th-sm">排名
  149. </th>
  150. <th class="th-sm">搜尋量
  151. </th>
  152. <th class="th-sm">曝光數
  153. </th>
  154. <th class="th-sm">CTR
  155. </th>
  156. <th class="th-sm">頁面搜尋流量
  157. </th>
  158. <th></th>
  159. </tr>
  160. </thead>
  161. <tbody>
  162. <tr>
  163. <td>Tiger Nixon</td>
  164. <td>System Architect</td>
  165. <td>Edinburgh</td>
  166. <td>61</td>
  167. <td>2011/04/25</td>
  168. <td>989</td>
  169. <td><i class="fas fa-trash-alt"></i></td>
  170. </tr>
  171. <tr>
  172. <td>Garrett Winters</td>
  173. <td>Accountant</td>
  174. <td>Tokyo</td>
  175. <td>63</td>
  176. <td>2011/07/25</td>
  177. <td>989</td>
  178. <td><i class="fas fa-trash-alt"></i></td>
  179. </tr>
  180. <tr>
  181. <td>Ashton Cox</td>
  182. <td>Junior Technical Author</td>
  183. <td>San Francisco</td>
  184. <td>66</td>
  185. <td>2009/01/12</td>
  186. <td>989</td>
  187. <td><i class="fas fa-trash-alt"></i></td>
  188. </tr>
  189. </tbody>
  190. </table>
  191. <div class="text-muted mb-2">搜尋關鍵字現況(連google search console 資料)</div>
  192. <table id="dtBasicExample" class="table" cellspacing="0" width="100%">
  193. <thead>
  194. <tr>
  195. <th class="th-sm">關鍵字
  196. </th>
  197. <th class="th-sm">排名
  198. </th>
  199. <th class="th-sm">搜尋量
  200. </th>
  201. <th class="th-sm">曝光數
  202. </th>
  203. <th class="th-sm">CTR
  204. </th>
  205. <th class="th-sm">頁面搜尋流量
  206. </th>
  207. <th></th>
  208. </tr>
  209. </thead>
  210. <tbody>
  211. <tr>
  212. <td>Tiger Nixon</td>
  213. <td>System Architect</td>
  214. <td>Edinburgh</td>
  215. <td>61</td>
  216. <td>2011/04/25</td>
  217. <td>989</td>
  218. <td><i class="fas fa-trash-alt"></i></td>
  219. </tr>
  220. <tr>
  221. <td>Garrett Winters</td>
  222. <td>Accountant</td>
  223. <td>Tokyo</td>
  224. <td>63</td>
  225. <td>2011/07/25</td>
  226. <td>989</td>
  227. <td><i class="fas fa-trash-alt"></i></td>
  228. </tr>
  229. <tr>
  230. <td>Ashton Cox</td>
  231. <td>Junior Technical Author</td>
  232. <td>San Francisco</td>
  233. <td>66</td>
  234. <td>2009/01/12</td>
  235. <td>989</td>
  236. <td><i class="fas fa-trash-alt"></i></td>
  237. </tr>
  238. </tbody>
  239. </table>
  240. <div class="text-muted mb-2">關鍵字建議</div>
  241. <table id="dtBasicExample" class="table" cellspacing="0" width="100%">
  242. <thead>
  243. <tr>
  244. <th class="th-sm">關鍵字
  245. </th>
  246. <th class="th-sm">排名
  247. </th>
  248. <th class="th-sm">搜尋量
  249. </th>
  250. <th class="th-sm">曝光數
  251. </th>
  252. <th class="th-sm">CTR
  253. </th>
  254. <th class="th-sm">頁面搜尋流量
  255. </th>
  256. <th></th>
  257. </tr>
  258. </thead>
  259. <tbody>
  260. <tr>
  261. <td>Tiger Nixon</td>
  262. <td>System Architect</td>
  263. <td>Edinburgh</td>
  264. <td>61</td>
  265. <td>2011/04/25</td>
  266. <td>989</td>
  267. <td><i class="fas fa-trash-alt"></i></td>
  268. </tr>
  269. <tr>
  270. <td>Garrett Winters</td>
  271. <td>Accountant</td>
  272. <td>Tokyo</td>
  273. <td>63</td>
  274. <td>2011/07/25</td>
  275. <td>989</td>
  276. <td><i class="fas fa-trash-alt"></i></td>
  277. </tr>
  278. <tr>
  279. <td>Ashton Cox</td>
  280. <td>Junior Technical Author</td>
  281. <td>San Francisco</td>
  282. <td>66</td>
  283. <td>2009/01/12</td>
  284. <td>989</td>
  285. <td><i class="fas fa-trash-alt"></i></td>
  286. </tr>
  287. </tbody>
  288. </table>
  289. </div>
  290. </div>
  291. </div>
  292. <script
  293. src="https://code.jquery.com/jquery-3.6.0.min.js"
  294. integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
  295. crossorigin="anonymous"></script>
  296. <script src="https://unpkg.com/js-datepicker"></script>
  297. <script>
  298. function openNav() {
  299. document.getElementById("myNav").style.display = "block";
  300. }
  301. function closeNav() {
  302. document.getElementById("myNav").style.display = "none";
  303. }
  304. const input = document.getElementById("following_keys");
  305. const search__btn = document.getElementById("search__btn");
  306. const picker_str = datepicker('#daterng1', {
  307. id: 1
  308. });
  309. const picker_end = datepicker('#daterng2', {
  310. id: 1
  311. });
  312. $('.sub__date').click(function(e){
  313. e.preventDefault();
  314. console.log(picker_end.getRange());
  315. });
  316. search__btn.addEventListener("click", function(e) {
  317. //e.preventDefault();
  318. check_form();
  319. });
  320. $('#following_keys').keydown(function(e){
  321. if (event.keyCode == 13){
  322. document.getElementById('search__btn').click()
  323. e.preventDefault();
  324. }
  325. });
  326. //$(document).ready(function () {
  327. //$('#dtBasicExample').DataTable();
  328. //$('.dataTables_length').addClass('bs-select');
  329. //});
  330. function check_form(){
  331. dataOBJ = {'keyword':$('#following_keys').val()}
  332. objstr = JSON.stringify(dataOBJ);
  333. $.ajax({
  334. url: 'http://www.googo.org:8001/kw_dm',
  335. //url: 'http://www.choozmo.com:8888/qqreq',
  336. dataType : 'json', // 預期從server接收的資料型態
  337. contentType : 'application/json; charset=utf-8', // 要送到server的資料型態
  338. type: 'post',
  339. data: objstr,
  340. success: function(suc_data) {
  341. alert('hi im here')
  342. },
  343. //data:JSON.stringify({n1:"12",n2:"22"}),
  344. error: function (error) {
  345. alert('此網頁無法查詢!')
  346. closeNav()
  347. }
  348. });
  349. let traffics;
  350. traffics = {
  351. title: {
  352. text: '世界人口总量',
  353. subtext: '数据来自网络'
  354. },
  355. tooltip: {
  356. trigger: 'axis',
  357. axisPointer: {
  358. type: 'shadow'
  359. }
  360. },
  361. legend: {
  362. data: ['2011年', '2012年']
  363. },
  364. grid: {
  365. left: '3%',
  366. right: '4%',
  367. bottom: '3%',
  368. containLabel: true
  369. },
  370. xAxis: {
  371. type: 'value',
  372. boundaryGap: [0, 0.01]
  373. },
  374. yAxis: {
  375. type: 'category',
  376. data: ['巴西', '印尼', '美国', '印度', '中国', '世界人口(万)']
  377. },
  378. series: [
  379. {
  380. name: '2011年',
  381. type: 'bar',
  382. data: [18203, 23489, 29034, 104970, 131744, 630230]
  383. },
  384. {
  385. name: '2012年',
  386. type: 'bar',
  387. data: [19325, 23438, 31000, 121594, 134141, 681807]
  388. }
  389. ]
  390. };
  391. traffics.setOption(traffics);
  392. console.log(response.status);
  393. console.log(response.statusText);
  394. console.log(response.headers);
  395. console.log(response.config);
  396. }
  397. </script>
  398. </body>
  399. <footer class="footer text-center p-4 bg-white">
  400. <div class="text-muted"> © 2021 Copyright: Googo Website Traffic</div>
  401. </footer>
  402. </html>