this post was submitted on 13 Aug 2023
5 points (60.0% liked)

Programming

17030 readers
246 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

Hey everyone.

Recently I found the "red2lem" bot here.

I forked it and made some changes to the code.

I've only tested it using Docker, but I think (?) it also should work independently of it.

Purpose of the Bot

The bot monitors a subreddit of your choosing, and it'll crosspost all posts to a lemmy community of your choosing. I guess it could be nice, if somebody wanted to create a mirror'ed community or something.

What does a mirrored post look like?

You can see an example here and here.

This is with the ENV title_template set to "[♻️ /u/{author_name}] - {submission_title}"

I want to try it out!

If you want to try it out, you can check the PR I made to the original repository.

Quick Docker Compose example

If you're too lazy, and don't want to go the PR, you can also just use this docker compose example:

version: "3.9"
services:
  red2lem:
    build: https://github.com/vp-en/red2lem.git#feat-revampProject
    container_name: red2lem
    environment:
      reddit_client_id: YOUR_REDDIT_CLIENT_ID
      reddit_client_secret: YOUR_REDDIT_CLIENT_SECRET
      lemmy_url: YOUR_LEMMY_URL
      lemmy_username: YOUR_LEMMY_USERNAME
      lemmy_password: YOUR_LEMMY_PASSWORD
      subreddit_name: YOUR_SUBREDDIT_NAME # e.g. NoStupidQuestions
      community_name: YOUR_COMMUNITY_NAME # e.g. [email protected]
      imgur_client_id: YOUR_IMGUR_CLIENT_ID # Optional
      imgur_client_secret: YOUR_IMGUR_CLIENT_SECRET # Optional
      copy_automoderator_posts: false # Optional, default is False
      post_check_interval: 60 # Optional, default is 60
      title_template: "[X-Posted from Reddit - /u/{author_name}] - {submission_title}" # Optional
    restart: unless-stopped
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 3 points 1 year ago (1 children)

Not right now. It might be something that could be added? I'm a bit worried how hard that would hit the APIs of both reddit and lemmy

[–] [email protected] 3 points 1 year ago (1 children)

Understood. Just trying to stay inside of lemmy as much as possible.

[–] [email protected] 3 points 1 year ago

Yeah, I get that 😁 .