beehaw lemmy add home-instance name to username

beehaw lemmy add home-instance name to username 2

As of 2023-06-15. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        beehaw lemmy add home-instance name to username 
// @namespace   english
// @description  beehaw lemmy  add home-instance name to username 2
// @include     http*://*beehaw.org*
// @version     1.6
// @run-at document-end
// @require       https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js
// @license MIT
// @grant       GM_addStyle
// ==/UserScript==



// Main - redirect test 

 // A $( document ).ready() block.
$( document ).ready(function() {


$( ".comments .text-info" ).each(function() {
 $( this ).addClass( "foo" );
// get username URL and text, then remove username from URL and paste the instance name after username (not if instance is home-instance of kbin.social

var homeinstance = $(this).attr('href') ;    

//var myname = $(this).text().trim();

console.log( "@@@");
console.log(homeinstance );
//console.log(myname );
var homeinstance2 =  homeinstance.replace(     /\/u.*?@/ , '');

if(    homeinstance.search("beehaw.org")   == -1    ){ //show nothing if home-instance kbin 

console.log(homeinstance2 );
$(this).find('span').append( " - " +  homeinstance2  );

}



});


}); //end each username a href