|
@@ -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']
|