Go Back   Freethought Forum > Public Works > Forum Administration

Reply
 
Thread Tools Display Modes
  #1  
Old 10-07-2023, 03:39 AM
michio michio is offline
Member
 
Join Date: May 2009
Posts: CIX
Default Script for replacing a specific user's comment with a motivational quote

See the post after this for instructions on installing and using.

-----

I'm writing a script that you can use with the Tampermonkey extension to hide a user's quoted messages with a motivational quote.

Motivation & use case: If a user is bothering you, you can add them to your ignore list, but there's a problem. Other users can quote their messages, and you can still see that, which defeats the purpose of the ignore feature. So I set out to do something about that.

How it works: Install the Tampermonkey browser extension, I give you the javascript, you provide the script usernames, and it will replace those usernames' posts with a motivational quote. Click on the quote to receive a new quote.

Here's a video demo of what I have so far:
https://p192.p3.n0.cdn.getcloudapp.c...56e4e01f4675cb

TODO:
  • [ ]Support more than one username
  • [DONE]Instead of just replacing quoted posts, also replace the original post with a quote
  • [DONE]Make a version of the script that will just hide the message with "Hidden" or something instead of using the quote API
  • [ ]Make sure I'm not accidentally targeting unintended elements in the page
  • [DONE]Make more user friendly and easy to setup?
  • [ ]Ability to customize styling so you can have your own font, font size, and colors?
  • [ ]Refactor/cleanup

Unfortunately this is right now extremely not user-friendly. I'm using rapidapi.com. If I provided the script, I'm not going to share my API key. So you would have to sign up at rapidapi.com, and navigate to this page: Quotel - Quotes API Documentation (skjaldbaka17) | RapidAPI and subscribe to the API, then you have to modify the script (it's easy and I can provide a screenshot) to provide your personal API key. All of that is way too much of a pain in the ass.

The only way to make this really user-friendly is to create a Chrome extension, which instead of calling rapidapi.com directly, the request is routed to a proxy server I would have to setup, which then routes the request to rapidapi.com. That way, only the proxy server needs the API key, and nobody has to do anything except install the browser extension.

I might actually do all of this because I'm in the market for a new job, and I think it would be really funny if I was showing off my projects in an interview and I pulled up freethought-forum.com for a demonstration of my tool.

Last edited by michio; 10-08-2023 at 03:20 AM.
Reply With Quote
Thanks, from:
Ensign Steve (10-08-2023), fragment (10-07-2023), JoeP (10-07-2023), mickthinks (10-07-2023), slimshady2357 (10-07-2023)
  #2  
Old 10-07-2023, 07:45 PM
michio michio is offline
Member
 
Join Date: May 2009
Posts: CIX
Default Re: Script for replacing a specific user's comment with a motivational quote

I made a version that just replaces the quoted message with a set message for now. Should be straightforward to setup. Will work on something easier to setup.

If you try this and it doesn't work, let me know.

Instructions if you're interested in running this on your computer


We need Tampermonkey for this. It's an extension that allows you to inject your own javascript into a webpage. Download Tampermonkey here: Click here to download Tampermonkey for Chrome or Edge. This should also work on Firefox but I haven't tried.

Open up the Tampermonkey extension by clicking on the extension icon and click "Create a new script...". It should look something like this:



When it opens, you should see the following screen below. Delete everything in that box.

Download the attachment located at the bottom of this post called 'tampermonkey-script.txt'. Open the file in any text editor. Copy everything in that file, and paste into the box.



Almost done. Enter a username indicated below, then hit Ctrl + S or click just above that box File -> Save.



Final step. We need to make sure it's enabled. The radio button needs to be green. See below:



Attached Files
File Type: txt tampermonkey-script.txt (2.8 KB, 0 views)
Reply With Quote
Thanks, from:
fragment (10-08-2023), slimshady2357 (10-08-2023), viscousmemories (10-08-2023)
  #3  
Old 10-08-2023, 04:37 AM
michio michio is offline
Member
 
Join Date: May 2009
Posts: CIX
Default Re: Script for replacing a specific user's comment with a motivational quote

Well, I got a Chrome extension working... That was easier than expected. I probably wasted my time with Tampermonkey but that's ok, all software knowledge is helpful.

It will take me some time to finish, polish, and hopefully get Google to publish the extension. In the meantime I can release a rough draft that works and gets the job done in a zip file. You can then load it manually in the browser extension manager.

Give me 2-3 days.

Also, you no longer need to be logged in. It will hide both the original post of the ignored user, as well as their posts when quoted by other users. This is important because if you're not logged in, you're still going to see posts from users you don't want to see.

It looks like shit because I've added 0 styling and it's barebones functionality but it works. Demo: https://p192.p3.n0.cdn.getcloudapp.c...8dbc9a899d17d1
Reply With Quote
Thanks, from:
JoeP (10-08-2023), slimshady2357 (10-08-2023), viscousmemories (10-08-2023)
  #4  
Old 10-10-2023, 06:24 AM
michio michio is offline
Member
 
Join Date: May 2009
Posts: CIX
Default Re: Script for replacing a specific user's comment with a motivational quote

It's coming along... https://p192.p3.n0.cdn.getcloudapp.c...9c81d72c21ae08

Before I release version 0.1, I want to figure out how to only hide that specific users posts in a large nested quote instead of hiding the entire chain of quoted posts.
Reply With Quote
Thanks, from:
viscousmemories (10-10-2023)
Reply

  Freethought Forum > Public Works > Forum Administration


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

 

All times are GMT +1. The time now is 01:11 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Page generated in 0.27320 seconds with 16 queries