forked from sfyc23/EverydayWechat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Project: EverydayWechat-Github | ||
Creator: DoubleThunder | ||
Create time: 2019-07-14 01:00 | ||
Introduction: | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Project: EverydayWechat-Github | ||
Creator: DoubleThunder | ||
Create time: 2019-07-14 01:02 | ||
Introduction: http://www.atoolbox.net/Tool.php?Id=804 | ||
""" | ||
|
||
import requests | ||
from everyday_wechat.utils.common import SPIDER_HEADERS | ||
|
||
|
||
def get_atoolbox_rubbish(key): | ||
""" | ||
# http://www.atoolbox.net/Tool.php?Id=804 | ||
:param key: | ||
:return: | ||
""" | ||
params = {'key': key} | ||
resp = requests.get('http://www.atoolbox.net/api/GetRefuseClassification.php', | ||
headers=SPIDER_HEADERS, | ||
params=params) | ||
|
||
if resp.status_code == 200: | ||
# print(resp.text) | ||
content_dict = resp.json() | ||
if not content_dict: | ||
return None, None, None | ||
return_list = list(content_dict.values()) | ||
_type = '' | ||
for rl in return_list: | ||
if key == rl['name']: | ||
_type = rl['type'] | ||
break | ||
other = '' | ||
if not _type: | ||
other = ' '.join(i['name'] for i in return_list[:6]) | ||
return _type, return_list, other | ||
return None, None, None |