Report Only_Brad's Profile

Statistics

Anime Stats
Days: 248.8
Mean Score: 5.35
  • Total Entries992
  • Rewatched0
  • Episodes14,754
Anime History Last Anime Updates
Uzaki-chan wa Asobitai!
Uzaki-chan wa Asobitai!
Sep 5, 4:10 PM
Watching 3/12 · Scored -
Major 2nd (TV) 2nd Season
Major 2nd (TV) 2nd Season
Sep 5, 3:46 PM
Watching 15/? · Scored -
Kanojo, Okarishimasu
Kanojo, Okarishimasu
Aug 31, 3:05 PM
Watching 8/12 · Scored -
Manga Stats
Days: 117.3
Mean Score: 7.45
  • Total Entries472
  • Reread0
  • Chapters21,118
  • Volumes1,999
Manga History Last Manga Updates
Gate: Jieitai Kanochi nite, Kaku Tatakaeri
Gate: Jieitai Kanochi nite, Kaku Tatakaeri
Yesterday, 9:34 PM
Reading 97/? · Scored -
Yankee JK Kuzuhana-chan
Yankee JK Kuzuhana-chan
Sep 22, 6:17 PM
Reading 25/? · Scored -
Teisou Gyakuten Sekai
Teisou Gyakuten Sekai
Sep 22, 2:06 PM
Reading 23/? · Scored -

Favorites

All Comments (191) Comments

Would you like to post a comment? Please login or sign up first!
Asaburo Yesterday, 11:05 AM
No worries I mastered the skill of fleeing from the FBI
hacker09 Sep 7, 8:37 PM
Wow, that seems to be hard.

I was thinking on fetching every <script> and then executing all of them in the current document
hacker09 Sep 7, 7:05 PM
lol. I see

Thank you

I will see if I can do that
hacker09 Sep 7, 12:18 PM
I see, I thought that this was the case.
Thanks for your reply.

But I also tried executing all scripts on the fetched page and that didn't work either.

So basically isn't possible to fetch and append that?
hacker09 Sep 7, 10:55 AM
Hello.

I'm trying to fetch the contents of this https://myanimelist.net/news page and append the next page below the actual page, but for some reason the content is not displayed. I even tried appending the whole html but that didn't work either. Do you have any idea why this is happening?

// ==UserScript==
// @name            bug news page
// @version         0.0.2
// @author          hacker09
// @namespace       MAL
// @include         https://myanimelist.net/news*
// @run-at          document-end
// ==/UserScript==

(function() {
    'use strict';
    var pagenum = 1;
    var pagenumincreaseby = 1;
    var fetchpage;
    
        var nextpagenum = 1;
        var increaseby = 1;
        fetchpage = location.href+'?p='
    
    async function requestNextPage() //Creates a function to get the next page
    { //Starts the function
      nextpagenum += increaseby;
      pagenum += pagenumincreaseby;
      const response = await fetch(fetchpage+nextpagenum); //Fetch
      const html = await response.text(); //Gets the fetch response
      const newDocument = new DOMParser().parseFromString(html, 'text/html'); //Parses the fetch response
      var numberofthenextpage = document.createElement("center");
      numberofthenextpage.setAttribute("style", "font-size:14px;");
      numberofthenextpage.innerHTML = '■■■■■■■■■■■■■■■■■■■■■■■■■■■■Page '+pagenum+' ⬇️■■■■■■■■■■■■■■■■■■■■■■■■■■■■';
        
           document.querySelector("div.js-scrollfix-bottom-rel").append(numberofthenextpage);
           const nextpage = newDocument.querySelector('html'); //Actually I want this document.querySelector("div.news-list.mt16.mr8")
           document.querySelector("div.js-scrollfix-bottom-rel").append(nextpage);
    } //Finishes the async requestNextPage function

  var callFunction = true;
window.onscroll = async function() {
    if(callFunction && window.scrollY+1100 >= document.querySelector('div#myanimelist').offsetHeight - window.innerHeight) {
     callFunction = false;
     await requestNextPage();
     setTimeout(function(){callFunction = true;}, 1000);
    }
};
})();
hacker09 Sep 1, 8:47 AM
oh okay then.
I thought that it was possible because of the 3 thing that's written on that link you gave me.
MAL also has something like data-sitekey="reCAPTCHA_site_key" on the html, so I thought that I could simply store that reCAPTCHA_site_key value on a variable and then .remove() the recaptcha
hacker09 Aug 31, 1:37 PM
So this is what you meant?
https://myanimelist.net/forum/?topicid=1857502&show=0#msg60558724

