ChatGPT implemented thread hiding functionality on bogleheads.org

Discussions about the forum and contents
Post Reply
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

I've been enjoying playing with ChatGPT recently and wanted to test its ability to write and iterate on code. One feature I appreciate with some other forums is the ability to hide threads I'm not interested in. So I figured why not try to get ChatGPT to write some userscript that modifies the Bogleheads.org front page to support this new feature. And it worked! It was an iterative process and I helped it along in a few minor places, but the code and approach were 100% done by ChatGPT.

A couple notes:
- I currently have it set to only work on the front page (www.bogleheads.org) because that's what I use. I have not tested on the forum pages.
- Removed threads will remain hidden until your cookies are cleared, but again, this only applies to the front page

I didn't want to add any clutter to the front page, so I had ChatGPT only show the removal icon ("x") for a particular thread row when you hover over the correct area, which is the far right side of the row right before the white rectangular background ends. When the "x" appears the entire row will also turn grey so that it's easy to see what row the "x" corresponds to. Click the "x" and the thread will disappear!

You can make use of this userscript by installing the tampermonkey browser extension in your web browser (https://www.tampermonkey.net/)

Here's what it looks like (screen grab doesn't show mouse pointer which is near the "x"):
Image

I've added the script to Greasyfork: https://greasyfork.org/en/scripts/45975 ... front-page

And here's the code if anyone is interested in seeing it:

Code: Select all

// ==UserScript==
// @name         Hide Threads on Bogleheads
// @namespace    https://www.bogleheads.org/
// @version      0.1
// @description  Allows you hide a thread by clicking an "x" button that appears on rollover of the right side of each row
// @author       ChatGPT
// @match https://www.bogleheads.org/*
// @exclude https://www.bogleheads.org/forum/*
// @exclude https://www.bogleheads.org/wiki/*
// @exclude https://www.bogleheads.org/blog/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Select the table with the ID of posts_table
    const table = document.getElementById("posts_table");
    if (!table) {
        return;
    }

    // Select all rows in the main thread list
    const rows = table.querySelectorAll("tbody tr");

    // Load the list of hidden thread titles from local storage
    const hiddenThreadTitles = JSON.parse(localStorage.getItem("hiddenThreadTitles") || "{}");

    // Iterate over each row
    for (let i = 0; i < rows.length; i++) {
        const row = rows[i];

        // ignore header rows by skipping rows with less than 5 td elements
        if (row.getElementsByTagName("td").length < 5) {
            continue;
        }

        // Select the first link in the row
        const link = row.querySelector("td a");
        if (!link) {
            continue;
        }

        // Get the text of the link
        const title = link.innerHTML;

        // If the link text is in the list of hidden thread titles, hide the row
        if (hiddenThreadTitles[title]) {
            row.style.display = "none";
        }

        // Create a span element to hold the button
        const span = document.createElement("span");
        span.style.float = "right";
        span.style.marginTop = "-0.5em";
        span.style.opacity = "0";
        span.style.display = "inline-block";

        // Create a button element
        const button = document.createElement("button");
        button.innerHTML = "&times;";
        button.style.background = "none";
        button.style.border = "none";
        button.style.cursor = "pointer";
        button.style.fontSize = "smaller";
        button.style.height = "1em";
        button.style.lineHeight = "1em";
        button.style.width = "1em";
        button.style.position = "relative";
        button.style.top = "5px";

        // Add the button to the span
        span.appendChild(button);

        // Add the span to the row
        row.appendChild(span);

        // Attach a hover event listener to the span
        span.addEventListener("mouseover", function() {
            // When the span is hovered over, show the button
            span.style.opacity = "1";
        });
        span.addEventListener("mouseout", function() {
            // When the mouse moves out of the span, hide the button
            span.style.opacity = "0";
        });

        // Attach a click event listener to the button
        button.addEventListener("click", function() {
            // When the button is clicked, hide the row
            row.style.display = "none";

            // Add the title of the hidden thread to the list of hidden thread titles
            hiddenThreadTitles[title] = true;

            // Store the list of hidden thread titles in local storage
            localStorage.setItem("hiddenThreadTitles", JSON.stringify(hiddenThreadTitles));
        });

        button.addEventListener("mouseenter", function() {
            row.style.backgroundColor = "#f2f2f2";
        });

        button.addEventListener("mouseleave", function() {
            row.style.backgroundColor = "";
        });

    }
})();
Last edited by cacophony on Fri Feb 10, 2023 2:49 am, edited 2 times in total.
User avatar
LadyGeek
Site Admin
Posts: 95686
Joined: Sat Dec 20, 2008 4:34 pm
Location: Philadelphia
Contact:

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by LadyGeek »

