create account

Bookmarklet to Switch Between Ecency, Peakd, & Hive.blog by dbooster

View this thread on: hive.blogpeakd.comecency.com
· @dbooster · (edited)
$13.68
Bookmarklet to Switch Between Ecency, Peakd, & Hive.blog
![](https://files.peakd.com/file/peakd-hive/dbooster/AJj2VoUkjmDt3fPAk3euN6VU1Nd9mhzbvKWwQPZzVKEVcGFmFEQQ2wavRrYR1nw.png)

Some years ago, @thekittygirl gave me a couple of bookmarklets: one that would switch a post from the Ecency version to the Peakd version, and one that did the reverse. I long ago discarded the *to Ecency* version and just kept the other, since I almost always read everything on PeakD.  

I've always had it in mind to improve the bookmarklet, but I never took the time to do so until now. I refactored the code so it now switches any page among the three main Hive portals: Ecency, Peakd, and Hive.blog. It automatically detects which portal you're on and offers the other two as options.

So for example, if I'm on:  
<https://peakd.com/hive-133974/@dbooster/emperor-suko-and-the-northern-court-legacy>  
I can click the bookmarklet and choose to switch to:  
<https://ecency.com/@dbooster/emperor-suko-and-the-northern-court-legacy>  
or  
<https://hive.blog/hive-133974/@dbooster/emperor-suko-and-the-northern-court-legacy>

See it in action here:

https://www.youtube.com/watch?v=CKUQf6Iz3x8

This works on both Firefox and Brave. I haven't tested it on other browsers. It probably works on Chrome, though Google keeps locking that browser down more and more in their attempt to destroy adblocking — so who knows.[^1]

[^1]: Incidentally, it works in Safari too, but you probably aren't using that.

I'm using a bit of CSS styling to make the popup that asks which site you want. It seems like some of the CSS is being overridden by the sites themselves, so the popup looks a little different on each. But *it works*! and that's the important part.

<center>![][divider]</center>

Bookmarklets have been around since the beginning of the web, so they’re 30+ years old. But they’re probably not as common as they used to be, so I should explain.  

To create one:

1. Make a random bookmark of any page. Doesn't matter which — we just need the bookmark to exist.
2. Then open your bookmark manager and edit it.

You should see something like this:

![](https://files.peakd.com/file/peakd-hive/dbooster/23wXNL2yD7PVBa3XkkAzaNYrwzoeGPVNAJmAoSQcBBk3dmPFiDHYx6AvuZJWsRTtae2kP.png)

Replace the **Name** with whatever you want the bookmarklet to be called. I named mine "Hive Portal Switcher".

Replace the **URL** with this:

```
javascript:(function(){let h=location.hostname.replace('www.',''),p=["peakd.com","ecency.com","hive.blog"].filter(x=>x!==h);if(document.getElementById('portalSwitcher'))return;let d=document.createElement('div');d.id='portalSwitcher';Object.assign(d.style,{position:'fixed',top:'20%',left:'50%',transform:'translateX(-50%)',background:'#fff',border:'2px solid #444',padding:'20px',zIndex:'9999',boxShadow:'0 0 10px rgba(0,0,0,0.5)',fontFamily:'sans-serif'});let t=document.createElement('h3');t.innerText='Switch Hive Portal';t.style.marginTop='0';d.appendChild(t);p.forEach(function(q){let b=document.createElement('button');b.innerText='Go to '+q;b.style.margin='5px';b.style.padding='5px 10px';b.onclick=function(){let a=location.pathname.split('/'),i=a.findIndex(x=>x.startsWith('@')),n=i>-1?a.slice(i).join('/'):'';location.assign('https://'+q+'/'+n)};d.appendChild(b)});let c=document.createElement('button');c.innerText='Cancel';c.style.margin='5px';c.onclick=function(){document.body.removeChild(d)};d.appendChild(document.createElement('br'));d.appendChild(c);document.body.appendChild(d)})();
```

Yes, it looks like a mess—that's because it's minified.[^2] Copy the whole thing and paste it into the **URL** field of your bookmark. Your final setup should look something like this:

[^2]: That is to say, all spaces and linebreaks are removed. 

![](https://files.peakd.com/file/peakd-hive/dbooster/23uRJ2UTFWuqW89htE6L6hr5J9RQhFaRrVFymZY3pnSJv6QoEJgNFAHrwSiJnuNjW1fCC.png)

Now hit save. I recommend dragging the bookmarklet to your bookmarks toolbar so it's easy to access. Now, whenever you click it, it’ll offer you the option to switch to one of the other two portals.

<center>![][divider]</center>

I do hope to extend this further in the future to include [InLeo](https://inleo.io) and other Hive portals (like [CineTV](https://www.cinetv.blog/)) — but… later!

If you'd like to add that yourself or clean up the styling (which can get a little messy due to CSS overrides), here’s the **non-minified** version of the code:

```
javascript:(function(){
  let currentHost = location.hostname.replace('www.', '');
  let portals = ["peakd.com", "ecency.com", "hive.blog"].filter(p => p !== currentHost);
  if (document.getElementById('portalSwitcher')) return;

  let overlay = document.createElement('div');
  overlay.id = 'portalSwitcher';
  overlay.style.position = 'fixed';
  overlay.style.top = '20%';
  overlay.style.left = '50%';
  overlay.style.transform = 'translateX(-50%)';
  overlay.style.background = '#fff';
  overlay.style.border = '2px solid #444';
  overlay.style.padding = '20px';
  overlay.style.zIndex = '9999';
  overlay.style.boxShadow = '0 0 10px rgba(0,0,0,0.5)';
  overlay.style.fontFamily = 'sans-serif';

  let title = document.createElement('h3');
  title.innerText = 'Switch Hive Portal';
  title.style.marginTop = '0';
  overlay.appendChild(title);

  portals.forEach(function(p){
    let btn = document.createElement('button');
    btn.innerText = 'Go to ' + p;
    btn.style.margin = '5px';
    btn.style.padding = '5px 10px';
    btn.onclick = function(){
      let parts = location.pathname.split('/');
      let userIndex = parts.findIndex(part => part.startsWith('@'));
      let newPath = userIndex > -1 ? parts.slice(userIndex).join('/') : '';
      location.assign('https://' + p + '/' + newPath);
    };
    overlay.appendChild(btn);
  });

  let cancel = document.createElement('button');
  cancel.innerText = 'Cancel';
  cancel.style.margin = '5px';
  cancel.onclick = function(){
    document.body.removeChild(overlay);
  };
  overlay.appendChild(document.createElement('br'));
  overlay.appendChild(cancel);

  document.body.appendChild(overlay);
})();
```

If you do make any improvements, please share them—and tag me so I can check them out!

[divider]: http://laspina.org/images/misc/hive_divider.png

<center><h1>❦</h1></center>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 350 others
properties (23)
authordbooster
permlinkbookmarklet-to-switch-between-ecency-peakd-and-hiveblog
categoryhive-139531
json_metadata{"app":"peakd/2025.5.7","format":"markdown","image":["https://files.peakd.com/file/peakd-hive/dbooster/AJj2VoUkjmDt3fPAk3euN6VU1Nd9mhzbvKWwQPZzVKEVcGFmFEQQ2wavRrYR1nw.png","http://laspina.org/images/misc/hive_divider.png","https://files.peakd.com/file/peakd-hive/dbooster/23wXNL2yD7PVBa3XkkAzaNYrwzoeGPVNAJmAoSQcBBk3dmPFiDHYx6AvuZJWsRTtae2kP.png","https://files.peakd.com/file/peakd-hive/dbooster/23uRJ2UTFWuqW89htE6L6hr5J9RQhFaRrVFymZY3pnSJv6QoEJgNFAHrwSiJnuNjW1fCC.png"],"tags":["pimp","thealliance","bbh","neoxian","archon","proofofbrain","cent","indiaunited","coding","hive"],"users":["thekittygirl","dbooster"],"links":["https://www.youtube.com/watch?v=CKUQf6Iz3x8"]}
created2025-05-28 00:11:00
last_update2025-05-28 13:04:48
depth0
children6
last_payout2025-06-04 00:11:00
cashout_time1969-12-31 23:59:59
total_payout_value6.863 HBD
curator_payout_value6.817 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6,247
author_reputation1,027,033,996,650,743
root_title"Bookmarklet to Switch Between Ecency, Peakd, & Hive.blog"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,004,474
net_rshares42,857,761,590,886
author_curate_reward""
vote details (414)
@bhr-curation ·
Cool! 🐴💨 Switching between Hive portals just got easier. Thanks for sharing! 👍
properties (22)
authorbhr-curation
permlinkbookmarklet-to-switch-between-ecency-peakd-and-hiveblog-1748391307952
categoryhive-139531
json_metadata{}
created2025-05-28 00:15:06
last_update2025-05-28 00:15:06
depth1
children0
last_payout2025-06-04 00:15:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length78
author_reputation5,857,781,183,456
root_title"Bookmarklet to Switch Between Ecency, Peakd, & Hive.blog"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,004,518
net_rshares0
@bozz ·
Very cool!  I will have to come back to this if the favorites part of  PeakD stops working again at some point.  That was the main reason I was trying to switch back and forth before.  
properties (22)
authorbozz
permlinkre-dbooster-swyz28
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.5.7","image":[],"users":[]}
created2025-05-28 11:39:45
last_update2025-05-28 11:39:45
depth1
children0
last_payout2025-06-04 11:39:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length185
author_reputation2,268,256,463,027,130
root_title"Bookmarklet to Switch Between Ecency, Peakd, & Hive.blog"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,012,462
net_rshares0
@elias22 ·
This is Amazing
Pretty Cool Options
properties (22)
authorelias22
permlinkre-dbooster-swy7jb
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.5.7","image":[],"users":[]}
created2025-05-28 01:45:15
last_update2025-05-28 01:45:15
depth1
children0
last_payout2025-06-04 01:45:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length35
author_reputation9,653,904,598,702
root_title"Bookmarklet to Switch Between Ecency, Peakd, & Hive.blog"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,005,457
net_rshares0
@legionsupport ·
!PIMP those front ends
properties (22)
authorlegionsupport
permlinkre-dbooster-swy3fl
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.5.7","image":[],"users":[]}
created2025-05-28 00:16:33
last_update2025-05-28 00:16:33
depth1
children0
last_payout2025-06-04 00:16:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length22
author_reputation236,388,802,448
root_title"Bookmarklet to Switch Between Ecency, Peakd, & Hive.blog"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,004,530
net_rshares0
@thecrazygm ·
thank you! i remember something like this way back in the steem era.

I modified it to also include hivehub.dev and hiveblocks.com since i tend to need to see the raw tx details sometimes.
properties (22)
authorthecrazygm
permlinkre-dbooster-swz2ms
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.5.7","image":[],"users":[]}
created2025-05-28 12:56:54
last_update2025-05-28 12:56:54
depth1
children0
last_payout2025-06-04 12:56:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length188
author_reputation93,168,026,486,305
root_title"Bookmarklet to Switch Between Ecency, Peakd, & Hive.blog"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,013,426
net_rshares0
@thekittygirl ·
This is so fabulous! THANK YOU for improving the bookmarklet, and for combining the three into one! What an awesome improvement! Will be using this now! 😃
properties (22)
authorthekittygirl
permlinkre-dbooster-sx50tx
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.5.9","image":[],"users":[]}
created2025-05-31 18:03:36
last_update2025-05-31 18:03:36
depth1
children0
last_payout2025-06-07 18:03:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length154
author_reputation238,113,194,730,499
root_title"Bookmarklet to Switch Between Ecency, Peakd, & Hive.blog"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,084,617
net_rshares0