Bitcoin Forum
May 02, 2024, 10:11:38 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [script] Show number (new replies to your posts)  (Read 83 times)
0x256 (OP)
Sr. Member
****
Offline Offline

Activity: 329
Merit: 334


View Profile
March 08, 2024, 08:09:33 PM
Merited by hugeblack (6), Halab (2), dkbit98 (1), hd49728 (1)
 #1


The initial code needs to be developed and modified
Code:
// ==UserScript==
// @name         show new replies len
// @namespace    https://bitcointalk.org/
// @version      0.1
// @description  Show number (new replies to your posts)
// @author       0x256
// @include      https://bitcointalk.org/*
// @grant        GM_addStyle

// ==/UserScript==

(function() {
'use strict';
GM_addStyle("#new_replies_len{color: white;background-color: red;padding: 1px 5px;border-radius: 5px;cursor: pointer;}");

window.addEventListener("load", (event) => {
  let hellomember = document.getElementById("hellomember");
  hellomember.insertAdjacentHTML('beforebegin', `<a style="text-decoration: none" href="https://bitcointalk.org/index.php?action=unreadreplies"><span id="new_replies_len"></span></a>`);

  var xhttp2 = new XMLHttpRequest();
  xhttp2.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      var doc2 = new DOMParser().parseFromString(this.responseText, 'text/html');
      var replies_len = doc2.querySelectorAll("table.bordercolor > tbody > tr > td > table.bordercolor > tbody > tr").length -1;

      var modal2 = document.getElementById("new_replies_len");
      modal2.innerHTML = replies_len;
    }
  };
  xhttp2.open("GET", "https://bitcointalk.org/index.php?action=unreadreplies", true);
  xhttp2.send();
});


})();

if you want custom bitcointalk css header click here
1714687898
Hero Member
*
Offline Offline

Posts: 1714687898

View Profile Personal Message (Offline)

Ignore
1714687898
Reply with quote  #2

1714687898
Report to moderator
1714687898
Hero Member
*
Offline Offline

Posts: 1714687898

View Profile Personal Message (Offline)

Ignore
1714687898
Reply with quote  #2

1714687898
Report to moderator
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714687898
Hero Member
*
Offline Offline

Posts: 1714687898

View Profile Personal Message (Offline)

Ignore
1714687898
Reply with quote  #2

1714687898
Report to moderator
1714687898
Hero Member
*
Offline Offline

Posts: 1714687898

View Profile Personal Message (Offline)

Ignore
1714687898
Reply with quote  #2

1714687898
Report to moderator
Elissa~sH
Member
**
Offline Offline

Activity: 83
Merit: 57


View Profile
March 09, 2024, 03:17:20 PM
 #2

I got a nice look when you posted your main code in 2020. But today, in the year 2024, the number has changed. It's great to see the numbers in the reply post.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!