Who provided the comments?

You should also exclude https://www.bogleheads.org/wiki/* and https://www.bogleheads.org/blog/*.
Wiki To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.
RubyTuesday
Posts: 2241
Joined: Fri Oct 19, 2012 11:24 am

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by RubyTuesday »

Fascinating!

Would you be able to post the iterative “transcript” of your working with ChatGPT?
“Doing nothing is better than being busy doing nothing.” – Lao Tzu
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

LadyGeek wrote: Tue Feb 07, 2023 7:35 pm Who provided the comments?

You should also exclude https://www.bogleheads.org/wiki/* and https://www.bogleheads.org/blog/*.
ChatGPT did all the comments with one exception:
// ignore header rows by skipping rows with less than 5 td elements
That was one minor area where I manually made a change because it would be faster than trying to get ChatGPT to do it.

I'll add the extra exclusions, thanks.
User avatar
LadyGeek
Site Admin
Posts: 95686
Joined: Sat Dec 20, 2008 4:34 pm
Location: Philadelphia
Contact:

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by LadyGeek »

Basically, this is an HTML screen scraper. If you want a challenge, try writing a script for TSP share prices for Quicken or TSP share price in Google Sheets like GoogleFinance. I'm sure someone can find similar requests in this forum.

If you find something usable, please post in the relevant thread and be clear on your source as ChatGPT. The code should be commented per basic coding practice.
Wiki To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

RubyTuesday wrote: Tue Feb 07, 2023 7:40 pm Fascinating!

Would you be able to post the iterative “transcript” of your working with ChatGPT?
I'll try to find a good way to capture it but they don't make it easy. I tried Chrome's full page screenshot and it only captured what was visible. As you can imagine the conversation is quite lengthy because the ChatGPT likes to post new code at every step.

Here are the main prompts I used, in order. I also interspersed some editorial notes in square brackets:

Prompt 1: can you help me write userscript to change something for bogleheads.org?

Prompt 2: Can you help me add a button to every row in the main thread list such that when you click the button that row disappears?

