소스 검색

move raw_domain

ming 3 년 전
부모
커밋
bdca467003
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      similar_web/main.py

+ 4 - 4
similar_web/main.py

@@ -112,11 +112,11 @@ async def get_domain_by_keyword(req:kw_req):
         domain_name='http://'+domain_name
     domain_name = domain_name.replace('%3A',':')
     domain_name = domain_name.replace('%2F','/')
-    print(domain_name)
+
     querystring = {"website":domain_name}
     db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/hhh?charset=utf8mb4')
-    
-    statement = 'SELECT * FROM storage_similar_web where SiteName ="'+ raw_domain+'"'
+
+    statement = 'SELECT * FROM storage_similar_web where SiteName ="'+ domain_name+'"'
     jsdict = None
     for row in db.query(statement):
         jsdict = {'SiteName':row['SiteName'],'Description':row['Description'],'GlobalRank':row['GlobalRank']
@@ -144,7 +144,7 @@ async def get_domain_by_keyword(req:kw_req):
             jsdict['EstimatedMonthlyVisits']=js2['monthlyVisitsEstimate']
         except:
             jsdict['totalVisits'] = -1
-            jsdict['EstimatedMonthlyVisits'] = []
+            jsdict['EstimatedMonthlyVisits'] = '[]'
 
         log_table = db['storage_similar_web']
         log_table.insert({'SiteName':raw_domain,'Description':jsdict['Description'],'GlobalRank':jsdict['GlobalRank']