Feature Request: ignore a story

Discussion in 'Site Feedback' started by vyksin, Dec 31, 2024.

  1. vyksin

    vyksin Experienced CHYOA Backer

    It might be too much overhead, but just tossing it out there. Just like you can ignore an individual user, I'd like to ignore an entire story. I don't like the idea of censoring out content en masse for everyone, but there are a few stories that I feel are truly garbage that I would rather not see in the recent feed or even in search results. Something like
    WHERE StoryId not in UserIgnoreStories

    Where UserIgnoreStories is just an array; could even limit it to like 10 or 20.

    Obviously if it's a ton of work or too much load on the servers, it's just an annoyance; not a breaking item or anything.
     
  2. TheLowKing

    TheLowKing Really Really Experienced

    A while back I wrote a user script for myself to do just this:

    Code:
    // ==UserScript==
    // @name     CHYOA: Hide stories
    // @version  1
    // @author   [email protected]
    // @grant    none
    // @match    https://chyoa.com/search*
    // @match    https://chyoa.com/recently-updated-sex-stories*
    // @match    https://chyoa.com/new-sex-stories*
    // @match    https://chyoa.com/category/*
    // ==/UserScript==
    
    // List of author names whose stories should be hidden from view.
    const ignored_authors = [
      "username1",
      "username2",
    ];
    
    // List of URLs of stories that should be hidden from view. 
    const ignored_story_urls = [
      "https://chyoa.com/story/Story-1.1000",
      "https://chyoa.com/story/Story-2.2000",
    ];
    
    if (!document.querySelector('style.tlk.ignore_authors')) {
      const lower_cased_ignored_authors = ignored_authors.map(function(a) {
        return a.toLowerCase();
      });
      document.querySelectorAll('.item-header').forEach(function(item_header) {
        const author = item_header.querySelector('small > a').href.replace(/https:\/\/chyoa\.com\/user\//,
                                                                             '').toLowerCase();
        const story_url = item_header.querySelector('.title').href;
        if (lower_cased_ignored_authors.indexOf(author) >= 0 || ignored_story_urls.indexOf(story_url) >= 0) {
          item_header.parentNode.parentNode.classList.add('tlk',
                                                          'ignored_story');
        }
      });
    
      const style = document.createElement('style');
      style.classList.add('tlk',
                          'ignore_authors');
      style.innerHTML = `
    .tlk.ignored_story {
      display: none !important;
    `;
      document.head.appendChild(style);
    }

    This allows you to ignore both individual stories (by adding their URLs), or all stories by certain authors (by adding their usernames). You do have to copy paste them into the script yourself, so it's a bit of a hassle, but it works well.

    To use it you need to install a user scripting extension like TamperMonkey or GreaseMonkey, then past it into a new script (deleting whatever code the extension provides by default).
     
    vyksin likes this.
  3. vyksin

    vyksin Experienced CHYOA Backer

    Thank you for the code! I hadn't considered in browser scripts before. I'll have to look into them and play around with it!

    Thank you,
    -V