Pages:
Author

Topic: [LIST] Bitcointalk.org Userscripts/ Add-ons / SMF patches - page 3. (Read 4601 times)

legendary
Activity: 2758
Merit: 6830
I just noticed I made a very bad and obvious mistake on my "Merits received/sent in the last 120 days" script. I counted each entry as if it was of only 1 merit, making the number appear much lower than it should. I only noticed that when I checked the profile of a user that received 50 merits in a single transaction (along with other txs), and yet it was showing like he only received 49 merits in the last 120 days.

Sorry about that. Tongue

Here is the fixed version, which considers how much you sent/received in each tx:
Code:
// ==UserScript==
// @name         Total Merit Sent & Received on Merit page
// @version      0.2
// @author       TryNinja
// @match        https://bitcointalk.org/index.php?*action=merit;*
// @grant        none
// ==/UserScript==
(function() {
    'use strict';

    const sent = document.querySelectorAll("#bodyarea > ul:nth-child(5) > li");
    const received = document.querySelectorAll("#bodyarea > ul:nth-child(7) > li");

    var totalReceived = 0;
    var totalSent = 0;

    received.forEach(receivedTx => {
        const txValue = receivedTx.innerHTML.replace(/^(.*?\: )( for.*)|( from.*)/, "").replace(/(.*: )/, "");
        totalReceived += parseInt(txValue);
    })

    sent.forEach(sentTx => {
        const txValue = sentTx.innerHTML.replace(/^(.*?\: )( for.*)|( to.*)/, "").replace(/(.*: )/, "");
        totalSent += parseInt(txValue);
    })

    const sentH3 = document.querySelector("#bodyarea > h3:nth-child(4)");
    const receivedH3 = document.querySelector("#bodyarea > h3:nth-child(6)");

    var sentNode = document.createTextNode(" (total: " + totalSent + ")");
    var receivedNode = document.createTextNode(" (total: " + totalReceived + ")");
    sentH3.appendChild(sentNode);
    receivedH3.appendChild(receivedNode);
})();

My received in the last 120 days went from 156 to 264.
legendary
Activity: 2044
Merit: 1018
Not your keys, not your coins!
I will add the script to show dt. It was made by DarkStar_. This script is not a newly released one but I did not know it till yesterday and no one let me know about it too.

Done.

