Skip to main content

NoneBot2插件 - 获取Hacker News文章并进行播报

Project description

nonebot-plugin-hacker-news

获取 Hacker News 热门文章的Nonebot插件, 支持获取热门、最新、最佳文章以及文章详情和评论

安装

通过 pip 安装

pip install nonebot-plugin-hacker-news

通过 nb-cli 安装

nb plugin install nonebot-plugin-hacker-news

基本命令

/hn:获取Hacker News热门文章,默认获取前5条
/hn top [数量]:获取热门文章,默认5条
/hn new [数量]:获取最新文章,默认5条
/hn best [数量]:获取最佳文章,默认5条
/hn item [ID]:获取特定文章详情
/hn comments [ID]:获取特定文章及其评论

定时播报控制

/hn_broadcast on:开启定时播报功能
/hn_broadcast off:关闭定时播报功能
/hn_broadcast status:查看定时播报状态
/hn_broadcast mode [interval|cron]:设置播报模式(间隔或定时)
/hn_broadcast interval [秒数]:设置播报间隔(最小60秒)
/hn_broadcast cron [表达式]:设置每天固定时间播报,格式为"分 时 日 月 星期"

配置

api_base_url = "https://hacker-news.firebaseio.com/v0"
api_timeout = 10  # 请求超时时间,单位秒

auto_broadcast = False  # 是否开启定时播报
broadcast_mode = "interval"  # "interval"为间隔模式,"cron"为定时模式
broadcast_interval = 3600  # 定时播报间隔,单位秒
broadcast_cron = "0 8 * * *"  # cron表达式,默认每天早上八点
max_comments_depth = 3  # 获取评论的最大深度
max_items_per_request = 10  # 单次请求最大获取条数
broadcast_groups = [123456789]  # 定时播报群组列表
broadcast_articles_count = 5  # 每次播报的文章数量

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_hacker_news-0.1.2.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_hacker_news-0.1.2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_hacker_news-0.1.2.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_hacker_news-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f51087d84ec46270998e0a83a4aafa2b8148f6dc1d9cea976ce98bfbb2272454
MD5 9e9f6a9a5c9df17c0a52114ab8f30692
BLAKE2b-256 7a6ac066b7e50f87e234fca021daa37ac0ba03e2c82a4926165981b699a77a23

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_hacker_news-0.1.2.tar.gz:

Publisher: python-publish.yml on perfsakuya/nonebot-plugin-hacker-news

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nonebot_plugin_hacker_news-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_hacker_news-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bab9fcb8840558861029f5cd93f001f56aa1bc789b93a7529c8cc1346b5297ce
MD5 13570561952e5dd9de3b0df314b4e330
BLAKE2b-256 d8c767b1c2dba583d0ebedb0969d2b2ebece6a0ea2f21daff92663e8457a3e0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_hacker_news-0.1.2-py3-none-any.whl:

Publisher: python-publish.yml on perfsakuya/nonebot-plugin-hacker-news

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page