将帖子从一个子网站复制到另一个子网站的脚本。
subreddit-mirror的Python项目详细描述
亚红色镜子
这是一个简单的脚本,可以将帖子从一个子网站复制到另一个子网站, 理想用于将帖子复制到用于bot开发的私有subreddit 目的。它要求你是你正在复制的子版本的版主 发布到,并允许您选择,以及源/目标子编辑:
- 所选帖子的排序方法(热门、新、有争议和热门)
- 获取帖子的时间范围(天、周、月、年、全部)
- 要抓住多少个帖子
- 是否包含您镜像的帖子中的评论(此 功能非常耗时)
为什么?
每当我创建reddit机器人时,我通常会手动创建模拟 当我使用我的机器人时,我期望的帖子。这变得乏味,尤其是 随着时间的推移,机器人变得更具活力。相反,我想我可以写一个剧本 这将为我做这个乏味的工作,作为额外的奖励,内容 会是我要瞄准的subreddits的真实数据。
你不能用这个做垃圾邮件吗?我想是的,但你不应该。这个脚本包括一个简单的检查 确保您是镜像帖子的子版主。尽管 这很容易删除,我想任何想做垃圾邮件的人 机器人可以而且很可能不需要太多的努力。
安装
$ pip install subreddit-mirror
或者,从github发布页面手动下载并安装发布文件。
用法
usage: subreddit-mirror [-h] [--count COUNT]
[--sort {hot,new,controversial,top}]
[--time {day,week,month,year,all}] [--comments] [-v]
subreddit destination
Mirror posts from another subreddit.
positional arguments:
subreddit subreddit to copy posts from
destination destination subreddit to post to
optional arguments:
-h, --help show this help message and exit
--count COUNT how many posts to try to copy
--sort {hot,new,controversial,top}
how to sort posts
--time {day,week,month,year,all}
time frame to grab from
--comments [CAUTION] also mirror comments from threads, may take
a long time
-v, --version show program's version number and exit
可选参数默认值
Option | Default Parameter |
---|---|
^{ | ^{ |
^{ | ^{ |
^{ | ^{ |
^{ | ^{ |
示例
$ subreddit-mirror hiphopheads trapmuzik
将最新的15个poststoday从/r/hiphopheads复制到/r/trapmuzik
$ subreddit-mirror calamariraceteam motorcycles --count 10 --sort top --time all
:从/r/calamariraceteam复制到/r/motorkes的前10个职位
依赖关系
许可证
subreddit-mirror -- A script to copy posts from one subreddit to another.
Copyright (C) 2018 Jacob Patterson
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.