Your Name 3 years ago
parent
commit
82fabf2828
2 changed files with 89 additions and 0 deletions
  1. 50 0
      hhh/SEO/contentgap.txt
  2. 39 0
      hhh/SEO/gsearch_test.py

+ 50 - 0
hhh/SEO/contentgap.txt

@@ -0,0 +1,50 @@
+拉 門
+北歐 風
+設計
+工業 風
+房間 佈置
+房間 布置
+客厅 設計
+衣櫃 設計
+室內 設計 師
+浴室 設計
+天花板 設計
+平面 設計 圖
+臥榻
+卧榻
+廚房 吊 櫃
+浴室 設計
+廁所 設計
+廁所 設計
+中島 廚房
+裝潢 費用
+小 房間 設計
+小坪 數 房間 設計
+小 房間 設計
+北歐 風 客廳
+小坪 數 房間 設計
+辦公室 設計
+天花板 裝潢
+鞋 柜 設計
+餐廳 設計
+拉 門 設計
+毛坯 屋
+辦公室 設計
+毛玻璃 拉 門
+鞋 櫃 設計
+100 設計
+2 坪 小 房間 佈置
+浴室 裝潢
+床 頭 衣櫃 設計
+透 天 裝潢
+屏風 設計
+隔 間 拉 門
+玻璃 隔 間
+推薦 室內 設計 師
+設計 圖
+台北 室內 設計 師
+工業 風 天花板
+店面 設計
+廁所 裝潢
+建築 設計
+油漆 顏色

+ 39 - 0
hhh/SEO/gsearch_test.py

@@ -0,0 +1,39 @@
+import  googlesearch
+import codecs
+import sys
+import time
+import dataset
+import os
+
+
+db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/hhh?charset=utf8mb4')
+table=db['hhh_contentgap_serp']
+
+#print(os.path.realpath('.'))
+curdir=os.path.realpath('.')
+
+fr=codecs.open(curdir+'/hhh/SEO/contentgap.txt','r','utf-8')
+lines=fr.readlines()
+lst=[]
+for l in lines:
+    lst.append(l.replace('\n',''))
+
+
+for l in lst[25:]:
+    time.sleep(5)
+    results=googlesearch.search(l, num_results=150)
+    idx=0
+    for r in results:
+        print(idx)
+        print(r)
+        if 'hhh.com.tw' in r:
+            print('found')
+            print(idx)
+            table.insert({'kw':l,'ranking':idx})
+            db.commit()
+            break
+        idx+=1
+        
+
+
+sys.exit()