You are viewing a single comment's thread from:

RE: Links, Kinks, and the Big Three

in TheTerminal3 years ago

Thanks for this handy hint KittyGirl. I see that your screenshot example also shows generic icons for those bookmarks, like mine did. Do you happen to know, is there a way to add proper icons to those Javascript code snippet bookmarks? Haha, trust an "Aspie" to want to make things look conformed! 😃

Sort:  
The generic icons are probably what Windows shows for bookmarks that do not have a "favicon" image attached, as websites do. It could probably be changed in Windows Settings somewhere, but it would still look the same for all three bookmarks, rather than be individually customizable.

Hmm, okay, so it is just picking up the associated MIME type then. I'll have to tinker with it later, and see if I can create a .desktop script, attach an icon to that, and link to that in my browser's bookmarks instead. That should do the trick. By the way, what is this "Windows" of which you speak? I am a GNU/Linux user. 🤓

javascript:(function(){location.assign("http://" + ((location.hostname == "www.hive.blog") ? "ecency.com" : "www.peakd.com") + ((location.pathname.split("/")[1].indexOf("@") == -1) ? location.pathname : ("/" + location.pathname.split("/")[1])))})();

How would I add a fourth option to this, so that it changes all three urls to become a stemgeeks.net url instead? I tried to just move your : "www.peakd.com"to the other side of the colon and add another question mark, then follow the colon with "stemgeeks.net" instead, but that didn't work. This is what I have at present...
javascript:(function(){location.assign("http://" + ((location.hostname == "www.hive.blog") ? "ecency.com" ? "www.peakd.com" : "stemgeeks.net" ) + ((location.pathname.split("/")[1].indexOf("@") == -1) ? location.pathname : ("/" + location.pathname.split("/")[1])))})();

I guess the "or" here it isn't that simple to implement, but I'm no Javascript master. I really want to have a scriptlet like this which can convert all three common urls to the stemgeeks.net url.

This will do it — even though you don't see "ecency.com" listed there, it will still work:

javascript:(function(){location.assign("http://" + ((location.hostname == "www.hive.blog") ? "peakd.com" : "stemgeeks.net") + ((location.pathname.split("/")[1].indexOf("@") == -1) ? location.pathname : ("/" + location.pathname.split("/")[1])))})();

NOTE: This script will not work for all Tribes, as some Tribes filter posts from the Hive blockchain instead of showing all posts from Hive. For instance, LeoFinance will not show any post that does not have the #leofinance hashtag, so such a script would fail on that Tribe. Fortunately, STEMgeeks does not filter in that same way, so be glad that you chose a Tribe where this will work!

That is awesome! Thank you so much for your help with this.