📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Useful script for MSE users

Options
GiGoVX
GiGoVX Posts: 9 Forumite
Name Dropper First Post
edited 13 August at 4:29PM in Compers chat corner
First off I don't consider this 'self-promotion' just a simple post to say I got AI to write something for me for TamperMonkey that help me know which competition links I've pressed on this great forum as I can never remember which ones I've entered without clicking back on the link, this basically saves me time. I also have no association with TamperMonkey in any way shape or form.

TamperMonkey is a extension/browser addon. In there own words:
Tampermonkey is one of the most popular browser extension with over 10 million users.

It allows its users to customize and enhance the functionality of your favorite web pages.
Userscripts are small JavaScript programs that can be used to add new features or 
modify existing ones on web pages. With Tampermonkey, you can easily create, manage, and 
run these userscripts on any website you visit.
I personally use Edge, just search for the extension in the store or any other browser store and I'm sure you'll find it.

Once loaded create a new script and add copy and past the script at the bottom if this post below, save and then you can reload your MSE page and all the links you press from here on out will show up as 'green' to indicate you have visited them.
Example how it looks to me below:


Here is the code, I have only tested this in the latest version of Edge on Windows 11, it should work across all Chromium based browsers and also Firefox.


// ==UserScript==
// @name         MSE Forum – Cross Out Clicked Links (Green)
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Cross out competition links in MSE forum when you click/open them; persists your entries.
// @match        https://forums.moneysavingexpert.com/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
  'use strict';

  const STORAGE_KEY = 'mseCrossedLinks';
  let crossed = new Set(JSON.parse(localStorage.getItem(STORAGE_KEY) || '[]'));

  // Save the updated set to localStorage
  function save() {
    localStorage.setItem(STORAGE_KEY, JSON.stringify(Array.from(crossed)));
  }

  // Apply strikethrough in green
  function styleLink(a) {
    a.style.textDecoration      = 'line-through';
    a.style.textDecorationColor = 'green';  // change this to your preferred colour
    a.style.color               = 'green';  // make the text itself green
    a.style.opacity             = '1';      // full opacity so it’s not faded
  }

  // Process a single link element
  function processLink(a) {
    const href = a.href;
    if (!href || !href.startsWith('http')) return;

    // On load: style any previously clicked URLs
    if (crossed.has(href)) {
      styleLink(a);
    }

    // On any mouse-button down: record & style
    a.addEventListener('mousedown', () => {
      crossed.add(href);
      save();
      styleLink(a);
    });
  }

  // Scan all relevant links in posts and process them
  function scanAndProcess() {
    const selectors = [
      '.Message.userContent a',   // XF1 posts
      '.bbWrapper a',             // XF1 legacy
      '.messageContent a',        // XF2 posts
      '.message-userContent a'    // XF2 alternate
    ];

    selectors.forEach(sel =>
      document.querySelectorAll(sel).forEach(processLink)
    );
  }

  // Initial scan
  scanAndProcess();

  // Re-run on dynamic content loads (pagination, new replies)
  new MutationObserver(scanAndProcess).observe(document.body, {
    childList: true,
    subtree:   true
  });

})();
Again I'm not believing this is self promotion, I'm not gaining anything from this, I'm simple sharing something that has taken about 2 mins to do, it's taken me longer to write this post than to get AI to do this!

Hope others find it useful. You may also discover TamperMonkey can help you with all kind of other competition tasks, I run a few scripts across several sites to automatically enter my details to save me the hassle! 