[it didn't know the table name of the main thread list, so the first solution was not functional]

Prompt 3: can you make it apply to the table that has the id of posts_table?

[this code worked!]

Prompt 4: can you make the hidden rows stay hidden the next time I go to the site?

[persistence didn't work, so asking for help to understand how it's identifying deleted rows in storage]

Prompt 5: What ids are being used to distinguish the rows? can you give some examples from the actual site?

[turns out it's using the id attribute, which isn't used on the table rows on bogleheads.org. ChatGPT is not referencing the source of the bogleheads.org site, so I'll need to guide it here]

Prompt 6: the actual html on bogleheads.org has no id attribute associated with each row

[it then switched to storing the row position, which also won't work because the ordering of threads is constantly changing]

Prompt 7: Using the row index won't work because the thread positions change over time. Can you instead use the visible text that is associated with the first link in the row?

[this worked! the deleted rows now stay deleted]

Prompt 8: Can you make the hide button much smaller? Maybe just a tiny x icon?

[this worked]

Prompt 9: Can you have the x only appear when I hover over that area?

[this worked but wasn't exactly what I wanted]

Prompt 10: Can you have it so you need to hover over the actual area where the x appears and not the entire row?

[now it does what I want]

Prompt 11: Can you change it so a hover over x also highlights the row it applies to?

[this worked!]
Last edited by cacophony on Sun Mar 05, 2023 3:03 pm, edited 2 times in total.
User avatar
telemark
Posts: 3389
Joined: Sat Aug 11, 2012 6:35 am

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by telemark »

That's ... a lot cleaner than much of the code I had to look at when I was still working and doing code reviews. Very interesting indeed.
pizzy
Posts: 4339
Joined: Tue Jun 02, 2020 6:59 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by pizzy »

This works wonderfully, thank you!

Maybe the mods can implement this feature?
Vanguard/Fidelity | 76% US Stock | 16% Int'l Stock | 8% Cash
RubyTuesday
Posts: 2241
Joined: Fri Oct 19, 2012 11:24 am

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by RubyTuesday »

cacophony wrote: Tue Feb 07, 2023 7:59 pm
RubyTuesday wrote: Tue Feb 07, 2023 7:40 pm Fascinating!

Would you be able to post the iterative “transcript” of your working with ChatGPT?
I'll try to find a good way to capture it but they don't make it easy. I tried Chrome's full page screenshot and it only captured what was visible. As you can imagine the conversation is quite lengthy because the ChatGPT likes to post new code at every step.

Here are the main prompts I used in order (with some editorial notes I just added in square brackets):
Thank you!
“Doing nothing is better than being busy doing nothing.” – Lao Tzu
dukeblue219
Posts: 4074
Joined: Fri Jan 29, 2016 11:40 am

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by dukeblue219 »

The day I asked ChatGPT to draft some of the mundane Python scripting, CSV data reorganization, and document outlining (if not the actual content) that I do at work was both mind-blowing and terrifying.
User avatar
nisiprius
Advisory Board
Posts: 52211
Joined: Thu Jul 26, 2007 9:33 am
Location: The terrestrial, globular, planetary hunk of matter, flattened at the poles, is my abode.--O. Henry

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by nisiprius »

That's disturbing. What is ChatGPT actually doing behind the scenes, synthesizing and doing next-word-prediction stuff on published bits of code?

Perhaps this is like a mentalist's muscle-reading trick, or a Ouija board, where the answer is really coming from the person asking the questions, who is unconsciously doing the work. But it's still impressive as heck.
Annual income twenty pounds, annual expenditure nineteen nineteen and six, result happiness; Annual income twenty pounds, annual expenditure twenty pounds ought and six, result misery.
User avatar
LadyGeek
Site Admin
Posts: 95686
Joined: Sat Dec 20, 2008 4:34 pm
Location: Philadelphia
Contact:

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by LadyGeek »

pizzy wrote: Wed Feb 08, 2023 7:55 am This works wonderfully, thank you!

Maybe the mods can implement this feature?
Sorry, but the intent is to keep the home page simple. Remember that it has to work on a multitude of desktop and mobile devices.

Additionally, how many threads to you actually look at? We show all threads in the past day by default and can also display threads up to 3 days.

I'm betting that readers don't scroll past one or two screens (about 50 posts), so continuing to click on threads that show when you refresh the page is actually a lot of work for the reader to maintain.

You can also view the latest forum posts in the Quick links menu as Active topics.
Wiki To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.
exigent
Posts: 1309
Joined: Fri May 07, 2010 8:49 am

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by exigent »

nisiprius wrote: Wed Feb 08, 2023 8:14 am That's disturbing. What is ChatGPT actually doing behind the scenes, synthesizing and doing next-word-prediction stuff on published bits of code?
It seems to have ingested pretty much everything as training data, or at least the entire internet... Really impressive, but somewhat disconcerting at the same time.
exigent
Posts: 1309
Joined: Fri May 07, 2010 8:49 am

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by exigent »

cacophony wrote: Tue Feb 07, 2023 6:58 pm I've been enjoying playing with ChatGPT recently and wanted to test its ability to write and iterate on code. One feature I appreciate with some other forums is the ability to hide threads I'm not interested in. So I figured why not try to get ChatGPT to write some userscript that modifies the Bogleheads.org front page to support this new feature. And it worked! It was an iterative process and I helped it along in a few minor places, but the code and approach were 100% done by ChatGPT.
This is very impressive. Are the changes persistent across browser sessions?
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

LadyGeek wrote: Wed Feb 08, 2023 8:20 am
pizzy wrote: Wed Feb 08, 2023 7:55 am This works wonderfully, thank you!

Maybe the mods can implement this feature?
Sorry, but the intent is to keep the home page simple. Remember that it has to work on a multitude of desktop and mobile devices.

Additionally, how many threads to you actually look at? We show all threads in the past day by default and can also display threads up to 3 days.

I'm betting that readers don't scroll past one or two screens (about 50 posts), so continuing to click on threads that show when you refresh the page is actually a lot of work for the reader to maintain.

You can also view the latest forum posts in the Quick links menu as Active topics.
That's not really the use case. I visit the front page quite regularly and only look at the 20 or so most recent posts. Sometimes there are threads that are very popular that are a constant fixture in those top results that I know I'll never want to read, so it's nice to not have to look at them every time I visit. Why would using this feature be "work for the reader to maintain"? It's quite the opposite really. It simplifies the experience in a way the user prefers.
Last edited by cacophony on Wed Feb 08, 2023 11:51 am, edited 2 times in total.
pizzy
Posts: 4339
Joined: Tue Jun 02, 2020 6:59 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by pizzy »

cacophony wrote: Wed Feb 08, 2023 11:47 am
LadyGeek wrote: Wed Feb 08, 2023 8:20 am
pizzy wrote: Wed Feb 08, 2023 7:55 am This works wonderfully, thank you!

Maybe the mods can implement this feature?
Sorry, but the intent is to keep the home page simple. Remember that it has to work on a multitude of desktop and mobile devices.

Additionally, how many threads to you actually look at? We show all threads in the past day by default and can also display threads up to 3 days.

I'm betting that readers don't scroll past one or two screens (about 50 posts), so continuing to click on threads that show when you refresh the page is actually a lot of work for the reader to maintain.

You can also view the latest forum posts in the Quick links menu as Active topics.
That's not really the use case for me. I visit the front page quite regularly and only look at the 20 or so most recent posts. Sometimes there are threads that are very popular that are a constant fixture in those top results that I know I'll never want to read, so it's nice to not have to look at them every time I visit.
This is the same use case for me. Having "what are you cooking/listening to?" gone is a nice perk
Vanguard/Fidelity | 76% US Stock | 16% Int'l Stock | 8% Cash
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

exigent wrote: Wed Feb 08, 2023 8:27 am
cacophony wrote: Tue Feb 07, 2023 6:58 pm I've been enjoying playing with ChatGPT recently and wanted to test its ability to write and iterate on code. One feature I appreciate with some other forums is the ability to hide threads I'm not interested in. So I figured why not try to get ChatGPT to write some userscript that modifies the Bogleheads.org front page to support this new feature. And it worked! It was an iterative process and I helped it along in a few minor places, but the code and approach were 100% done by ChatGPT.
This is very impressive. Are the changes persistent across browser sessions?
Yes, as long as you don't remove your cookies for bogleheads.org.
User avatar
snackdog
Posts: 3102
Joined: Wed Nov 12, 2014 3:57 am
Location: PNW

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by snackdog »

Works great. But I'm not sure what to hide other than a few posts with thousands of responses which don't interest me. Can the Chatbot program it to show me threads based on others I have commented on??
BH Consumer FAQ: | Car? Used Toyota, Lexus or Miata. | House? 20% down and 3x salary. | Vacation house? No. | Umbrella? $1 million. | Goods? Costco.
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

pizzy wrote: Wed Feb 08, 2023 11:48 am
cacophony wrote: Wed Feb 08, 2023 11:47 am
LadyGeek wrote: Wed Feb 08, 2023 8:20 am
pizzy wrote: Wed Feb 08, 2023 7:55 am This works wonderfully, thank you!

Maybe the mods can implement this feature?
Sorry, but the intent is to keep the home page simple. Remember that it has to work on a multitude of desktop and mobile devices.

Additionally, how many threads to you actually look at? We show all threads in the past day by default and can also display threads up to 3 days.

I'm betting that readers don't scroll past one or two screens (about 50 posts), so continuing to click on threads that show when you refresh the page is actually a lot of work for the reader to maintain.

You can also view the latest forum posts in the Quick links menu as Active topics.
That's not really the use case for me. I visit the front page quite regularly and only look at the 20 or so most recent posts. Sometimes there are threads that are very popular that are a constant fixture in those top results that I know I'll never want to read, so it's nice to not have to look at them every time I visit.
This is the same use case for me. Having "what are you cooking/listening to?" gone is a nice perk
Glad to hear that you like it!
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

snackdog wrote: Wed Feb 08, 2023 11:59 am Works great. But I'm not sure what to hide other than a few posts with thousands of responses which don't interest me.
Thanks for trying! For me it's a feature that's nice to have when I want it, even if it only comes up a few times a year.
snackdog wrote: Wed Feb 08, 2023 11:59 am Can the Chatbot program it to show me threads based on others I have commented on??
That would be a lot more difficult because it would depend on many details that are specific to how this site works. I think the reason why the thread deletion idea worked so well was because the way lists of items are created is very common across most sites (eg. using html tables). ChatGPT is not actually looking at the bogleheads.org source code, so I needed to tell it the table name of interest to get the functionality to initially work. And then for persisting for future visits I needed to tell it that the each row lacked an "id" and then suggest that it use the title to uniquely identify each row.
Chuck
Posts: 2505
Joined: Thu May 21, 2009 12:19 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by Chuck »

snackdog wrote: Wed Feb 08, 2023 11:59 am Can the Chatbot program it to show me threads based on others I have commented on??
It should just summarize the threads so you don't have to read them.
marathonfi
Posts: 146
Joined: Thu Dec 05, 2019 7:34 am

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by marathonfi »

Amazing. Thank you for sharing. I didn't realize these extensions are even possible! I will be tinkering around for sure. How do you clear the list of hidden threads?
cacophony wrote: Tue Feb 07, 2023 6:58 pm I've been enjoying playing with ChatGPT recently and wanted to test its ability to write and iterate on code. One feature I appreciate with some other forums is the ability to hide threads I'm not interested in. So I figured why not try to get ChatGPT to write some userscript that modifies the Bogleheads.org front page to support this new feature. And it worked! It was an iterative process and I helped it along in a few minor places, but the code and approach were 100% done by ChatGPT.

A couple notes:
- I currently have it set to only work on the front page (www.bogleheads.org) because that's what I use. I have not tested on the forum pages.
- Removed threads will remain hidden until your cookies are cleared, but again, this only applies to the front page

I didn't want to add any clutter to the front page, so I had ChatGPT only show the removal icon ("x") for a particular thread row when you hover over the correct area, which is the far right side of the row right before the white rectangular background ends. When the "x" appears the entire row will also turn grey so that it's easy to see what row the "x" corresponds to. Click the "x" and the thread will disappear!

You can make use of this userscript by installing the tampermonkey browser extension in your web browser (https://www.tampermonkey.net/)

Here's what it looks like (screen grab doesn't show mouse pointer which is near the "x"):
Image

And here's the script if anyone is interested in trying it:

Code: Select all

// ==UserScript==
// @name         Hide Threads on Bogleheads
// @namespace    https://www.bogleheads.org/
// @version      0.1
// @description  Allows you hide a thread by clicking an "x" button that appears on rollover of the right side of each row
// @author       ChatGPT
// @match https://www.bogleheads.org/*
// @exclude https://www.bogleheads.org/forum/*
// @exclude https://www.bogleheads.org/wiki/*
// @exclude https://www.bogleheads.org/blog/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Select the table with the ID of posts_table
    const table = document.getElementById("posts_table");
    if (!table) {
        return;
    }

    // Select all rows in the main thread list
    const rows = table.querySelectorAll("tbody tr");

    // Load the list of hidden thread titles from local storage
    const hiddenThreadTitles = JSON.parse(localStorage.getItem("hiddenThreadTitles") || "{}");

    // Iterate over each row
    for (let i = 0; i < rows.length; i++) {
        const row = rows[i];

        // ignore header rows by skipping rows with less than 5 td elements
        if (row.getElementsByTagName("td").length < 5) {
            continue;
        }

        // Select the first link in the row
        const link = row.querySelector("td a");
        if (!link) {
            continue;
        }

        // Get the text of the link
        const title = link.innerHTML;

        // If the link text is in the list of hidden thread titles, hide the row
        if (hiddenThreadTitles[title]) {
            row.style.display = "none";
        }

        // Create a span element to hold the button
        const span = document.createElement("span");
        span.style.float = "right";
        span.style.marginTop = "-0.5em";
        span.style.opacity = "0";
        span.style.display = "inline-block";

        // Create a button element
        const button = document.createElement("button");
        button.innerHTML = "&times;";
        button.style.background = "none";
        button.style.border = "none";
        button.style.cursor = "pointer";
        button.style.fontSize = "smaller";
        button.style.height = "1em";
        button.style.lineHeight = "1em";
        button.style.width = "1em";
        button.style.position = "relative";
        button.style.top = "5px";

        // Add the button to the span
        span.appendChild(button);

        // Add the span to the row
        row.appendChild(span);

        // Attach a hover event listener to the span
        span.addEventListener("mouseover", function() {
            // When the span is hovered over, show the button
            span.style.opacity = "1";
        });
        span.addEventListener("mouseout", function() {
            // When the mouse moves out of the span, hide the button
            span.style.opacity = "0";
        });

        // Attach a click event listener to the button
        button.addEventListener("click", function() {
            // When the button is clicked, hide the row
            row.style.display = "none";

            // Add the title of the hidden thread to the list of hidden thread titles
            hiddenThreadTitles[title] = true;

            // Store the list of hidden thread titles in local storage
            localStorage.setItem("hiddenThreadTitles", JSON.stringify(hiddenThreadTitles));
        });

        button.addEventListener("mouseenter", function() {
            row.style.backgroundColor = "#f2f2f2";
        });

        button.addEventListener("mouseleave", function() {
            row.style.backgroundColor = "";
        });

    }
})();
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

marathonfi wrote: Wed Feb 08, 2023 10:04 pm Amazing. Thank you for sharing. I didn't realize these extensions are even possible! I will be tinkering around for sure. How do you clear the list of hidden threads?
If you delete cookies for bogleheads.org it will clear the list of hidden threads. Shouldn't be a big deal other than forcing you to login again.
I thought about enhancing the functionality to allow viewing or clearing of the list but I'm not sure how much benefit that would actually be.
User avatar
JoMoney
Posts: 16260
Joined: Tue Jul 23, 2013 5:31 am

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by JoMoney »

petulant wrote: Thu Feb 09, 2023 6:35 am It stands to reason that an AI developed by programmers would be really good at coding but exhibit basic errors on other topics.
It seems to me there's plenty of room for basic errors in programming as well. From what I've seen, it looks like the AI is more "translating" than actually programming. The human was providing the algorithm, the ChatGPT was just translating from common english language into a particular scripting/coding language. I can imagine there's plenty of room for even more errors if the human providing the algorithm it wants translated wasn't already familiar with the specific abilities and limitations of the control structures and syntax of the language their algorithm needs to be converted into.

FWIW, still very useful though. I'm not the best at programming, mostly just simple scripting for very basic things, after I have figured what functions I want the script to perform most of my time is spent searching the web for some snip of code example I can modify for what I need. If AI can do the web searching in a more human language friendly way, that's great ;)
"To achieve satisfactory investment results is easier than most people realize; to achieve superior results is harder than it looks." - Benjamin Graham
User avatar
LadyGeek
Site Admin
Posts: 95686
Joined: Sat Dec 20, 2008 4:34 pm
Location: Philadelphia
Contact:

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by LadyGeek »

I moved an off-topic discussion regarding portfolio composition to Bogleheads and GPT. Use that thread for a ChatGPT general discussion.
Wiki To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.
WhyNotUs
Posts: 2610
Joined: Sun Apr 14, 2013 11:38 am

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by WhyNotUs »

Takes me back to a thread a while back in which I pointed out that AI would be writing code and had a couple coders insist that was not going to happen. :D

I will offer a counter that there have been times when I was sick and read threads that I would have normally blocked but discovered useful info.

Good job playing with ChatGPT, I played a while back but got bored pretty quickly. Your exercise was more useful.
I own the next hot stock- VTSAX
marathonfi
Posts: 146
Joined: Thu Dec 05, 2019 7:34 am

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by marathonfi »

Clearing cookies worked well. Thank you.
cacophony wrote: Wed Feb 08, 2023 10:16 pm
marathonfi wrote: Wed Feb 08, 2023 10:04 pm Amazing. Thank you for sharing. I didn't realize these extensions are even possible! I will be tinkering around for sure. How do you clear the list of hidden threads?
If you delete cookies for bogleheads.org it will clear the list of hidden threads. Shouldn't be a big deal other than forcing you to login again.
I thought about enhancing the functionality to allow viewing or clearing of the list but I'm not sure how much benefit that would actually be.
Wannaretireearly
Posts: 4880
Joined: Wed Mar 31, 2010 4:39 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by Wannaretireearly »

Try asking for a stock quote and you’ll fail. It only has 2021 data.
It is really impressive. However, I was told the backtracing/learning it will have to do takes tons of time and money. Someone smarter than I may explain this better.

I was generating sql code with it for fun yday. Very cool stuff!
“At some point you are trading time you will never get back for money you will never spend.“ | “How do you want to spend the best remaining year of your life?“
doneat53
Posts: 123
Joined: Tue Jul 04, 2017 1:23 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by doneat53 »

This is pretty cool. Thanks for making me aware of "Tampermonkey" and for the script. I've been playing with ChatGPT as well but haven't done anything too productive yet. I do have an R script that scrapes data from fidelity's bond cd page and graphs it. I'm imagining I could build something there. Thanks for taking the time to post and share this.
tioscrooge
Posts: 86
Joined: Wed May 25, 2016 10:01 pm
Location: Pacific NW

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by tioscrooge »

cacophony wrote: Wed Feb 08, 2023 10:16 pm
marathonfi wrote: Wed Feb 08, 2023 10:04 pm Amazing. Thank you for sharing. I didn't realize these extensions are even possible! I will be tinkering around for sure. How do you clear the list of hidden threads?
If you delete cookies for bogleheads.org it will clear the list of hidden threads. Shouldn't be a big deal other than forcing you to login again.
I thought about enhancing the functionality to allow viewing or clearing of the list but I'm not sure how much benefit that would actually be.
Thank you for posting the code and the link to extension. I'd like to use this functionality.
would you be able to post a step by step guide for those of us that are computer illiterate?

Thank you,
Whether you think you can or you can not, you will be correct.
bandoba
Posts: 224
Joined: Thu Apr 08, 2010 12:51 am

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by bandoba »

doneat53 wrote: Thu Feb 09, 2023 2:30 pm This is pretty cool. Thanks for making me aware of "Tampermonkey" and for the script. I've been playing with ChatGPT as well but haven't done anything too productive yet. I do have an R script that scrapes data from fidelity's bond cd page and graphs it. I'm imagining I could build something there. Thanks for taking the time to post and share this.
I echo what doneat53 has said well. BTW if any of you interested in trying out something and looking for help on software side/testing let me know. I would be happy to assist and excited with the potential that something cool can be done with it.
Mudpuppy
Posts: 7409
Joined: Sat Aug 27, 2011 2:26 am
Location: Sunny California

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by Mudpuppy »

WhyNotUs wrote: Thu Feb 09, 2023 9:56 am Takes me back to a thread a while back in which I pointed out that AI would be writing code and had a couple coders insist that was not going to happen. :D
Being able to write code and being able to write good code that is elegant, resistant to vulnerabilities and cybersecurity attacks, and maintainable are two entirely different things. It's too bad the rapid cycle of development favors the former rather than the later, but as long as fast/cheap overrides good/secure, I'll have a stable job in cybersecurity cleaning up the messes.

One thing that annoys me about ChatGPT generated code is the lack of attribution. It's essentially building on the labors of others without giving credit where credit is due. And if it includes GPL code in its training data, it might even be in violation of that licensing (and similar open-source licensing products), which requires credit to reuse and adapt their open-source codebases.
User avatar
Oicuryy
Posts: 1959
Joined: Thu Feb 22, 2007 9:29 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by Oicuryy »

cacophony,

Please consider posting your script on https://greasyfork.org or similar. That might make it easier for non-techies to install.

Ron
Money is fungible | Abbreviations and Acronyms
User avatar
LadyGeek
Site Admin
Posts: 95686
Joined: Sat Dec 20, 2008 4:34 pm
Location: Philadelphia
Contact:

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by LadyGeek »

doneat53 wrote: Thu Feb 09, 2023 2:30 pm This is pretty cool. Thanks for making me aware of "Tampermonkey" and for the script. I've been playing with ChatGPT as well but haven't done anything too productive yet. I do have an R script that scrapes data from fidelity's bond cd page and graphs it. I'm imagining I could build something there. Thanks for taking the time to post and share this.
Consider posting that in the general ChatGPT thread: Bogleheads and GPT

We have a number of R scripts in the wiki. See: Using open source software for portfolio analysis

If you develop something, start a new thread and we can consider putting it in the wiki.

As noted previously, please state that you're using ChatGPT to develop the script and describe where it was helpful (or not). Also, please comment the code using accepted practice.
Wiki To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

tioscrooge wrote: Thu Feb 09, 2023 2:56 pm
cacophony wrote: Wed Feb 08, 2023 10:16 pm
marathonfi wrote: Wed Feb 08, 2023 10:04 pm Amazing. Thank you for sharing. I didn't realize these extensions are even possible! I will be tinkering around for sure. How do you clear the list of hidden threads?
If you delete cookies for bogleheads.org it will clear the list of hidden threads. Shouldn't be a big deal other than forcing you to login again.
I thought about enhancing the functionality to allow viewing or clearing of the list but I'm not sure how much benefit that would actually be.
Thank you for posting the code and the link to extension. I'd like to use this functionality.
would you be able to post a step by step guide for those of us that are computer illiterate?

Thank you,
The first step is to install the tampermonkey plugin into your web browser. This video covers that pretty well: https://www.youtube.com/watch?v=8tyjJD65zws
Pause the video when you get to the 2 minutes and 8 seconds. At that point notice that one of the menu options is "Create a new script...".
If you click that option you'll be taken to another screen that has some code in a window.
Select everything in the window and delete it.
In another browser tab go to my first post in this thread and find the code section. At the top of the code there should be a "Select All" button. Click that to highlight all the code. Then copy the code into your copy/paste buffer (CTRL-C in Windows or Command-C on a Mac).
Go back to the tampermonkey code window, which should be empty because you deleted the code. Paste the code you copied from my post into the code area of that window.
Save the code you copied by doing CTRL-S or using the tampermonkey file menu directly above the code.

Now reload the bogleheads.org front page and hopefully it will work! Note that you need to move your mouse to the location near where the "x" appears for each row. You can see where that is in the screen shot in my first post.
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

Oicuryy wrote: Thu Feb 09, 2023 5:44 pm cacophony,

Please consider posting your script on https://greasyfork.org or similar. That might make it easier for non-techies to install.

Ron
Good idea! I've tried to register with the site but still waiting for the confirmation email to arrive.
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

Oicuryy wrote: Thu Feb 09, 2023 5:44 pm cacophony,

Please consider posting your script on https://greasyfork.org or similar. That might make it easier for non-techies to install.

Ron
I added it here: https://greasyfork.org/en/scripts/45975 ... front-page
Thanks for the idea!
tioscrooge
Posts: 86
Joined: Wed May 25, 2016 10:01 pm
Location: Pacific NW

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by tioscrooge »

Thank you! This works.
Whether you think you can or you can not, you will be correct.
Hola
Posts: 141
Joined: Thu Nov 04, 2021 2:40 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by Hola »

This is all cool. However a word of caution to folks: consider that adding extra plugins/scripts to your browser opens you up for security and privacy issues.
marathonfi
Posts: 146
Joined: Thu Dec 05, 2019 7:34 am

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by marathonfi »

I wanted to play around so I created my own, though it's not very useful :D
Image
https://ibb.co/zJ09SPT

Someone asked about GPT prompts to generate these. This is what I typed:
write userscript for https://www.bogleheads.org/ and change the users' names to red font
write userscript for https://www.bogleheads.org/ and change the users' names to bold font
and I simply combined the two.

Code: Select all

// ==UserScript==
// @name         Bogleheads User Name Red Font
// @namespace    https://www.bogleheads.org/
// @version      0.1
// @description  Change user names to red font on Bogleheads
// @author       Your Name
// @match        https://www.bogleheads.org/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Get all elements with class 'username'
    var usernameElements = document.getElementsByClassName('NoMobile');

    // Loop through each element and change its color to red
    for (var i = 0; i < usernameElements.length; i++) {
        usernameElements[i].style.fontWeight = 'bold';
        usernameElements[i].style.color = 'red';
    }
})();
User avatar
Oicuryy
Posts: 1959
Joined: Thu Feb 22, 2007 9:29 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by Oicuryy »

