|
@@ -0,0 +1,358 @@
|
|
|
+<!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>
|
|
|
+ <style>
|
|
|
+ body {
|
|
|
+ font-family: 'Lato', sans-serif;
|
|
|
+ }
|
|
|
+
|
|
|
+ #seo_string a {
|
|
|
+ background-color: #3845bb;
|
|
|
+ border: none;
|
|
|
+ border-radius: 5rem;
|
|
|
+ outline: none;
|
|
|
+ color: white;
|
|
|
+ font-size: 1rem;
|
|
|
+ padding: .2rem .6rem;
|
|
|
+ margin: .2rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ .overlay {
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ display: none;
|
|
|
+ position: fixed;
|
|
|
+ z-index: 1;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ background-color: rgb(0, 0, 0);
|
|
|
+ background-color: rgba(0, 0, 0, 0.6);
|
|
|
+ }
|
|
|
+
|
|
|
+ .overlay-content {
|
|
|
+ position: relative;
|
|
|
+ top: 25%;
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .overlay a {
|
|
|
+ padding: 8px;
|
|
|
+ text-decoration: none;
|
|
|
+ font-size: 36px;
|
|
|
+ color: #818181;
|
|
|
+ display: block;
|
|
|
+ transition: 0.3s;
|
|
|
+ }
|
|
|
+
|
|
|
+ .overlay a:hover,
|
|
|
+ .overlay a:focus {
|
|
|
+ color: #f1f1f1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .overlay .closebtn {
|
|
|
+ position: absolute;
|
|
|
+ top: 20px;
|
|
|
+ right: 45px;
|
|
|
+ font-size: 60px;
|
|
|
+ }
|
|
|
+
|
|
|
+ @media screen and (max-height: 450px) {
|
|
|
+ .overlay a {
|
|
|
+ font-size: 20px
|
|
|
+ }
|
|
|
+
|
|
|
+ .overlay .closebtn {
|
|
|
+ font-size: 40px;
|
|
|
+ top: 15px;
|
|
|
+ right: 35px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+
|
|
|
+<body class="color__grey">
|
|
|
+ <div id="myNav" class="overlay">
|
|
|
+ <div class="overlay-content">
|
|
|
+ <a href="#">載入資料中,請稍候</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- Navbar -->
|
|
|
+ <nav class="navbar navbar-expand-lg navbar-light bg-white">
|
|
|
+ <!-- Container wrapper -->
|
|
|
+ <div class="container-fluid">
|
|
|
+ <!-- Navbar brand -->
|
|
|
+ <a class="navbar-brand" href="#">Google Keyword Search Volume</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>
|
|
|
+ 首頁
|
|
|
+ </a>
|
|
|
+ </li>
|
|
|
+ <!--
|
|
|
+ <li class="nav-item text-center mx-2 mx-lg-1">m
|
|
|
+ <a class="nav-link" href="http://news.google.com">
|
|
|
+ <div>
|
|
|
+ <i class="fas fa-globe-americas fa-lg mb-1"></i>
|
|
|
+ </div>
|
|
|
+ 新聞
|
|
|
+ </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>
|
|
|
+ </div>
|
|
|
+ 關鍵字
|
|
|
+ </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">
|
|
|
+ <input type="search" class="form-control search__bar" placeholder="在此輸入關鍵字" aria-label="Domain Name"
|
|
|
+ id="search_query" />
|
|
|
+ <button class="btn btn-primary search__btn" type="button" data-mdb-ripple-color="dark" id="search__btn">
|
|
|
+ 查詢
|
|
|
+ </button>
|
|
|
+ </form>
|
|
|
+ <h3 class="h3 text-center" id="sitename">Website Traffic</h3>
|
|
|
+ <div class="card card__grback mb-4">
|
|
|
+ <div class="card-body card__left">
|
|
|
+ <!-- 根據搜尋內容顯示網站標題及網站內容簡介 -->
|
|
|
+ <h5 class="card-title card__url" id="sitetitle"><i class="fas fa-chart-bar card__url__icon"></i>Example.com
|
|
|
+ </h5>
|
|
|
+ <p class="card-text card__intro" id="descriptions">
|
|
|
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Ut ipsa totam maxime pariatur iure
|
|
|
+ suscipit nihil possimus deserunt esse blanditiis. Quidem aliquid, voluptas quae tenetur quaerat
|
|
|
+ iure explicabo repellat ad.
|
|
|
+ </p>
|
|
|
+ <!-- <a href="#" class="btn btn-primary" id="globalrank2"></a> -->
|
|
|
+ </div>
|
|
|
+ </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">
|
|
|
+ Lorem
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </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>
|
|
|
+ function openNav() {
|
|
|
+ document.getElementById("myNav").style.display = "block";
|
|
|
+ }
|
|
|
+
|
|
|
+ function closeNav() {
|
|
|
+ document.getElementById("myNav").style.display = "none";
|
|
|
+ }
|
|
|
+
|
|
|
+ const input = document.getElementById("search_query");
|
|
|
+ const search__btn = document.getElementById("search__btn");
|
|
|
+ const btn__benefit = document.querySelectorAll(".btn__benefit");
|
|
|
+
|
|
|
+ $('.sub__date').click(function (e) {
|
|
|
+ e.preventDefault();
|
|
|
+ console.log(picker_end.getRange());
|
|
|
+ });
|
|
|
+ search__btn.addEventListener("click", function (e) {
|
|
|
+ openNav()
|
|
|
+ e.preventDefault();
|
|
|
+ check_form();
|
|
|
+ })
|
|
|
+
|
|
|
+ btn__benefit.forEach((item, i) => {
|
|
|
+ item.addEventListener("click", function () {
|
|
|
+ item.toggleClass('active');
|
|
|
+ })
|
|
|
+ });
|
|
|
+ $('#search_query').keydown(function (e) {
|
|
|
+ //
|
|
|
+ if (event.keyCode == 13) {
|
|
|
+ document.getElementById('search__btn').click()
|
|
|
+ e.preventDefault();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ const myChart = echarts.init(document.getElementById('main'));
|
|
|
+ let option;
|
|
|
+
|
|
|
+ function check_form() {
|
|
|
+
|
|
|
+ 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');
|
|
|
+ response = ''
|
|
|
+
|
|
|
+ dataOBJ = { 'keyword': $('#search_query').val() }
|
|
|
+ objstr = JSON.stringify(dataOBJ);
|
|
|
+ console.log(objstr)
|
|
|
+ $.get("http://www.googo.org:8001/random_kw", function (result) {
|
|
|
+ var seoStr = ''
|
|
|
+ var step;
|
|
|
+ console.log(result)
|
|
|
+ for (let i = 0; i < result.length; i++) {
|
|
|
+ seoStr = seoStr + '<a class=tag>' + result[i].kw + '</a>'
|
|
|
+ }
|
|
|
+ seoStr = seoStr.substring(0, seoStr.length - 1);
|
|
|
+ $('#seo_string').html(seoStr)
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ url: 'http://www.googo.org:8001/kw_dm',
|
|
|
+ //url: 'http://www.choozmo.com:8888/qqreq',
|
|
|
+ dataType: 'json', // 預期從server接收的資料型態
|
|
|
+ contentType: 'application/json; charset=utf-8', // 要送到server的資料型態
|
|
|
+ type: 'post',
|
|
|
+ data: objstr,
|
|
|
+ success: function (suc_data) {
|
|
|
+ response = suc_data
|
|
|
+ sitename.textContent = response.SiteName;
|
|
|
+ descriptions.textContent = response.Description;
|
|
|
+ globalrank.textContent = response.GlobalRank;
|
|
|
+ sitetitle.textContent = response.Title;
|
|
|
+ countryrank.textContent = response.CountryRank;
|
|
|
+ category.textContent = response.Category;
|
|
|
+ if (response.totalVisits != -1) {
|
|
|
+ $('#maxflow').html(response.totalVisits+'人次')
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $('#maxflow').html("N/A")
|
|
|
+ }
|
|
|
+
|
|
|
+ key_ary = [];
|
|
|
+ val_ary = [];
|
|
|
+
|
|
|
+ for (const [key, value] of Object.entries(response.EstimatedMonthlyVisits)) {
|
|
|
+ key_ary.push(key);
|
|
|
+ val_ary.push(value);
|
|
|
+ }
|
|
|
+
|
|
|
+ option = {
|
|
|
+
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'axis'
|
|
|
+ },
|
|
|
+ xAxis: {
|
|
|
+ type: 'category',
|
|
|
+ boundaryGap: false,
|
|
|
+ data: key_ary
|
|
|
+ },
|
|
|
+ yAxis: {
|
|
|
+ type: 'value'
|
|
|
+ },
|
|
|
+ series: [{
|
|
|
+ data: val_ary,
|
|
|
+ type: 'line',
|
|
|
+ areaStyle: {},
|
|
|
+
|
|
|
+ }]
|
|
|
+ };
|
|
|
+ myChart.setOption(option);
|
|
|
+ closeNav()
|
|
|
+ },
|
|
|
+ //data:JSON.stringify({n1:"12",n2:"22"}),
|
|
|
+ error: function (error) {
|
|
|
+ alert('此網頁無法查詢!')
|
|
|
+ closeNav()
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </script>
|
|
|
+
|
|
|
+</body>
|
|
|
+
|
|
|
+
|
|
|
+</html>
|