this post was submitted on 21 Jun 2023
110 points (100.0% liked)

Reddit Migration

37 readers
2 users here now

### About Community Tracking and helping #redditmigration to Kbin and the Fediverse. Say hello to the decentralized and open future. To see latest reeddit blackout info, see here: https://reddark.untone.uk/

founded 1 year ago
 

I've been working on a bot to automate crossposting from a given subreddit to a given Lemmy community. It's pretty basic and not very well tested but it's working if anyone wants to try it out.

For now it relies on the Reddit API because it has a handy streaming object and I didn't know you could just go to a subs homepage and append ".json" to the URL

Features right now:

  • Watches a sub and posts to Lemmy as new posts come in
  • Pulls images and videos from third party hosts and includes them in posts
  • Copies titles and selftexts

With this we can close the "content gap" between Reddit and Lemmy, similar to everyone posting Digg content to Reddit as Digg died due to checks notes corporate mismanagement at efforts to monetize. Huh.

Comment, fork, star, open issues and enjoy.

you are viewing a single comment's thread
view the rest of the comments
[–] lixus98@kbin.social 22 points 1 year ago* (last edited 1 year ago) (1 children)

I also made a similar bot, might be useful!, this one doesn't check every single post, only external links, I didn't want to repost original content or spam communities, so the post only gets one post per hour (which can be changed) and checks the community to see if there's a similar post there already (same link).

Edit: it uses the json page, and filters posts based on upvotes, downvotes, age, etc. It supports multiple subreddits and communities at the same time.

https://github.com/daniel-lxs/BotIt

[–] Mnmalst@kbin.social 1 points 1 year ago* (last edited 1 year ago) (1 children)

Ah sweet I was about to start working on something like this. Will definitely use it in the future. Thanks
*edit: Ah it still uses the public json endpoints. A "real" scrapper might be necessary in the future.

[–] lixus98@kbin.social 3 points 1 year ago* (last edited 1 year ago) (1 children)

You are right, I already had a scraper in progress, if it comes down to it I will use that instead.
Edit: also you can contribute if you want to, suggestions are 100% open.

[–] Mnmalst@kbin.social 1 points 1 year ago (1 children)

I might if I find something I am missing.
I have some specific requirements when it comes to scrapping. I am planning to use it on my phone in termux which doesn't allow all nodejs modules. Sadly also the most popular scrappers which use a xserver in the background. So it has to be very basic html scrapping which should be possible when you do it on the old.reedit site.

[–] lixus98@kbin.social 1 points 1 year ago* (last edited 1 year ago) (1 children)

I see, I used node bc that's what I'm most familiarized with. I'm running it from Digitalocean and seems to be stable for now.
But if you have different requirements you should definitely give making one a go.

[–] Mnmalst@kbin.social 2 points 1 year ago

Oh, nothing wrong with node at all. I used it for something very similar in the past myself. It's just that certain modules just don't work in termux.