各平台今日热搜热文获取,让你一眼知天下!
2022/05/11 :
log:
+ 修补更新
2022/05/10 更新:
)
@maoboji,@jafee, @Zercher … 等等等人的反馈,当然还有许多人(谢不过来了)
+ 在上一版的基础上去除优化新闻标题排版和文字显示
+ 新增【更新】功能,默认打开软件自动检测更新(无任何弹窗提示),将在图片中展示。

2022/05/07 更新:
)
)
+ 在上一版的基础上去除【按钮跳转】,改为了新闻词条双击打开(依然是默认浏览器)
+ 在上一版的跳转按钮处,新增【测试交流】显示


2022/04/13 更新:

Adb应用管理器
的坛友应该会很熟悉这个界面
)
+ 增加了几个新闻源:

+【Go->】的功能:
使用默认浏览器跳转打开新闻!
源文件:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author: jingmo
@file: today_hot.py
@time: 2022/04/12 20:32:45
"""
import tkinter
from threading import Thread
from tkinter import ttk, messagebox
from requests import get
from lxml import etree
import webbrowser
HEADERS = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'
}
def gogo_start(item_url):
webbrowser.open(item_url)
def app_info():
messagebox.showinfo('提示', "本软件内所有新闻内容均来自:
【今日热点:https://tophub.today】
其内容未经证实不得肆意造谣!!!
同意请确定/否则请关闭并删除本软件!")
class SpinderMain(object):
def __init__(self):
self.all_url = {
'微博热搜': 'https://tophub.today/n/KqndgxeLl9',
'微信 ‧ 24h热文榜': 'https://tophub.today/n/WnBe01o371',
'澎湃 ‧ 首页要闻': 'https://tophub.today/n/5PdMxAbvmg',
'百度实时热点': 'https://tophub.today/n/Jb0vmloB1G',
' ‧ 今日热帖': 'https://tophub.today/n/NKGoRAzel6',
' ‧ 原创发布区': 'https://tophub.today/n/qndgO7LdLl',
'知乎热榜': 'https://tophub.today/n/mproPpoq6O',
'虎嗅热文': 'https://tophub.today/n/5VaobgvAj1',
'哔哩哔哩全站排行': 'https://tophub.today/n/74KvxwokxM',
'抖音热搜': 'https://tophub.today/n/K7GdaMgdQy',
'抖音 ‧ 正能量榜': 'https://tophub.today/n/1yjvQqDvbg',
'豆瓣电影 ‧ 最受欢迎的影评': 'https://tophub.today/n/2me38jrowj'
}
# 初始化下拉列表
self.add_url_box()
# 初始化完毕后,加载新闻
self.post_url()
def delButton(self, tree):
x = tree.get_children()
for item in x:
tree.delete(item)
def get_text(self, hot_url):
response = get(url=hot_url, headers=HEADERS)
html = etree.HTML(response.content.decode('utf-8'))
self.delButton(tree)
ind = 0[/align]
[align=left] # 脱敏 处理 本处是一个网页元素摘取
def add_url_box(self):
# 创建下拉菜单
self.xaunze_ = ttk.Combobox(root, font=('宋体', 16, "bold"), width=18, state="readonly")
hot_title_list = []
for hot_title in self.all_url:
hot_title_list.append(hot_title)
# 设置下拉菜单中的值
self.xaunze_['value'] = tuple(hot_title_list)
# 设置默认值,即默认下拉框中的内容
self.xaunze_.current(0)
self.xaunze_.place(x=14, y=14)
def post_url(self):
hot_title = self.xaunze_.get()
title_url = self.all_url[hot_title]
Thread(target=self.get_text, args=(title_url,)).start()
# self.get_text(hot_url=title_url)
def gogo(self):
if str(len(tree.selection())) != "0":
for items in tree.selection():
item_text = tree.item(items, "values")[2]
print("已选择:" + item_text) # 输出所选行的第一列的值
if item_text != "":
Thread(target=gogo_start, args=(item_text,)).start()
else:
messagebox.showinfo('提示', "没有选择新闻词条!")
# 主入口
if __name__ == '__main__':
root = tkinter.Tk()
root.title("Taday_Hot 重置版 - 内容来源:【今日热榜】 - By:jingmo") # #窗口标题
root.geometry("700x400+700+360") # #窗口位置500后面是字母x
root.resizable(False, False)
# 加载软件信息
Thread(target=app_info, args=()).start()
# 表格
tree = ttk.Treeview(root, height=16, show="headings") # #创建表格对象
style_head = ttk.Style()
style_head.configure("Treeview", font="微软雅黑")
tree["columns"] = ("热度", "事件") # #定义列
tree.column("热度", width=100, anchor='center')
tree.column("事件", width=600, anchor='center')
tree.heading("热度", text="热度")
tree.heading("事件", text="-- 事件 --")
VScroll1 = ttk.Scrollbar(tree, orient='vertical', command=tree.yview)
VScroll1.place(relx=0.97, rely=0.005, relwidth=0.024, relheight=0.99)
# 给treeview添加配置
tree.configure(yscrollcommand=VScroll1.set)
tree.place(x=0, y=50)
# 初始化加载对象
ui = SpinderMain()
chaxunde = tkinter.Button(root, text="查询", font=('宋体', 12, "bold"), width=9, command=ui.post_url)
chaxunde.config(fg="orange", bg="white")
chaxunde.place(x=260, y=12)
app_info_ = tkinter.Button(root, text="GO—>", font=('宋体', 12, "bold"), width=12, command=ui.gogo)
app_info_.config(fg="green", bg="white")
app_info_.place(x=550, y=12)
root.mainloop()
第一版:说明!
{
好了,废话不多说,上才艺。。。
今日热榜 ,
采用爬虫方式,从中获取
数据并解析分类,
运行截图:
1.旧版控制窗口输出(缺点:黑框框不好看。优点:有跳转链接,方便查看)

2.如本帖介绍的
GUI化(缺点:体积大,打开慢【这是python的不足】,其次就是没有做跳转链接(下次必定)
优点:直观)


新版链接:https://jingmo.lanzouq.com/ietSG04n3jxi
~~ 旧2版
链接:https://jingmo.lanzouq.com/i7ghp04g85wb ~~
~~ 旧
2版链接:https://jingmo.lanzouq.com/ixcsP033wrde ~~
~~ 旧1版链接:https://jingmo.lanzoui.com/iL7Upsci6ti ~~
欢迎给出意见和提议,动动手指,支持一下


















- 最新
- 最热
只看作者