this post was submitted on 16 Jun 2023
6 points (100.0% liked)

/kbin meta

110 readers
1 users here now

Magazine dedicated to discussions about the kbin itself. Provide feedback, ask questions, suggest improvements, and engage in conversations related to the platform organization, policies, features, and community dynamics. ---- * Roadmap 2023 * m/kbinDevlog * m/kbinDesign

founded 1 year ago
 

With the search being partially broken ATM, it's a bit annoying to open another community (https://lemmy.world/c/selfhosted) in kbin (https://kbin.social/m/[email protected])

There's an extension for firefox that transforms links found in comments, but it doesn't work if you've already got the community open in its original site.

I've just put together a quick and dirty js bookmarklet for this (mostly for myself, but I figured I'd post it in case anyone else finds it useful).
You basically save this code as a bookmark, and just click it when you're in a community on another site to be taken to that communiy on kbin:

javascript:(function()%7Blet%20reg%20%3D%20window.location.href.match(%2Fhttps%3F%3A%5C%2F%5C%2F(.*)%5C%2F%5Bcm%5D%5C%2F(%5Ba-zA-Z%5D%2B)%5C%2F%3F.*%2F)%3B%0Awindow.location.href%20%3D%20%60https%3A%2F%2Fkbin.social%2Fm%2F%24%7Breg%5B2%5D%7D%40%24%7Breg%5B1%5D%7D%60%3B%7D)()%3B

The original, unminified code is just

let reg = window.location.href.match(/https?:\/\/(.*)\/[cm]\/([a-zA-Z]+)\/?.*/);
window.location.href = `https://kbin.social/m/${reg[2]}@${reg[1]}`;

Unfortunately it doesn't work for threads (seems like they're a bit more complex than a quick find and replace), you need to be on the frontpage of the community

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 1 year ago (2 children)

Do you maybe know why this trick with links doesn't work for smaller communities? For example:
https://lemmy.world/c/valheim => exists
https://kbin.social/m/[email protected] => throws errors

I tried to subscribe to it by searching it in magazines but neither @valheim, [email protected] or [email protected] would give any results. It's a small community but it exists for at least 4 days, it should be searchable, right? I've had similar issues with other communities too, I have no idea how to subscribe to them from kbin.

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

Honestly I'm not sure. I think normally they should only appear if somebody from your instance is subscribed to them or if you search for it manually. Tbh kbin's search has been broken for me since I've joined, so that might have something to do with why nothing shows up?

Although I've checked it now and https://kbin.social/m/[email protected] works and you can subscribe (just doesn't show the post from the original ...yet?) so... maybe there's something more to it.

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

Hmm, might be a good workaround but dunno why is it now opening the page - I kept getting 404 errors on it before, I'm 100% certain. I subscribed now too so I'll see if it starts getting populated over time.