123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Googo Website Traffic</title>
- <!-- Font Awesome -->
- <link
- href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
- rel="stylesheet"
- />
- <!-- Google Fonts -->
- <link
- href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
- rel="stylesheet"
- />
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
- integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
- <!-- MDB -->
- <link
- href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.css"
- rel="stylesheet"
- />
- <link rel="stylesheet" href="https://unpkg.com/js-datepicker/dist/datepicker.min.css">
- <link rel="stylesheet" type="text/css" href="reset.css">
- <link rel="stylesheet" type="text/css" href="main.css">
- <!-- MDB -->
- <script
- type="text/javascript"
- src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.js"
- ></script>
- <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
- <script src="echarts.min.js"></script>
- </head>
- <body class="color__grey">
- <!-- Navbar -->
- <nav class="navbar navbar-expand-lg navbar-light bg-white">
- <!-- Container wrapper -->
- <div class="container-fluid">
- <!-- Navbar brand -->
- <a class="navbar-brand" href="#">Googo Website Traffic</a>
-
- <!-- Toggle button -->
- <button class="navbar-toggler" type="button" data-mdb-toggle="collapse"
- data-mdb-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
- aria-label="Toggle navigation">
- <i class="fas fa-bars text-light"></i>
- </button>
-
- <!-- Collapsible wrapper -->
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
- <!-- Left links -->
- <ul class="navbar-nav me-auto d-flex flex-row mt-3 mt-lg-0">
- <li class="nav-item text-center mx-2 mx-lg-1">
- <a class="nav-link active" aria-current="page" href="index.html">
- <div>
- <i class="fas fa-home fa-lg mb-1"></i>
- </div>
- Home
- </a>
- </li>
- <li class="nav-item text-center mx-2 mx-lg-1">
- <a class="nav-link" href="http://news.google.com">
- <div>
- <i class="fas fa-globe-americas fa-lg mb-1"></i>
- <!-- <span class="badge rounded-pill badge-notification bg-success">11</span> -->
- </div>
- News
- </a>
- </li>
- <li class="nav-item text-center mx-2 mx-lg-1">
- <a class="nav-link" href="keywords.html">
- <div>
- <i class="fab fa-korvue fa-lg mb-1"></i>
- <!-- <span class="badge rounded-pill badge-notification bg-success">11</span> -->
- </div>
- Keywords
- </a>
- </li>
- </ul>
- <!-- Right links -->
- </div>
- <!-- Collapsible wrapper -->
- </div>
- <!-- Container wrapper -->
- </nav>
- <!-- Navbar -->
- <div class="container">
- <div class="row">
- <!-- <div class="col-1 col-lg-1"></div> -->
- <div class="col-12 col-12">
- <!-- Search form -->
- <form id="searchform" class="d-flex input-group search__form align-item-center keyword_add" >
- <input type="search" class="form-control search__bar" placeholder="新增追蹤關鍵字" aria-label="Domain Name" id="following_keys"/>
- <button class="btn btn-primary search__btn" type="button" data-mdb-ripple-color="dark" id="search__btn">
- 加入
- </button>
- </form>
- <div class="keyword_total mx-auto mb-4">目前有 <strong>N</strong> 個追蹤關鍵字</div>
- <div class="date__input mb-3">
- <label for="daterng">開始日期:</label><input type="text" name="daterng" id="daterng1">
- <label for="daterng">結束日期:</label><input type="text" name="daterng" id="daterng2">
- <button class='sub__date btn'>套用</button>
- </div>
- <div class="text-muted mb-2 border-bottom">追蹤關鍵字排名</div>
- <div class="row g-5 mb-3">
- <div class="col-sm-4">
- <div class="card p-3">
- <div class="card-body text-center">
- <h5 class="card-title card__rank__title mb-2">排名前一頁關鍵字</h5>
- <p class="card-text" >
- </p>
- <span href="#" class="rank__mark"><strong id="globalrank" class="rank_num">1000</strong>個</span>
- </div>
- </div>
- </div>
- <div class="col-sm-4">
- <div class="card p-3">
- <div class="card-body text-center">
- <h5 class="card-title card__rank__title mb-2">排名前三頁關鍵字</h5>
- <p class="card-text">
- </p>
- <span href="#" class="rank__mark"><strong id="countryrank" class="rank_num">100</strong>個</span>
- </div>
- </div>
- </div>
- <div class="col-sm-4">
- <div class="card p-3">
- <div class="card-body text-center">
- <h5 class="card-title card__rank__title mb-2"><i class="fas fa-tags"></i>排名前十頁關鍵字</h5>
- <p class="card-text card__rank__cat" id="category">
- </p>
- <span href="#" class="rank__mark"><strong id="countryrank" class="rank_num">100</strong>個</span>
- </div>
- </div>
- </div>
- </div>
- <div class="text-muted mb-2">追蹤關鍵字列表</div>
- <table id="dtBasicExample" class="table" cellspacing="0" width="100%">
- <thead>
- <tr>
- <th class="th-sm">關鍵字
- </th>
- <th class="th-sm">排名
- </th>
- <th class="th-sm">搜尋量
- </th>
- <th class="th-sm">曝光數
- </th>
- <th class="th-sm">CTR
- </th>
- <th class="th-sm">頁面搜尋流量
- </th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Tiger Nixon</td>
- <td>System Architect</td>
- <td>Edinburgh</td>
- <td>61</td>
- <td>2011/04/25</td>
- <td>989</td>
- <td><i class="fas fa-trash-alt"></i></td>
- </tr>
- <tr>
- <td>Garrett Winters</td>
- <td>Accountant</td>
- <td>Tokyo</td>
- <td>63</td>
- <td>2011/07/25</td>
- <td>989</td>
- <td><i class="fas fa-trash-alt"></i></td>
- </tr>
- <tr>
- <td>Ashton Cox</td>
- <td>Junior Technical Author</td>
- <td>San Francisco</td>
- <td>66</td>
- <td>2009/01/12</td>
- <td>989</td>
- <td><i class="fas fa-trash-alt"></i></td>
- </tr>
- </tbody>
- </table>
- <div class="text-muted mb-2">搜尋關鍵字現況(連google search console 資料)</div>
- <table id="dtBasicExample" class="table" cellspacing="0" width="100%">
- <thead>
- <tr>
- <th class="th-sm">關鍵字
- </th>
- <th class="th-sm">排名
- </th>
- <th class="th-sm">搜尋量
- </th>
- <th class="th-sm">曝光數
- </th>
- <th class="th-sm">CTR
- </th>
- <th class="th-sm">頁面搜尋流量
- </th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Tiger Nixon</td>
- <td>System Architect</td>
- <td>Edinburgh</td>
- <td>61</td>
- <td>2011/04/25</td>
- <td>989</td>
- <td><i class="fas fa-trash-alt"></i></td>
- </tr>
- <tr>
- <td>Garrett Winters</td>
- <td>Accountant</td>
- <td>Tokyo</td>
- <td>63</td>
- <td>2011/07/25</td>
- <td>989</td>
- <td><i class="fas fa-trash-alt"></i></td>
- </tr>
- <tr>
- <td>Ashton Cox</td>
- <td>Junior Technical Author</td>
- <td>San Francisco</td>
- <td>66</td>
- <td>2009/01/12</td>
- <td>989</td>
- <td><i class="fas fa-trash-alt"></i></td>
- </tr>
- </tbody>
- </table>
- <div class="text-muted mb-2">關鍵字建議</div>
- <table id="dtBasicExample" class="table" cellspacing="0" width="100%">
- <thead>
- <tr>
- <th class="th-sm">關鍵字
- </th>
- <th class="th-sm">排名
- </th>
- <th class="th-sm">搜尋量
- </th>
- <th class="th-sm">曝光數
- </th>
- <th class="th-sm">CTR
- </th>
- <th class="th-sm">頁面搜尋流量
- </th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Tiger Nixon</td>
- <td>System Architect</td>
- <td>Edinburgh</td>
- <td>61</td>
- <td>2011/04/25</td>
- <td>989</td>
- <td><i class="fas fa-trash-alt"></i></td>
- </tr>
- <tr>
- <td>Garrett Winters</td>
- <td>Accountant</td>
- <td>Tokyo</td>
- <td>63</td>
- <td>2011/07/25</td>
- <td>989</td>
- <td><i class="fas fa-trash-alt"></i></td>
- </tr>
- <tr>
- <td>Ashton Cox</td>
- <td>Junior Technical Author</td>
- <td>San Francisco</td>
- <td>66</td>
- <td>2009/01/12</td>
- <td>989</td>
- <td><i class="fas fa-trash-alt"></i></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <footer class="footer text-center p-4 bg-white">
- <div class="text-muted"> © 2021 Copyright: Googo Website Traffic</div>
- </footer>
- <script
- src="https://code.jquery.com/jquery-3.6.0.min.js"
- integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
- crossorigin="anonymous"></script>
- <script src="https://unpkg.com/js-datepicker"></script>
- <script>
- const input = document.getElementById("search_query");
- const search__btn = document.getElementById("search__btn");
- const picker_str = datepicker('#daterng1', {
- id: 1
- });
- const picker_end = datepicker('#daterng2', {
- id: 1
- });
- $('.sub__date').click(function(e){
- e.preventDefault();
- console.log(picker_end.getRange());
- });
- search__btn.addEventListener("click", function(e) {
- e.preventDefault();
- check_form();
- })
- input.addEventListener("keyup", function(event) {
- // Number 13 is the "Enter" key on the keyboard
- if (event.keyCode === 13) {
- check_form();
- event.preventDefault();
- // document.getElementById("myBtn").click();
- }
- });
- $(document).ready(function () {
- $('#dtBasicExample').DataTable();
- $('.dataTables_length').addClass('bs-select');
- });
- const myChart = echarts.init(document.getElementById('main'));
- let option;
- function check_form(){
- const qry = document.getElementById('search_query').value;
- axios.get('http://www.googo.org:8080/domain/' + qry)
- .then((response) => {
- const sitename = document.getElementById('sitename');
- const sitetitle = document.getElementById('sitetitle');
- const descriptions = document.getElementById('descriptions');
- const globalrank = document.getElementById('globalrank');
- const countryrank = document.getElementById('countryrank');
- const category = document.getElementById('category');
- console.log(response.data);
- // alert(response.data.SiteName);
- // var obj = JSON.parse(response.data);
- // alert(obj);
- itename.textContent =response.data.SiteName;
- descriptions.textContent=response.data.Description;
- globalrank.textContent=response.data.GlobalRank.Rank;
- sitetitle.textContent=response.data.Title;
- countryrank.textContent=response.data.CountryRank.Rank;
- category.textContent=response.data.Category;
-
- const key_ary=[];
- const val_ary=[];
- for (const [key, value] of Object.entries(response.data.EstimatedMonthlyVisits)) {
- key_ary.push(key);
- val_ary.push(value);
- }
- option = {
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data: key_ary
- },
- yAxis: {
- type: 'value'
- },
- series: [{
- data: val_ary,
- type: 'line',
- areaStyle: {}
- }]
- };
- myChart.setOption(option);
- // sitename.innerHTML =response.data
- var bar = document.getElementById('bar');
- var barChart = echarts.init(bar);
- let traffics;
- traffics = {
- title: {
- text: '世界人口总量',
- subtext: '数据来自网络'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- }
- },
- legend: {
- data: ['2011年', '2012年']
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: {
- type: 'value',
- boundaryGap: [0, 0.01]
- },
- yAxis: {
- type: 'category',
- data: ['巴西', '印尼', '美国', '印度', '中国', '世界人口(万)']
- },
- series: [
- {
- name: '2011年',
- type: 'bar',
- data: [18203, 23489, 29034, 104970, 131744, 630230]
- },
- {
- name: '2012年',
- type: 'bar',
- data: [19325, 23438, 31000, 121594, 134141, 681807]
- }
- ]
- };
- traffics && barChart.setOption(traffics);
- console.log(response.status);
- console.log(response.statusText);
- console.log(response.headers);
- console.log(response.config);
- });
- }
- </script>
- </body>
-
- </html>
|