DTF & VC Comments Expander

Expands dtf.ru & vc.ru all comments by default

// ==UserScript==
// @name         DTF & VC Comments Expander
// @namespace    https://tampermonkey.net/
// @version      1.6
// @description  Expands dtf.ru & vc.ru all comments by default
// @author       Streampunk
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAMAAAAKE/YAAAAAb1BMVEWF1vAAAQUAAAF4wdkUISiH2vSE1e8PGR8wTlpzudEKERZtr8UOFx1Pf5CC0uxXjJ4pQk0GCg8kO0V/zeZhnLA8YnAzU184W2ksSFNnprtDbXxThpdsrsRAaHYfMjt6xd1clKgXJS1JdoZakaMcLTWbLIFvAAACy0lEQVR4nO3c25KiMBSF4SQQD4iHCAqeQGnf/xmHnrmZC7ZMmaw0Tq3/XuvrVCqtJFEpxhhjjDHGGGOMMcYYY4wxxhh7u9m7KWWt/Rlze1i82bG6re/XdvMD8iQ176d19qi7UxGbnaTaq57umvN1E9Xti/4Dz+oy5nCHQH+73a6MN9qB0D07q5ax1MHQPTvdRhrsgOh+jlTtx6H79qsPRJvn6fPQ/cQuPw/dq/FjHRytzQM+r8Ojtdkn4JUPgNa62nwg2l2wQw1B63QFVWPQ5gidIBi0diVyqEFosys+D63dHTjUKLSpgbP6ffTvL7Zy2Qk31ALa3dZjdVWTvfqbDjCzhM5WdjRVnA65ONrmiftCIKL/5cVWXWtxqIGrnhe6Zxc3Jw31GWX2RSu1uUnoHWz98EarQpohKewTqj/arubDaAdb9PzRSkkTZDtl9FVYr7spo4v94Gptqimj7WEYvQCZw6DXg+9h6tmU0dthNGyhJppoookmmmiiiSaaaKKJJppooi/DaNi2SxD0WXhYM+XnHrNaeCwGModAW+E9zG3Cz/KEKa31esLothne4sLtFAVAd8JA57ATkd5oWwqP1E0D29P3RdtS2qfGLR6eaFushV0iDdxy8dhmVtYWZS1tfWo9xx3yldD35Virsts7+SAC7v+hfHQiy8fKnH51dsJ9RT864R3yEAIMrTucGXbw6oE8uokaadhuLQ5tGug5ewwaesANhQYf60WgTQM+QI1Az4FH8lBoh/ukBEO7DvehA4V2Z/DZegDadXhzYLTJL/C5ERptHhGuEwVGu0WkG4nh0Ca9xLqyGgpt8kO0i59h0EbPq+ss3s1gf/T3HexuFWPR+Av98mT/CLd/bd7cylbFve6eNPn8zdLn/ni+L4v4vyuwSUYfcAglSbv5qd9wGL+wID5iYowxxhhjjDHGGGOMMcYYY4wxxtj/3y9lTEB1QYFbqAAAAABJRU5ErkJggg==
// @match        https://dtf.ru/*
// @match        https://vc.ru/*
// @run-at       document-end
// @grant        none
// @license      MIT
// ==/UserScript==

setInterval(function() {
  const load_all_comments_button = document.querySelector(".comments__show-all");
     if(load_all_comments_button) {
        load_all_comments_button.click();
        clearInterval();
//      console.log("Trying expand all comments - vc.ru");
        }
     else
        clearInterval();
//      console.log("All comments expanded - vc.ru");
}, 5000);

setInterval(function() {
  const load_all_comments_button = document.querySelector("#app > div.layout > div.view > div.entry > div.comments.comments--limited > div.comments-limit > button");
     if(load_all_comments_button) {
        load_all_comments_button.click();
        clearInterval();
//      console.log("Trying expand all comments - dtf.ru");
        }
     else
        clearInterval();
//      console.log("All comments expanded - dtf.ru");
}, 5000);

setInterval(function() {
  const load_more_comments_button = document.querySelector(".comment__load-more");
     if(load_more_comments_button) {
        load_more_comments_button.click();
        clearInterval();
//      console.log("Trying expand replies - vc.ru");
        }
     else
        clearInterval();
//      console.log("All replies expanded - vc.ru");
}, 1000);

setInterval(function() {
  const load_more_comments_button = document.querySelector("#app > div.layout > div.view > div.entry > div.comments > div.comments-tree > div:nth-child(N) > div.comment__content > div.comment__footer > button");
     if(load_more_comments_button) {
        load_more_comments_button.click();
        clearInterval();
//      console.log("Trying expand replies - dtf.ru");
        }
     else
        clearInterval();
//      console.log("All replies expanded - dtf.ru");
//};
}, 1000);

setInterval(function() {
  const load_more_comments_button = document.querySelector("#page_wrapper > div.page.page--entry > div.l-island-bg.l-island-round.l-pv-32.lm-pv-20.lm-mt-20.l-mt-28 > div > div.comments__body > div.comments__content_wrapper.comments__content_wrapper--open > div.comments__content_wrapper__container > div.comments__content.l-island-a > div:nth-child(N) > div.comment__content > div.comment__load-more.comment__inline-action");
     if(load_more_comments_button) {
        load_more_comments_button.click();
        clearInterval();
//      console.log("Trying expand replies - old dtf.ru");
        }
     else
        clearInterval();
//      console.log("All replies expanded - old dtf.ru");
//};
}, 1000);