zooeytsai 2 年之前
父節點
當前提交
441453b294
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      SEO/yt_comment.py

+ 5 - 2
SEO/yt_comment.py

@@ -86,8 +86,11 @@ def comment_page(driver, urls, comment):
 
 def random_comment():
     # You can edit these lines=======
-    df = pd.read_excel('/Users/zooeytsai/Downloads/yt留言.xlsx')
-    messages = df['文字']
+    # df = pd.read_excel('/Users/zooeytsai/Downloads/yt留言.xlsx')
+    # messages = df['文字']
+    r = redis.Redis(host='db.ptt.cx', port=6379, db=0, password='choozmo9')
+    js = r.get('yt_comment')
+    messages = json.loads(js)
     # ===============================
     r = np.random.randint(0, len(messages))
     print(messages[r])