跳转到主要内容

自动发布社交媒体更新

项目描述

自动发布

CI PyPI version

博客的社交媒体自动发布器。

支持的网站

  • Twitter(目前未测试)
  • Mastodon(任何实例)
  • Reddit(任何subreddit)
  • Bluesky

安装

自动发布 需要 Python 3.11 或更高版本,并在 PyPI 上提供

python -m pip install autopost

使用方法

usage: autopost [-h] [-V] [-v] [--dry-run] [--config-file CONFIG_FILE] {manual,atom} ...

auto-posts social media updates

positional arguments:
  {manual,atom}
    manual              auto-post manually
    atom                auto-post from an Atom RSS feed

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -v, --verbose         be more verbose while running (default: False)
  --dry-run             perform a dry-run (default: False)
  --config-file CONFIG_FILE
                        the file to load for configuration (default: ./autopost.toml)

示例

要使用 自动发布 做任何有意义的事情,您需要对其进行配置。请参阅 autopost.example.toml 以获取示例配置文件。

配置完成后,您可以使用 自动发布 手动发布帖子

$ autopost manual "test" --url "https://example.com" --tags foo bar
🎉 reddit:/r/enosuchblog: https://reddit.com/r/enosuchblog/comments/zldk8y/test/
🎉 mastodon:@yossarian@infosec.exchange: https://infosec.exchange/@yossarian/109509443715725349

...其中 --tags 是可选的。

或者,您可以使用 自动发布 atom 从 Atom 风格的 RSS 源检索帖子

autopost atom https://example.com/feed.xml

在这两种情况下,您可以通过传递 --dry-run 来查看 自动发布 发布什么,而不是实际执行操作

$ autopost --dry-run atom https://blog.yossarian.net/feed.xml
dry run: would have posted Modernizing my 1980s sound system with URL:
https://blog.yossarian.net/2022/11/07/Modernizing-my-1980s-sound-system and tags: ['howto', 'workflow', 'music']

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分发

autopost-0.0.7.tar.gz (9.7 kB 查看哈希值)

上传时间 源代码

构建分发

autopost-0.0.7-py3-none-any.whl (10.7 kB 查看哈希值)

上传时间 Python 3

由以下机构支持