MCPcopy Create free account

hub / github.com/chenyuan200356-droid/crypto-news-bot / functions

Functions58 in github.com/chenyuan200356-droid/crypto-news-bot

↓ 7 callersMethodget_session
(self)
database.py:77
↓ 4 callersMethodrun_cycle
执行一次完整的处理周期 tier: 指定处理的数据源级别(None表示全部)
main.py:74
↓ 4 callersMethodsend_message
发送消息到Telegram 返回: 是否成功
telegram_publisher.py:95
↓ 3 callersMethod_call_api
统一的API调用接口
ai_processor.py:45
↓ 3 callersMethod_extract_json
从文本中提取JSON
ai_processor.py:259
↓ 2 callersMethod_contains_blacklist
检查文本是否包含黑名单关键词
filter.py:66
↓ 2 callersMethodformat_message
格式化消息 格式: [Emoji]快讯名称 [中文表达:主体+动作+细节] [EnglishVersion] #Tag1 #Tag2
telegram_publisher.py:23
↓ 2 callersMethodsend_batch
批量发送消息 返回: 成功发送的数量
telegram_publisher.py:114
↓ 1 callersMethod_assess_importance
重要性判定 返回: (是否重要, 原因)
ai_processor.py:110
↓ 1 callersMethod_clean_html
清理HTML标签
fetcher.py:241
↓ 1 callersMethod_contains_whitelist
检查文本是否包含白名单关键词
filter.py:58
↓ 1 callersMethod_create_logic_signature
创建逻辑签名用于去重
ai_processor.py:251
↓ 1 callersMethod_extract_structure
结构化提取 返回: {subject, action, object, key_detail, tag}
ai_processor.py:158
↓ 1 callersMethod_fetch_api
获取API数据(如DeFiLlama, CoinMarketCap)
fetcher.py:176
↓ 1 callersMethod_fetch_rss
获取RSS源
fetcher.py:66
↓ 1 callersMethod_fetch_source
根据类型获取单个数据源
fetcher.py:50
↓ 1 callersMethod_fetch_twitter
获取Twitter内容 注意: 需要Twitter API密钥,这里提供框架 实际使用需要申请Twitter Developer账号
fetcher.py:165
↓ 1 callersMethod_fetch_web
爬取网页内容(如Binance公告页)
fetcher.py:107
↓ 1 callersMethod_flatten_keywords
展平关键词字典为列表
filter.py:21
↓ 1 callersMethod_generate_briefing
生成中英文快讯 返回: (中文快讯, 英文快讯)
ai_processor.py:201
↓ 1 callersMethod_generate_tags
生成标签字符串
telegram_publisher.py:70
↓ 1 callersMethod_get_emoji
根据标签选择emoji
telegram_publisher.py:55
↓ 1 callersMethod_get_recent_briefs
获取最近的快讯文本(用于语义对比)
deduplicator.py:90
↓ 1 callersMethod_is_semantically_duplicate
语义去重 与最近1小时的快讯进行相似度对比
deduplicator.py:54
↓ 1 callersMethod_parse_binance_announcements
解析Binance公告页面
fetcher.py:127
↓ 1 callersMethod_parse_cmc_data
解析CoinMarketCap数据,检测价格异动
fetcher.py:220
↓ 1 callersMethod_parse_defillama_data
解析DeFiLlama数据,检测TVL异动
fetcher.py:200
↓ 1 callersMethodadd_news_item
添加新闻条目
database.py:80
↓ 1 callersMethodbatch_process
批量处理新闻 返回: 处理结果列表
ai_processor.py:273
↓ 1 callersMethodcheck_duplicate
检查是否重复(基于逻辑签名和时间窗口)
database.py:94
↓ 1 callersMethodfetch_all
获取所有或指定tier的新闻
fetcher.py:28
↓ 1 callersMethodfilter_duplicates
批量过滤重复项 返回: 去重后的列表
deduplicator.py:115
↓ 1 callersMethodgenerate_content_hash
生成内容哈希用于去重
fetcher.py:252
↓ 1 callersMethodis_duplicate
检查是否重复 返回: (是否重复, 重复原因)
deduplicator.py:34
↓ 1 callersFunctionmain
主函数
main.py:202
↓ 1 callersMethodmark_as_sent
标记为已发送,更新去重记录
deduplicator.py:107
↓ 1 callersMethodprocess_news
处理单条新闻 返回: 处理结果字典 或 None(如果不重要)
ai_processor.py:72
↓ 1 callersMethodrun_scheduled
定时运行(主循环)
main.py:165
↓ 1 callersMethodsend_error_alert
发送错误告警
telegram_publisher.py:142
↓ 1 callersMethodshould_process
判断新闻是否应该处理 返回: True = 通过筛选, False = 丢弃
filter.py:28
↓ 1 callersMethodupdate_duplication_record
更新去重记录
database.py:110
Method__init__
(self, db_path='sqlite:///data/news_cache.db')
database.py:72
Method__init__
(self, token: str, chat_id: str)
telegram_publisher.py:18
Method__init__
(self, token: str, chat_id: str)
telegram_publisher.py:155
Method__init__
(self, config: Dict)
filter.py:16
Method__init__
初始化AI处理器 provider: "openai" 或 "claude" model: 模型名称,如果不指定则使用默认值
ai_processor.py:16
Method__init__
(self, db_manager, config: Dict)
deduplicator.py:19
Method__init__
(self, config)
fetcher.py:21
Method__init__
(self, config_path='config/config.yaml')
main.py:38
Methodformat_message
格式化消息
telegram_publisher.py:166
Methodget_matched_categories
获取匹配的关键词类别(用于后续标签生成)
filter.py:74
Methodget_unprocessed_news
获取未处理的新闻
database.py:138
Methodlog_event
记录系统日志
database.py:160
Methodmark_as_processed
标记新闻为已处理
database.py:148
Methodrun_once
运行一次(测试用)
main.py:197
Methodsend_batch
同步批量发送
telegram_publisher.py:162
Methodsend_daily_summary
发送每日汇总
telegram_publisher.py:134
Methodsend_message
同步发送单条消息
telegram_publisher.py:158