-
Notifications
You must be signed in to change notification settings - Fork 389
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
6 changed files
with
624 additions
and
26 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,31 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# @Time : 2021/2/20 0020 | ||
# @Author : justin.郑 [email protected] | ||
# @File : history_daily.py | ||
# @Desc : 历史上的今日 | ||
|
||
import json | ||
import pandas as pd | ||
import requests | ||
|
||
|
||
def history_daily(): | ||
""" | ||
历史上的今日 | ||
Returns | ||
------- | ||
DataFrame | ||
"year,title, type, link, desc"" | ||
""" | ||
url = "https://www.bjsoubang.com/api/getHistoryDaily" | ||
r = requests.get(url=url) | ||
res_list = json.loads(r.text)['info'] | ||
df = pd.DataFrame(res_list) | ||
df = df.drop(['cover', 'festival', 'recommend', 'pv'], axis=1) | ||
return df | ||
|
||
|
||
if __name__ == "__main__": | ||
history_daily() | ||
|
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,223 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# @Time : 2021/2/20 0020 | ||
# @Author : justin.郑 [email protected] | ||
# @File : hot_list.py | ||
# @Desc : 各类榜单 | ||
|
||
import json | ||
import pandas as pd | ||
import requests | ||
|
||
|
||
def douban_movie_list(): | ||
""" | ||
豆瓣新片榜 | ||
Returns | ||
------- | ||
DataFrame | ||
"titleCn, title,rate, link, img, description, ranking" | ||
""" | ||
url = "https://www.bjsoubang.com/api/getChannelData" | ||
params = { | ||
"channel_id": 16 | ||
} | ||
r = requests.get(url=url, params=params) | ||
res_list = json.loads(r.text)['info']['data'] | ||
df = pd.DataFrame(res_list) | ||
df['ranking'] = df.index + 1 | ||
return df | ||
|
||
|
||
def douban_week_praise_list(): | ||
""" | ||
豆瓣一周口碑榜 | ||
Returns | ||
------- | ||
DataFrame | ||
"title,trend, link, ranking" | ||
""" | ||
url = "https://www.bjsoubang.com/api/getChannelData" | ||
params = { | ||
"channel_id": 19 | ||
} | ||
r = requests.get(url=url, params=params) | ||
res_list = json.loads(r.text)['info']['data'] | ||
df = pd.DataFrame(res_list) | ||
return df | ||
|
||
|
||
def zhihu_hot_search_list(): | ||
""" | ||
知乎热搜榜 | ||
Returns | ||
------- | ||
DataFrame | ||
"display_query,query, link, ranking" | ||
""" | ||
url = "https://www.bjsoubang.com/api/getChannelData" | ||
params = { | ||
"channel_id": 10 | ||
} | ||
r = requests.get(url=url, params=params) | ||
res_list = json.loads(r.text)['info']['data'] | ||
df = pd.DataFrame(res_list) | ||
df['ranking'] = df.index + 1 | ||
return df | ||
|
||
|
||
def zhihu_hot_list(): | ||
""" | ||
知乎热榜 | ||
Returns | ||
------- | ||
DataFrame | ||
"title, img,description, link, ranking, hot" | ||
""" | ||
url = "https://www.bjsoubang.com/api/getChannelData" | ||
params = { | ||
"channel_id": 2 | ||
} | ||
r = requests.get(url=url, params=params) | ||
res_list = json.loads(r.text)['info']['data'] | ||
df = pd.DataFrame(res_list) | ||
df['ranking'] = df.index + 1 | ||
return df | ||
|
||
|
||
def wx_hot_word_list(): | ||
""" | ||
微信热词榜 | ||
Returns | ||
------- | ||
DataFrame | ||
"title, link, hot_rank, ranking" | ||
""" | ||
url = "https://www.bjsoubang.com/api/getChannelData" | ||
params = { | ||
"channel_id": 6 | ||
} | ||
r = requests.get(url=url, params=params) | ||
res_list = json.loads(r.text)['info']['data'] | ||
df = pd.DataFrame(res_list) | ||
df['ranking'] = df.index + 1 | ||
return df | ||
|
||
|
||
def wx_hot_list(): | ||
""" | ||
微信热门榜 | ||
Returns | ||
------- | ||
DataFrame | ||
"title, img,description, link, ranking" | ||
""" | ||
url = "https://www.bjsoubang.com/api/getChannelData" | ||
params = { | ||
"channel_id": 1 | ||
} | ||
r = requests.get(url=url, params=params) | ||
res_list = json.loads(r.text)['info']['data'] | ||
df = pd.DataFrame(res_list) | ||
df['ranking'] = df.index + 1 | ||
return df | ||
|
||
|
||
def weibo_hot_search_list(): | ||
""" | ||
微博热搜榜 | ||
Returns | ||
------- | ||
DataFrame | ||
"title, tag, link, hot, ranking" | ||
""" | ||
url = "https://www.bjsoubang.com/api/getChannelData" | ||
params = { | ||
"channel_id": 4 | ||
} | ||
r = requests.get(url=url, params=params) | ||
res_list = json.loads(r.text)['info']['data'] | ||
df = pd.DataFrame(res_list) | ||
df['ranking'] = df.index + 1 | ||
return df | ||
|
||
|
||
def weibo_new_era_list(): | ||
""" | ||
微博新时代榜 | ||
Returns | ||
------- | ||
DataFrame | ||
"title, link, ranking" | ||
""" | ||
url = "https://www.bjsoubang.com/api/getChannelData" | ||
params = { | ||
"channel_id": 5 | ||
} | ||
r = requests.get(url=url, params=params) | ||
res_list = json.loads(r.text)['info']['data'] | ||
df = pd.DataFrame(res_list) | ||
df['ranking'] = df.index + 1 | ||
return df | ||
|
||
|
||
def baidu_hot_list(): | ||
""" | ||
百度实时热点榜 | ||
Returns | ||
------- | ||
DataFrame | ||
"title, id, status, link_video, link_search, link_news, link_img, hot, ranking" | ||
""" | ||
url = "https://www.bjsoubang.com/api/getChannelData" | ||
params = { | ||
"channel_id": 3 | ||
} | ||
r = requests.get(url=url, params=params) | ||
res_list = json.loads(r.text)['info']['data'] | ||
df = pd.DataFrame(res_list) | ||
df['ranking'] = df.index + 1 | ||
return df | ||
|
||
|
||
def baidu_today_hot_list(): | ||
""" | ||
百度今日热点榜 | ||
Returns | ||
------- | ||
DataFrame | ||
"title, id, status, link_video, link_search, link_news, link_img, hot, ranking" | ||
""" | ||
url = "https://www.bjsoubang.com/api/getChannelData" | ||
params = { | ||
"channel_id": 12 | ||
} | ||
r = requests.get(url=url, params=params) | ||
res_list = json.loads(r.text)['info']['data'] | ||
df = pd.DataFrame(res_list) | ||
df['ranking'] = df.index + 1 | ||
return df | ||
|
||
|
||
def baidu_hot_word_list(): | ||
""" | ||
百度百科热词榜 | ||
Returns | ||
------- | ||
DataFrame | ||
"title, link, status, description, ranking" | ||
""" | ||
url = "https://www.bjsoubang.com/api/getChannelData" | ||
params = { | ||
"channel_id": 9 | ||
} | ||
r = requests.get(url=url, params=params) | ||
res_list = json.loads(r.text)['info']['data'] | ||
df = pd.DataFrame(res_list) | ||
df['ranking'] = df.index + 1 | ||
return df | ||
|
||
|
||
if __name__ == "__main__": | ||
weibo_new_era_list() | ||
|
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