|
@@ -49,7 +49,7 @@ def fake_traffic(jsdict):
|
|
|
jsdict['GlobalRank']-=fake_rank_plus*66
|
|
|
return jsdict
|
|
|
|
|
|
-def get_domain_data(raw_domain):
|
|
|
+async def get_domain_data(raw_domain):
|
|
|
url = "https://similarweb2.p.rapidapi.com/pageoverview"
|
|
|
domain_name=raw_domain
|
|
|
if 'http' not in domain_name:
|
|
@@ -121,12 +121,12 @@ async def index():
|
|
|
@app.post("/kw_dm")
|
|
|
async def get_domain_by_keyword(req:kw_req):
|
|
|
ls = domain_filter(search(req.keyword,num_results=20))
|
|
|
- jsdict = get_domain_data(ls[0])
|
|
|
+ jsdict = asyncio.run(get_domain_data(ls[0]))
|
|
|
return JSONResponse(content=jsdict)
|
|
|
|
|
|
@app.post("/dm")
|
|
|
async def get_domain_data(req:q_req):
|
|
|
- jsdict = get_domain_data(req.domain_name)
|
|
|
+ jsdict = asyncio.run(get_domain_data(req.domain_name))
|
|
|
print(jsdict)
|
|
|
return JSONResponse(content=jsdict)
|
|
|
|