YT2Invidio

Point YouTube links to Invidious, Twitter to Nitter, Instagram to Bibliogram, Reddit to Teddit, Medium to Scribe

< Spätná väzba na YT2Invidio

Otázka/komentár

§
Pridaný: 11.03.2020

redirect instagram links to bibliogram

https://bibliogram.art

https://github.com/cloudrac3r/bibliogram

IzzySoftAutor
§
Pridaný: 11.03.2020

I use neither, so I cannot really test this. What do "real links" look like? I.e. "original InstaLink" => "resulting BiblioLink"? Can you give a few examples? And are there also multiple bibliogram instances, so the base URL should be configurable?

No promises as for when I find time to add this (I'm currently quite occupied at work), but I can add it to the todo list.

§
Pridaný: 13.03.2020

profile

https://www.instagram.com/joerogan/

https://bibliogram.art/u/joerogan

post

www.instagram.com/p/B9pqv10FsZH/

https://bibliogram.art/p/B9pqv10FsZH/

list of instances

https://github.com/cloudrac3r/bibliogram/wiki/Instances

Array.from(document.links).forEach(elem => {
        // profile
        if (elem.href.match(/(www\.)?instagram\.com\/p\/([^&#]+)/i)) {
          if (location.hostname != "bibliogram.art") {
            elem.href = "https://bibliogram.art/p/" + RegExp.$2;
          }

          // image or video
        } else if (elem.href.match(/(www\.)?instagram\.com\/([^&#]+)/i)) {
          if (location.hostname != "bibliogram.art") {
            elem.href = "https://bibliogram.art/u/" + RegExp.$2;
          }
        }
      });
IzzySoftAutor
§
Pridaný: 13.03.2020

Thanks!

IzzySoftAutor
§
Pridaný: 14.03.2020

I've created an issue for it and hopefully will be working on it soon.

IzzySoftAutor
§
Pridaný: 14.03.2020

Faster than I thought: v1.2.6 now also rewrites Instagram links to the chosen Bibliogram site (default "bibliogram.art") – with userscript menu items to show the list of available instances and switch to another, if preferred.

Can you please test and report back if it works for you? I don't use Insta/Biblio and had no page to test with.

§
Pridaný: 18.03.2020

it's working great, thank you

using instances with https:// or / at the end gives an error it would be nice if the script remove it automatically

IzzySoftAutor
§
Pridaný: 18.03.2020
Upravený: 18.03.2020

Glad to hear! What do you mean by "using instances with https … gives an error"? Trailing slash I understand (and removing that shouldn't be too hard – edit: done already, waiting for the other part before I release). Your examples above gave the link with https://, like https://bibliogram.art/p/ – so I don't understand what's wrong with that.

Btw: bibiogram.art currently gives a 502 (bad gateway), or is that just me?

§
Pridaný: 23.03.2020

when changing the instance to https//bibliogram.pussthecat.org/ the link become

https://https//bibliogram.pussthecat.org//u/joerogan

IzzySoftAutor
§
Pridaný: 23.03.2020

Yes. Omit the protocol, just enter the hostname – e.g. "bibliogram.pussthecat.org". As the example shows when that popup opens.

§
Pridaný: 23.03.2020

it would be nice if the script does that automatically

IzzySoftAutor
§
Pridaný: 23.03.2020

Yes, it would. But I prefer to keep it simple. I'm not a big Javascript nerd :wink:

I could see if I can come up with a nice&easy RegEx when I have time – but that might introduce more problems than it solves. What cases should be covered, and what combinations? stripping everything to the first slash would clean e.g. http://example.com and //example.com – but mess up example.com/, etc. Cannot use a regular URL parser either, as that might fail if only passed a hostname…

I'll ponder a bit on it and see what can be done. Will take a little, though; currently having 10..12h shifts and don't feel much like tampering with more code afterwards (so if you have an idea, it's welcome). Give me a little time, feel free to send a heads-up in 2+ weeks if I didn't send an update. Deal?

IzzySoftAutor
§
Pridaný: 23.03.2020

Ha! My RegEx-Fu didn't leave me. Watch out for the update, it's already checked-in to the repo o:)

Pridať odpoveď

Aby ste mohli pridať odpoveď, prihláste sa.