BotIt

ernest, in kbin API URL?
ernest avatar

I apologize, I need to make a change on the website and communicate it more clearly. Currently, the kbin API is disabled. I am considering the option of integrating with one of the existing APIs, but I need your opinion. Perhaps this is a good time and place to start a discussion :)

Xylia,

As a user, I see value in ensuring your API at the very least is “compatible with” Lemmy’s, as long as doing so doesn’t impact compatibility with other projects. Primarily because I see at least the Thread element of Kbin as very similar to the Lemmy experience, and I think it’d be healthy for the entire fediverse if efforts to make a tool/client for one of them could be easily retooled with minimal work or work as-is with the other.

I do worry this would prevent the Kbin project from having as much agency over how interactions are implemented and any future plans to expand the featureset, but as a non-developer I’m not sure how valid those concerns are when discussing building a compatible API.

Thank you for all the work and effort you’re putting in!

klin, in Welcome to BotIt. Got it?
klin avatar

tbh this shouldn't be SUPER hard on the reddit side (even without API). you can get a JSON of a subreddit by adding .json at the end

i.e. https://www.reddit.com/r/LocalLLaMA would be https://www.reddit.com/r/LocalLLaMA.json

and then maybe have a bot that runs every 15 minutes, pulls top 10 posts, and then aggregates their links. (this next part I'm not sure how we'd do) check against kbin magazine if the link has been posted, and if not, post it. could limit it to max 1 posted per hour to avoid spam vibes. thoughts?

BasicallyClean,
BasicallyClean avatar

There would need to be something involved with new/rising posts as in order to break the news in a timely manner.

Simply pulling the top 10 posts will eventually get the posts there but they won't be timely.

Maybe pull the top X# of rising posts?

klin,
klin avatar

makes sense, probably needs to be tinkered with but perhaps top X of rising posts that have > a set # of upvotes depending on subreddit size?

BasicallyClean,
BasicallyClean avatar

Or activity, but quantifying activity would be a lot more difficult than just looking at subreddit size. Seems like that would be a good proxy.

parrot-party,
parrot-party avatar

Anything super timely will typically rocket to the top within an hour. I'd say it's still pretty timely.

yungsinatra,

Yeah, I think as a starting point it should be more than enough to pull the posts from the front page. This can be refreshed every hour or so (depending how active the community is, and it's easy to specify the refresh time).

That way, we can get some of the more popular posts from the subreddit, while still leaving room for people here on the Fediverse to contribute. Otherwise, if we post TOO MUCH from reddit, it'll be just a mirror (which I don't think is a good idea..).

lixus98,
lixus98 avatar

Man I wished I knew this before :(

BasicallyClean, in Some updates for BotIt: I have it running indefinitely on DigitalOcean + other things.
BasicallyClean avatar

Multi username support would be huge for our purposes.

Also, if I delete a post that has been posted by the bot, it will just repost. Is there a way to fix this? Maybe looking at the mod log?

This has been some amazing work btw, thanks so much.

lixus98,
lixus98 avatar

It shouldn't do that, make sure you have the last changes, the bot saves to a database every post that is successfully posted.

Edit: I'll take a look at the multiple username support

CEbbinghaus, in BotIt GitHub project can now cross-post highly upvoted links from reddit to kbin while avoiding duplicate links
@CEbbinghaus@mas.to avatar

@klin @lixus98 Love to see it. It'll help ease the transition for some. Checked source and it seems to use the http url to fetch the json. I wonder if that will dissapear too

lixus98,
lixus98 avatar

In that case I'll switch to html scraping

klin, in Some updates for BotIt: I have it running indefinitely on DigitalOcean + other things.
klin avatar

good stuff!!!! i can’t wait to dive back into this when i have a bit more time :)

lixus98,
lixus98 avatar

Hey! There's no rush! Thank you

sabre3999, in BotIt GitHub project can now cross-post highly upvoted links from reddit to kbin while avoiding duplicate links
sabre3999 avatar

This is the way.

lixus98, in BotIt GitHub project can now cross-post highly upvoted links from reddit to kbin while avoiding duplicate links
lixus98 avatar

For some reason I didn't got a notification for this post

admin, in BotIt GitHub project can now cross-post highly upvoted links from reddit to kbin while avoiding duplicate links
admin avatar

Amazing.

lixus98, in kbin API URL?
lixus98 avatar

There is none, my recommendation is to use lemmy's to post here on kbin

JollyRoberts, in kbin API URL?
BedSharkPal,

That was my first guess, but the individual endpoints like say "https://kbin.social/api/magazines" just 503.

BedSharkPal, in kbin API URL?
Aeonx, in Don't overlook RSS!
Aeonx avatar

does kbin have rss feeds?

aikaterna,
aikaterna avatar

As of now, you can only get feeds that are sorted by new, for magazines and users.

https://kbin.social/rss?magazine=kbinMeta
https://kbin.social/rss?user=ernest

BedSharkPal, in Don't overlook RSS!

Please don't draw attention to this... 🤐

tangelo, in Welcome to BotIt. Got it?

Try crowdsourcing, lower technical barrier to entry, no false positives, and users can curate content they like:

  1. Define YOUR_MAGAZINE_HERE in the constant at the top
  2. Navigate to old site
  3. Click button next to post
  4. Let kbin populate the title and shortDesc automatically (if applicable)
  5. Submit

Homework for someone: find if kbin supports a url parameter for the title field (only found one for URL)

// ==UserScript==
// @name          kbin copy
// @description   crosspost to kbin
// @author        you
// @version       0.0.1
// @include       https://old.reddit.com*
// ==/UserScript==

const itemsSelector = 'a.title.may-blank';
const magazine = 'YOUR_MAGAZINE_HERE';

function insertElementAfter(target, element) {
  if (target.nextSibling) {
    target.parentNode.insertBefore(element, target.nextSibling);
  } else {
    target.parentNode.appendChild(element);
  }
}

function addItemLink(item) {
  var url = item.href;
  var title = item.text;
  const link = document.createElement('a');
  link.setAttribute('href', 'https://kbin.social/m/'+magazine+'/new?url='+url);
  link.innerText = 'COPY';
  link.className = 'title-copy-link';
  link.style.cssText += 'color:white !important;background-color:#333 !important;border-radius:5px';
  insertElementAfter(item, link);
}

function checkItems(selector) {
  const items = document.querySelectorAll(selector);
  items.forEach((item) => {
         addItemLink(item);
  });
}

checkItems(itemsSelector);
yungsinatra, in Welcome to BotIt. Got it?

FYI there's no POST API available in the documentation at the moment (https://docs.kbin.pub/#posts) so it might not be possible to create posts on Kbin using the API at the moment. An alternative could be using a web driver temporarily (although I'm not sure how feasible this is).

  • All
  • Subscribed
  • Moderated
  • Favorites
  • BotIt
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • anitta
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • provamag3
  • tester
  • Leos
  • megavids
  • JUstTest
  • All magazines