Predicts the next lottery numbers for Chinese lotteries like Double Color Ball (双色球) and Super Lotto (大乐透). Use this skill when user asks to predict lottery results in Chinese (e.g., "预测双色球", "大乐透推荐").
Analyzes historical data from major Chinese lottery websites to provide statistical predictions for the next draw.
The user will provide:
采用四级数据获取策略,确保数据准确性和可靠性:
多数据源并行获取:
数据验证机制:
"{彩票类型}" 最新开奖结果、"{彩票类型}" 历史号码"{彩票类型}" 近50期开奖结果site:zhcw.com {彩票类型} 往期Analyze the retrieved data to identify:
Generate 1-5 sets of numbers based on a mix of Hot and Cold numbers. Disclaimer: Lottery draws are independent random events. Predictions are for entertainment only.
Generate a report in Chinese using the following format.
# {LotteryType} 预测分析报告
## 📅 基本信息
- **分析期数**: 近 {count} 期
- **数据来源**: {source_domain}
- **下期开奖**: {next_draw_date}
## 📊 历史数据分析
- **热号 (Hot)**: {hot_numbers}
- **冷号 (Cold)**: {cold_numbers}
## 🔮 推荐号码
根据历史走势分析,为您生成以下推荐:
| 方案 | 红球 | 蓝球/后区 | 说明 |
| :--- | :--- | :--- | :--- |
| 1 | {reds} | {blues} | {reason} |
| 2 | {reds} | {blues} | {reason} |
## 💡 购彩建议 (预算: {funds})
{suggestion_text}
> **⚠️ 风险提示**: 彩票无绝对规律,预测结果仅供参考,请理性投注。
import requests
import re
from collections import Counter
def fetch_lottery_data(lottery_type="双色球"):
'''从多个数据源获取彩票数据'''
data_sources = [
{'name': '中彩网', 'url': 'https://www.zhcw.com/ssq/'},
{'name': '500彩票网', 'url': 'https://kaijiang.500.com/ssq.shtml'},
]
all_reds = []
all_blues = []
for source in data_sources:
try:
response = requests.get(source['url'], headers={'User-Agent': 'Mozilla/5.0'}, timeout=15)
if response.status_code == 200:
numbers = re.findall(r'(\\d{2})', response.text)
reds = [n for n in numbers if n.isdigit() and 1 <= int(n) <= 33]
blues = [n for n in numbers if n.isdigit() and 1 <= int(n) <= 16]
if len(set(reds)) >= 30 and len(set(blues)) >= 14:
all_reds.extend(reds)
all_blues.extend(blues)
except:
continue
return all_reds, all_blues
def analyze_numbers(reds, blues):
'''分析热号和冷号'''
red_counter = Counter(reds)
blue_counter = Counter(blues)
hot_reds = [num for num, _ in red_counter.most_common(10)]
hot_blues = [num for num, _ in blue_counter.most_common(5)]
cold_reds = [num for num, _ in red_counter.most_common()[-10:]]
cold_blues = [num for num, _ in blue_counter.most_common()[-5:]]
return {
'hot_reds': hot_reds,
'hot_blues': hot_blues,
'cold_reds': cold_reds,
'cold_blues': cold_blues
}
import requests
from bs4 import BeautifulSoup
def duckduckgo_search(query, max_results=5):
'''使用DuckDuckGo进行搜索'''
url = 'https://html.duckduckgo.com/html/'
params = {'q': query, 'kl': 'us-en', 'kp': '1'}
response = requests.get(url, params=params, headers={'User-Agent': 'Mozilla/5.0'}, timeout=15)
if response.status_code == 200:
soup = BeautifulSoup(response.text, 'html.parser')
results = []
for result in soup.find_all('div', class_='result')[:max_results]:
title_elem = result.find('a', class_='result__title')
link_elem = result.find('a', class_='result__url')
snippet_elem = result.find('a', class_='result__snippet')
if title_elem and link_elem:
results.append({
'title': title_elem.get_text(strip=True),
'url': link_elem.get_text(strip=True),
'snippet': snippet_elem.get_text(strip=True)[:200] if snippet_elem else ''
})
return results
return []
User: "预测下期双色球" Action:
User: "大乐透,买50块钱的" Action:
User: "用DuckDuckGo搜索双色球数据" Action: 调用DuckDuckGo搜索功能获取补充数据
问题:之前的预测系统忽略了春节等节假日休市安排,导致给出错误的开奖时间。
修复内容:
lotteryPredict.js,符合此方的技术偏好# 预测大乐透,预算10元
node lotteryPredict.js dlt 10
# 预测双色球,预算20元
node lotteryPredict.js ssq 20
# 大乐透 预测分析报告
## 📅 基本信息
- **分析期数**: 近30期
- **数据来源**: 历史数据分析
- **下期开奖**: 2026年02月25日(周三)21:30
- **⚠️ 注意**: 当前处于春节休市期间,开奖时间可能调整
## 📊 历史数据分析
- **热号 (Hot)**: 红球 05, 12, 18, 23, 27, 30, 33, 08, 15, 21 | 蓝球 03, 07, 09, 11, 05
- **冷号 (Cold)**: 红球 01, 04, 06, 10, 13, 17, 20, 24, 28, 32 | 蓝球 02, 04, 06, 08, 10
## 🔮 推荐号码
根据历史走势分析,为您生成以下推荐:
| 方案 | 前区 | 后区 | 说明 |
| :--- | :--- | :--- | :--- |
| 1 | 05 12 18 23 27 | 03 07 | 热号策略 |
| 2 | 01 04 06 10 13 | 02 04 | 冷号策略 |
| 3 | 05 12 18 20 24 | 03 08 | 混合策略 |
## 💡 购彩建议 (预算: 10元)
- **可购买注数**: 5注
- **每注价格**: 2元
- **推荐方案**: 选择1-2组号码,分散风险
> **⚠️ 风险提示**: 彩票无绝对规律,预测结果仅供参考,请理性投注。
> **📅 节假日提醒**: 春节、国庆等长假期间彩票市场会休市,请关注官方通知。