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.3.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.3-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_hacker_news-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d96ad933419d6fdd759a670ced66020cb07563b37c3664df8c1c2f2835a3e2e0
MD5 8bc371f562deeb5e39851b63289dd3fb
BLAKE2b-256 06995db132beb5a0a93e6f375bbe3453f69e2030f0cc0519e83bdfe8cd89aa6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_hacker_news-0.1.3.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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_hacker_news-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 acdff5ad842cf371741acf40499dbf2936d2f976ae3b2cc206a0fe3cd621f48f
MD5 fd296c3bf27e09a065fde14c9e57fcc3
BLAKE2b-256 0936bf71cc3c45bf7855666fe1c498378aa2bcabdd42d2a7f1fafe606bb9aaf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_hacker_news-0.1.3-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