cacophony wrote: Fri Feb 10, 2023 2:46 am I added it here: https://greasyfork.org/en/scripts/45975 ... front-page
Thanks for the idea!
Thank you. Clicking that Install button is a lot easier than messing with Tampermonkey's editor.

Ron
Money is fungible | Abbreviations and Acronyms
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

Hola wrote: Fri Feb 10, 2023 9:06 am This is all cool. However a word of caution to folks: consider that adding extra plugins/scripts to your browser opens you up for security and privacy issues.
Like anything you install on your computer it's important to be cautious. But in this case I don't think there's reason for concern as the tampermonkey plugin itself is in use by 10 million+ tech savy people, and the script itself is very basic and written to only be active on bogleheads.org.
Last edited by cacophony on Fri Feb 10, 2023 12:31 pm, edited 1 time in total.
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

tioscrooge wrote: Fri Feb 10, 2023 9:05 am Thank you! This works.
Glad to hear you got it working.
Hola
Posts: 141
Joined: Thu Nov 04, 2021 2:40 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by Hola »

cacophony wrote: Fri Feb 10, 2023 12:27 pm
Hola wrote: Fri Feb 10, 2023 9:06 am This is all cool. However a word of caution to folks: consider that adding extra plugins/scripts to your browser opens you up for security and privacy issues.
Like anything you install on your computer it's important to be cautious. But in this case I don't think there's reason for concern as the tampermonkey plugin itself is in use by 10 million+ tech savy people, and the script itself is very basic and written to only be active on bogleheads.org.
Lastpass was being used by 10 million+ tech savvy people.