TopicsDatewritten bySectionMerit
____________________________________________________________________________________________________________________________
Automatically append ;dt to the end of URLs (View as DT) [v0.2.3]13/1/2019DarkStar_a "View as DefaultTrust" option24+
legendary
Activity: 2240
Merit: 3150
₿uy / $ell ..oeleo ;(
Is there a script showing which user is banned, I couldn't find anything yet about it? LoyceV has the list of banned users publicly available so I guess it won't be that difficult to write a script and check for the UID in the list or maybe find another, easier approach? We are waiting for such script for quite a while now. It was promised that it will be included in the BPIP add-on but...
 
legendary
Activity: 2044
Merit: 1018
Not your keys, not your coins!
I created a github repo for all my userscripts - https://github.com/Tiramisu77/bct-userscripts
Feel free to open and issue or make a pull request if you have to ideas.
The GitHub repo is a very nice initiative, and your two new scripts are great too. I will update OP with your new products later today. It is hard to update with table format on phones. Sorry for the temporary inconvenience and a bit delayed update.

Done.
legendary
Activity: 2240
Merit: 3150
₿uy / $ell ..oeleo ;(
I didn't see Sort posts by merit script in the list so there you go. Thanks to hatshepsut93  for the great work Smiley

Here you go, it adds a "sort by merit" button right before the "reply" button. Works well even on large threads, tried it with all posts from the anniversary art thread.

Code:
// ==UserScript==
// @name     Bitcointalk Sort By Merit
// @version  1.0
// @grant    none
// @include        https://bitcointalk.org/index.php?topic=*
// @run-at         document-end
// ==/UserScript==

const sortBtn = document.createElement("a")
sortBtn.href = "javascript:void(0)"
sortBtn.textContent = "sort by merit"

const threadButtons = document.querySelector("td.mirrortab_back")

threadButtons.prepend(document.createTextNode(" | "))
threadButtons.prepend(sortBtn)

sortBtn.addEventListener("click", sortByMerit)

function sortByMerit() {
    const table = document.querySelector("#bodyarea .bordercolor > tbody")
    const posts = [...table.rows]
        .map(post => {
            try {
                const merit = [...post.querySelectorAll(".td_headerandpost .smalltext i > a")]
                    .map(e => {
                        return parseInt(e.nextSibling.textContent.match(/\((.*)\)/)[1])
                    })
                    .reduce((acc, e) => acc + e, 0)

                return { merit, post }
            } catch (e) {
                console.error(e)
            }
        })
        .sort(({ merit: merit1 }, { merit: merit2 }) => merit2 - merit1)

    posts.forEach(({ post, merit }) => {
        try {
            table.append(post)
        } catch (e) {}
    })
}

legendary
Activity: 3024
Merit: 2148
I created a github repo for all my userscripts - https://github.com/Tiramisu77/bct-userscripts
Feel free to open and issue or make a pull request if you have to ideas.

Additionally, I've fixed a bug that made my scripts run unnecessarily on history change - if anyone knows how do to this by configuring the script rather than programmatically, I'd be glad to hear that.

I also published 2 new scripts - highlightThread that allows you to highlight threads that contain keywords that you are interested in, and collapseGiantQuotes that collapses quotes that take too much space (usually happens when posters make deeply nested quotes or quote large images).
legendary
Activity: 2044
Merit: 1018
Not your keys, not your coins!
On my merit page:
Quote
Sent in the last 120 days (total: 75)
[...]

Received in the last 120 days (total: 143)
[...]
That is what I ask for. OP updated and it is so nice to announce the userscript (for managers, and applicants of campaigns). Thank you so much for your fastly built userscript.
TopicsDatewritten bySectionMerit
__________________________________________________________________________________________________________________________
Display total sent/ received merits last 120 days on user merit stat page01/11/2019TryNinjaUsers' merit stats2+
legendary
Activity: 2758
Merit: 6830
If you can, please code and make an userscript that displays total figures for:
  • Sent in the last 120 days
  • Received in the last 120 days
Currently, on the merit stat page of each user, there are no total figures for those statistics and I think managers and applicants of campaigns will like that userscript.  Cheesy
Is that what you were thinking about?

EDIT: Fixed version here https://bitcointalksearch.org/topic/m.53143412

Code:
// ==UserScript==
// @name         Total Merit Sent & Received on Merit page
// @version      0.1
// @author       TryNinja
// @match        https://bitcointalk.org/index.php?*action=merit;*
// @grant        none
// ==/UserScript==


// OUTDATED VERSION, CHECK THE LINK ABOVE FOR THE LATEST CODE

(function() {
    'use strict';

    const sent = document.querySelectorAll("#bodyarea > ul:nth-child(5) > li").length;
    const received = document.querySelectorAll("#bodyarea > ul:nth-child(7) > li").length;

    const sentH3 = document.querySelector("#bodyarea > h3:nth-child(4)");
    const receivedH3 = document.querySelector("#bodyarea > h3:nth-child(6)");

    var sentNode = document.createTextNode(" (total: " + sent + ")");
    var receivedNode = document.createTextNode(" (total: " + received + ")");
    sentH3.appendChild(sentNode);
    receivedH3.appendChild(receivedNode);
})();

On my merit page:
Quote
Sent in the last 120 days (total: 75)
[...]

Received in the last 120 days (total: 143)
[...]
legendary
Activity: 2044
Merit: 1018
Not your keys, not your coins!
If you can, please code and make an userscript that displays total figures for:
  • Sent in the last 120 days
  • Received in the last 120 days
Currently, on the merit stat page of each user, there are no total figures for those statistics and I think managers and applicants of campaigns will like that userscript.  Cheesy
legendary
Activity: 2044
Merit: 1018
Not your keys, not your coins!
There is a request on userscript to get fully detailed information for quotes in blocked topics, includes author name, topic number, post number, date and time of each post, and hyperlinks of attached images. If someone has skills and spare time to do this, please help. I think this script is useful and will be widely used by users.
I made my request weeks ago, there: https://bitcointalksearch.org/topic/m.52342695
legendary
Activity: 3024
Merit: 2148
I added it to my extension, are you willing?
It will be updated in the next version.

https://bitcointalksearch.org/topic/m.52245025


Yeah sure. All scripts that I write are free and open source, use and include them how you wish.
copper member
Activity: 81
Merit: 85
I don't know if it was done before, couldn't find anything like that, so I made a tiny script that sums all mertis of a post and displays it before individual merits

Like this:


Code:
// ==UserScript==
// @name     Bitcointalk Post Merit Sum
// @version  1.0
// @grant    none
// @include        https://bitcointalk.org/index.php?topic=*
// @run-at         document-end
// ==/UserScript==

;[...document.querySelectorAll(".td_headerandpost")].forEach(post => {
    try {
        let sum = [...post.querySelectorAll(".smalltext i > a")]
            .map(e => {
                return parseInt(e.nextSibling.textContent.match(/\((.*)\)/)[1])
            })
            .reduce((acc, e) => acc + e, 0)
        if (sum > 0) {
            let sumElement = document.createElement("span")
            sumElement.textContent = `Total merit: ${sum} | `
            post.querySelector(".smalltext i").prepend(sumElement)
        }
    } catch (e) {
        console.error(e)
    }
})




I added it to my extension, are you willing?
It will be updated in the next version.

https://bitcointalksearch.org/topic/m.52245025
legendary
Activity: 2044
Merit: 1018
Not your keys, not your coins!
I don't know if it was done before, couldn't find anything like that, so I made a tiny script that sums all mertis of a post and displays it before individual merits

Like this:

[ ... ]
Thank you. Your userscript is useful, sure. I think other users will like it, of course if they are fan of userscripts, too. Like this thread, I do have to count total received merits of threads by myself, manually. With this script, people can naturally get it.
How about that one? @small improvement request. In merited posts, show your name in red or bold or..
You can read some ideas in that thread: Glow, Highlight, dropdown list.
It will be great if you can make an userscript for that demand. You made it!
theymos answered there:
Pretty sure it's first by merit awarded for that post (obviously), then by activity.
Right. And in case of equal activity, member ID is the tiebreaker.

Added newest userscript.
TopicDatewritten bySectionMerit
___________________________________________________________________________________________________________________________
Sum and display total received merits of posts/ threads25/8/2019hatshepsut93sums & displays all mertis of a post7+
Display username at 1st position in list of merit senders of posts/threads26/8/2019hatshepsut93sums & displays all mertis of a post1+
legendary
Activity: 3024
Merit: 2148
If such things isn't available on the list, then most likely it's not. It's good to see you built without external library.

On a side note, i think ";" at the beginning of code (after usercript) isn't needed.

I don't know JQuery and don't use it, because I've started learning JS around 1.5 years ago, and at that point standard library was so good that you don't need any libraries for basic DOM manipulation.

The ";" was inserted by my linter, it's still valid Javascript, so I didn't bother to remove it. It can help if someone will copypaste this code into a bigger userscript, for example.
legendary
Activity: 3024
Merit: 2148
I don't know if it was done before, couldn't find anything like that, so I made a tiny script that sums all mertis of a post and displays it before individual merits

Like this:


Code:
// ==UserScript==
// @name     Bitcointalk Post Merit Sum
// @version  1.0
// @grant    none
// @include        https://bitcointalk.org/index.php?topic=*
// @run-at         document-end
// ==/UserScript==

;[...document.querySelectorAll(".td_headerandpost")].forEach(post => {
    try {
        let sum = [...post.querySelectorAll(".smalltext i > a")]
            .map(e => {
                return parseInt(e.nextSibling.textContent.match(/\((.*)\)/)[1])
            })
            .reduce((acc, e) => acc + e, 0)
        if (sum > 0) {
            let sumElement = document.createElement("span")
            sumElement.textContent = `Total merit: ${sum} | `
            post.querySelector(".smalltext i").prepend(sumElement)
        }
    } catch (e) {
        console.error(e)
    }
})

legendary
Activity: 2044
Merit: 1018
Not your keys, not your coins!
Added newest extension.
TopicDatewritten bySectionMerit
______________________________________________________________________________________________________________________________
[BETA] Bitcointalk Extension - All In One23/8/2019mrvuitMultiple features7+
legendary
Activity: 2044
Merit: 1018
Not your keys, not your coins!
Visit and get helpful useescripts for your needs. Moreover, you can also suggest which scripts that are not available for now, coders in communities might help you making new scripts.
legendary
Activity: 2044
Merit: 1018
Not your keys, not your coins!
Added newest userscript.
TopicDatewritten bySectionMerit
__________________________________________________________________________________________________________________________
AutoReply v1.001/4/2019Aero Bluebump thread & delete old bumps2+
full member
Activity: 154
Merit: 128
Hi Aero Blue,
Thanks for posting here. Honestly, I am not a fan of userscripts/ add-ons, so I will not try yours. But if others try and confirm that quality and usefulness is good, I will add your userscript to OP's list.

Of course, I was quoting you, but my post was addressed more to anyone viewing the thread. Just wanted to thank you for making this wonderful thread to compile these scripts Smiley

I am looking forward to making more scripts, just waiting for more suggestions in the "suggestions" thread.
legendary
Activity: 2044
Merit: 1018
Not your keys, not your coins!
Hi Aero Blue,
Thanks for posting here. Honestly, I am not a fan of userscripts/ add-ons, so I will not try yours. But if others try and confirm that quality and usefulness is good, I will add your userscript to OP's list.
Pages:
Jump to: