UserScripts icon indicating copy to clipboard operation
UserScripts copied to clipboard

Custom rule request: nnmclub.to [RU]

Open shikulja opened this issue 1 year ago • 14 comments

The url of site https://nnmclub.to

Is your request related to a problem? Please describe. -no

Describe the result you'd like with the rule

  1. need to leave the top header only on the first page.
  2. On other scrolling pages, need to remove the top and bottom header so that the content of the pages is combined into one element

Custom rule you've tried -no

Additional context in the image, a top and bottom header that broke up the content at the end of the page

image

I recently found out about your script, it’s just a miracle.

shikulja avatar May 10 '24 18:05 shikulja

Just click 'Update Online Rules', It's already added to the built-in rules library.

hoothin avatar May 11 '24 13:05 hoothin

@hoothin This is cool, thank you very much. I set the rule manually and it works. image

-Since I deleted the default rules list and there is no reset button. I added links manually, but for some reason they take a very long time to update. image

shikulja avatar May 11 '24 14:05 shikulja

@hoothin The main news feed works correctly, but some may need more support.

The added home page support works fine (with news page), but the scrolling script could be extended to forum pages, not just the news page

I don't know how to explain briefly. Normal behavior of forum pages.

That is, the site title, the main news, and the comment response window, and the bottom copyrights are repeated every time you scroll.

simple: https://nnmclub.to/forum/viewtopic.php?t=1735234

Screenshot: image

shikulja avatar Jul 09 '24 19:07 shikulja

I have no account that can reply on that bbs. So I can just try to work out.

{
    "name": "Несколько стран ввели загадочный экспортный контроль над квантовыми компьютерами :: NNM-Club",
    "url": "^https?://nnmclub\\.to/forum/",
    "example": "https://nnmclub.to/forum/viewtopic.php?t=1735234",
    "author": "Hoothin",
    "pageElement": ".forumline",
    "action": 0
}

You can test it yourself, and if it works, feel free to optimize and open a pr to submit it to the online rule.

hoothin avatar Jul 10 '24 00:07 hoothin

@hoothin

between pages: news block repeat image

end: comment response window in the end repeat image

shikulja avatar Jul 10 '24 08:07 shikulja

As I mentioned earlier, I'm not a user of this forum and don't have an account that can see the reply box, so I'm unable to assist you further. You'll need to examine the element structure yourself and modify the pageElement to get the desired result.

hoothin avatar Jul 10 '24 08:07 hoothin

@hoothin temp acc login: pagetual pass: coolclass55

shikulja avatar Jul 10 '24 08:07 shikulja

...No no no, I have already registered an account, but my rank is not high enough to reply.

hoothin avatar Jul 10 '24 08:07 hoothin

@hoothin I sent you my account by email

shikulja avatar Jul 10 '24 09:07 shikulja

{
    "name": "NNM-Club",
    "url": "^https?://nnmclub\\.to/forum/",
    "example": "https://nnmclub.to/forum/viewtopic.php?t=1735234",
    "author": "Hoothin",
    "pageElement": ".forumline>tbody>tr:nth-child(n+5):nth-last-child(n+5)",
    "action": 0
}

Take it.

hoothin avatar Jul 10 '24 09:07 hoothin

does not work. and the main news page too

shikulja avatar Jul 10 '24 09:07 shikulja

image

image

hoothin avatar Jul 10 '24 09:07 hoothin

@hoothin yes it works, I didn’t configure the rule correctly, oops

shikulja avatar Jul 10 '24 09:07 shikulja

vibe coding. added rule for Tracker (search) page

[
  {
    "name": "NNM-Club News",
    "url": "^https?://nnmclub\\.to/$",
    "example": "https://nnmclub.to/",
    "pageElement": ".leftnav+td>*",
    "pageAction": "eles.forEach(ele=>{let portalImg=ele.querySelector('var.portalImg');if(!portalImg)return;portalImg.innerHTML=`<img border='0' width='256' align='left' style='margin-bottom:8px;margin-right:8px;' title='pic' src='${portalImg.title}'>`})",
    "action": 0
  },
  {
    "name": "NNM-Club Tracker",
    "url": "^https?://nnmclub\\.to/forum/tracker\\.php",
    "example": "https://nnmclub.to/forum/tracker.php",
    "pageElement": ".forumline.tablesorter",
    "pageAction": "(()=>{let tables=document.querySelectorAll('.forumline.tablesorter');if(tables.length>1){let main=tables[0];let mainTbody=main.querySelector('tbody');for(let i=1;i<tables.length;i++){let tbody=tables[i].querySelector('tbody');while(tbody.firstChild){mainTbody.appendChild(tbody.firstChild);}tables[i].remove();}if($(main).hasClass('tablesorter')){$(main).trigger('update');}else{$(main).tablesorter();}}else if(tables.length===1){let main=tables[0];if($(main).hasClass('tablesorter')){$(main).trigger('update');}else{$(main).tablesorter();}}})()",
    "action": 0
  },
  {
    "name": "NNM-Club Forum",
    "url": "^https?://nnmclub\\.to/forum/(?!tracker\\.php)",
    "example": "https://nnmclub.to/forum/viewtopic.php?t=1735234",
    "author": "Hoothin",
    "pageElement": ".forumline>tbody>tr:nth-child(n+5):nth-last-child(n+5)",
    "action": 0
  }
]

shikulja avatar Jun 19 '25 16:06 shikulja