Just wanted to make people cautious of anything they install off the internet. I don’t want to derail the topic at hand, I have nothing else to add. Thx
Topic Author
cacophony
Posts: 1363
Joined: Tue Oct 16, 2007 9:12 pm

Re: ChatGPT implemented thread hiding functionality on bogleheads.org

Post by cacophony »

Hola wrote: Fri Feb 10, 2023 1:38 pm
cacophony wrote: Fri Feb 10, 2023 12:27 pm
Hola wrote: Fri Feb 10, 2023 9:06 am This is all cool. However a word of caution to folks: consider that adding extra plugins/scripts to your browser opens you up for security and privacy issues.
Like anything you install on your computer it's important to be cautious. But in this case I don't think there's reason for concern as the tampermonkey plugin itself is in use by 10 million+ tech savy people, and the script itself is very basic and written to only be active on bogleheads.org.
Lastpass was being used by 10 million+ tech savvy people.

Just wanted to make people cautious of anything they install off the internet. I don’t want to derail the topic at hand, I have nothing else to add. Thx
LastPass is not a good comparison because they were in a position to be responsible for maintaining the offsite security of your most important data; a situation where there are all sorts of ways that incompetence could lead to a breach of security.

In this case the only real risk is that the authors are doing something deliberately nefarious with the code, and that's something that is quite a bit easier to detect, especially given that it runs entirely locally.

General warnings are fine, but in this specific case it's not warranted.
Post Reply