😮使用GitHub api提取到数据,实现提取函数以及对比更新函数
This commit is contained in:
@@ -195,6 +195,66 @@
|
||||
"print(f\"feedparser 版本: {feedparser.__version__}\")\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# 将系统路径设置为../\n",
|
||||
"import sys\n",
|
||||
"sys.path.append(\"../\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{\n",
|
||||
" \"emails\": [\n",
|
||||
" \"3162475700@qq.com\"\n",
|
||||
" ]\n",
|
||||
"}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from rss_subscribe.push_article_update import extract_emails_from_issues\n",
|
||||
"import json\n",
|
||||
"\n",
|
||||
"api_url = \"https://api.github.com/repos/willow-god/Friend-Circle-Lite/issues\"\n",
|
||||
"emails = extract_emails_from_issues(api_url)\n",
|
||||
"print(json.dumps(emails, indent=2))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"从 https://blog.qyliu.top/ 获取到 5 篇文章,其中 0 篇为新文章\n",
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from rss_subscribe.push_article_update import get_latest_articles_from_link\n",
|
||||
"import json\n",
|
||||
"\n",
|
||||
"url = \"https://blog.qyliu.top/\"\n",
|
||||
"articles = get_latest_articles_from_link(url, last_articles_path=\"../rss_subscribe/last_articles.json\")\n",
|
||||
"print(articles)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
|
||||
Reference in New Issue
Block a user