I tried a few things but without success, I was able to get the function that is called when the submit button is clicked, I also could figure out that the 'r' means that's document.querySelector.

As you said the problem is to figure out what is their variables "e"
etc
hacker09 Aug 21, 5:53 PM
This is a bit better, but slower than showing only the reread titles
//modern manga lists
  var totalnum = $("td.data.number").length //Count total completed entries number.It's save to run this command line after 15 secs
  // The 6 lines Below Will Click all links labeled 'More' to get the rewatch counts later on the page
  var moreLinks = document.querySelectorAll('a');

  for(var i=moreLinks.length; i--; ) {
    if (moreLinks[i].innerHTML == 'More') {
      moreLinks[i].click();
    }
  }

  await new Promise(resolve => setTimeout(loopscrape, 15000)); // "Break" Function That Will Run The Commands Below After 5 secs

 //Then run this
    for (var i = document.querySelectorAll("td.td1.borderRBL").length; i--;) {
      document.querySelectorAll("td.td1.borderRBL")[i].outerHTML = "Times Read:"+"<strong>"+document.querySelectorAll("td.td1.borderRBL")[i].firstElementChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.textContent.replace(/[^0-9]+/g, "");+"</strong>"
    } //Finishes the for condition

  function loopscrape() {
  if (totalnum === document.querySelectorAll('tbody.list-item tr.more-info strong').length) //Check If The total completed entries number is equal to the total number of more links opened,And If Yes These Codes Will Run
{
  // The 6 lines Below Will Click all links labeled 'More' to get the rewatch counts later on the page
  var moreLinks2 = document.querySelectorAll('tbody.list-item tr.more-info strong');
  for(var i=moreLinks2.length; i--; ) {
    if (moreLinks2[i].innerText === '0'){$('tbody.list-item')[i].remove();}
  }
}
}


var x = document.querySelectorAll('tbody.list-item tr.more-info strong');
var i;
for (i = 0; i < x.length; i++) {
  x[i].setAttribute("style", "font-size: 16px;background-color: yellow;");
}
hacker09 Aug 21, 2:29 PM
hahahaha
The first chain creates the strong html element.
The second chain get the actual reread total number and add that number to the strong html element, while removing the text Times Read
hacker09 Aug 21, 10:40 AM
Hello bro.

https://greasyfork.org/en/scripts/407957-generate-a-list-with-the-animes-mangas-titles-that-were-re-watched-re-read/code

I already did almost everything I wanted, but there's a bug that I couldn't fix.

The bug is that something is making the script not work on manga modern lists,like this on this link I used to test that
https://myanimelist.net/mangalist/purplepinapples?status=2


the first bug/problem is this line
        if (!old_list) rewatches = document.querySelectorAll('tbody.list-item tr.more-info strong'); //If the script was run on an new modern list style then use this command to set the variable rewatches
       


That line makes the script get the rewatched animes number inside the html tag strong, but the html tag strong doesn't exist on modern manga list styles...
So I did this, and this worked, at least made the script show the results...


But the results are just a "blank" page, the reread anime titles doesn't appear...
I think that the error is somewhere in the function wait, but I don't know exactly where, neither what's the problem, since I tried changing the variables 'title', but it seems that they are all working correctly.
hacker09 Aug 18, 7:06 PM
Fixed bugs: When the user clicked on the buttons to reset started/finished dates the button 'Reset Started+Finished Dates' was not removed. When the user selected completed on a manga page the script didn't set the total volumes/chapters. -- Added Features: Now the script shows a loading page, so that the user won't click on anything else.Before if the user clicked on something else, the values would be at risk of being overridden and messed up.
hacker09 Aug 18, 5:59 PM
Thanks, I've already implemented and seen that, I'm working on that and fixing other bugs too.
hacker09 Aug 18, 5:58 PM
Thanks
hacker09 Aug 18, 12:50 PM
Thanks for your help.

If you are curious about how the script looks like now
https://myanimelist.net/forum/?topicid=1859648