def main():
print("Loading cache")
seen_posts = cache.load_cached_storage(cache_file, default_size=30)
print("Connecting to reddit")
r = praw.Reddit(user_agent=user_agent)
sub = r.get_subreddit(subreddit, fetch=False)
print("Getting new")
new = sub.get_new(limit=10)
new = seen_posts.get_diff(new)
print("New posts:")
print(new)
for post in new:
msg = create_post_message(post)
if msg:
print()
print(msg)
send_message(msg)
sr_forwarder.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录