Your Name 3 years ago
parent
commit
7dd80a2e14
2 changed files with 28 additions and 0 deletions
  1. 7 0
      layouts/partials/newsanchor.html
  2. 21 0
      python_utils/gen_daily_report.py

+ 7 - 0
layouts/partials/newsanchor.html

@@ -36,6 +36,13 @@
         <div class="col-md-12">
             <p class="video__desc">集仕多人工智慧合成主播是我們大數據智慧服務之一。</p>
         </div>
+        <div class="heading text-center">
+            <h2>台灣第一個人工智慧合成主播</h2>
+        </div>
+        <div class="col-md-12">
+            <p class="video__desc">集仕多人工智慧合成主播是我們大數據智慧服務之一。</p>
+        </div>
+
     </div>
 
 </section>

+ 21 - 0
python_utils/gen_daily_report.py

@@ -0,0 +1,21 @@
+#!/usr/bin/python3
+from pytrends.request import TrendReq
+import pytrends
+import sys
+import datetime
+import traceback
+import requests
+from bs4 import BeautifulSoup
+import re
+#import farmlib
+import pandas as pd
+import random
+import os
+import dataset
+
+db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/yodb?charset=utf8mb4')
+
+cursor=db.query('SELECT distinct ts_word FROM trending_searches ORDER BY ts_date DESC limit 20;')
+for c in cursor:
+    print(c['ts_word'])
+