Comments

  • marcia_
    marcia_ Posts: 3,468 Forumite
    Sixth Anniversary 1,000 Posts Photogenic Name Dropper
     Not self promotion my a*** 
  • cooldude255220
    cooldude255220 Posts: 1,595 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Combo Breaker
    marcia_ said:
     Not self promotion my a*** 
    They're making something freely available which might benefit other users, and they get zero benefit from doing do. Exactly how is that self promotion? 
  • GiGoVX
    GiGoVX Posts: 9 Forumite
    Name Dropper First Post
    marcia_ said:
     Not self promotion my a*** 
     :confused: please tell me how this is self promotion? I get nothing out of this, I'm merely sharing something that other may find useful. I'm not saying 'Hey click this link to my site and download this tool'. I haven't even posted the tampermonkey link.

    I just don't get it. What's the issue? 
  • marcia_
    marcia_ Posts: 3,468 Forumite
    Sixth Anniversary 1,000 Posts Photogenic Name Dropper
    edited 13 August at 6:30PM
    GiGoVX said:
    marcia_ said:
     Not self promotion my a*** 
     :confused: please tell me how this is self promotion? I get nothing out of this, I'm merely sharing something that other may find useful. I'm not saying 'Hey click this link to my site and download this tool'. I haven't even posted the tampermonkey link.

    I just don't get it. What's the issue? 
    Probably because you cant post links yet but you are still directing people there. Whats your connection to the site? 
  • GiGoVX
    GiGoVX Posts: 9 Forumite
    Name Dropper First Post
    edited 13 August at 6:33PM
    marcia_ said:
    GiGoVX said:
    marcia_ said:
     Not self promotion my a*** 
     :confused: please tell me how this is self promotion? I get nothing out of this, I'm merely sharing something that other may find useful. I'm not saying 'Hey click this link to my site and download this tool'. I haven't even posted the tampermonkey link.

    I just don't get it. What's the issue? 
    Probably because you canr post links yet 
    Oh I could, it's not hard to remove the 'https' from the post!

    But you still haven't said how this is any kind of self promotion......  :|

    EDIT: this will help

  • marcia_
    marcia_ Posts: 3,468 Forumite
    Sixth Anniversary 1,000 Posts Photogenic Name Dropper
    GiGoVX said:
    marcia_ said:
    GiGoVX said:
    marcia_ said:
     Not self promotion my a*** 
     :confused: please tell me how this is self promotion? I get nothing out of this, I'm merely sharing something that other may find useful. I'm not saying 'Hey click this link to my site and download this tool'. I haven't even posted the tampermonkey link.

    I just don't get it. What's the issue? 
    Probably because you canr post links yet 
    Oh I could, it's not hard to remove the 'https' from the post!

    But you still haven't said how this is any kind of self promotion......  :|

    EDIT: this will help

     Hysterical https://www.moneysavingexpert.com/site/forum-faqs/?_gl=1*z0mz30*FPAU*OTUwNzc5NzM1LjE3NTMxNjQ5NDY.*_ga*NTE0Nzg3ODMwLjE1NTM0NDAwMDQ.*_ga_X74CWQS9F0*czE3NTUxMDU5MDYkbzI2NTkkZzEkdDE3NTUxMDY2NDAkajI4JGwwJGg1MDE1NDMwMTQ.
  • cooldude255220
    cooldude255220 Posts: 1,595 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Combo Breaker
    marcia_ said:
    GiGoVX said:
    marcia_ said:
     Not self promotion my a*** 
     :confused: please tell me how this is self promotion? I get nothing out of this, I'm merely sharing something that other may find useful. I'm not saying 'Hey click this link to my site and download this tool'. I haven't even posted the tampermonkey link.

    I just don't get it. What's the issue? 
    Probably because you cant post links yet but you are still directing people there. Whats your connection to the site? 
    TamperMonkey is an add-on that allows users to write and run their own scripts. I am sure that the only "connection" GiGoVX has to TamperMonkey is that they have used TamperMonkey's product to make a script.

    For some reason, the userbase on this forum has a hysterical reaction to people "self-promoting" (though I really do not think that's happening here).

    Personally, I would like users to be able to post their own competitions (provided that they declare that they are running the competition, and maybe provided they obtain authorisation from the Guides first). That would allow proper transparency while potentially increasing the number of competitions on here. Provided of course that such authorisation/standing permission could be revoked if there is reason to question the authenticity of the competition or because the user is spamming etc. 
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 351.2K Banking & Borrowing
  • 253.2K Reduce Debt & Boost Income
  • 453.7K Spending & Discounts
  • 244.2K Work, Benefits & Business
  • 599.3K Mortgages, Homes & Bills
  • 177K Life & Family
  • 257.6K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.2K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.