Skip to content

Instantly share code, notes, and snippets.

@databento-bot
Created April 8, 2025 07:20
Show Gist options
  • Save databento-bot/42fcd8014db736301391143b4e1b5969 to your computer and use it in GitHub Desktop.
Save databento-bot/42fcd8014db736301391143b4e1b5969 to your computer and use it in GitHub Desktop.
// Condenses MEMX notices on https://info.memxtrading.com/category/alerts-notices/
const s=document.createElement("style");s.innerHTML="*{margin:0!important;padding:0!important;line-height:1!important;font-size:10px!important;letter-spacing:0!important}div,p,span,a,li,td,th{line-height:1!important;font-size:10px!important}table{border-spacing:0!important;border-collapse:collapse!important}",document.head.appendChild(s),(async()=>{const e=document.querySelector("main");if(!e)return void console.error("No <main> element found.");document.querySelectorAll("div.nav-links").forEach(t=>t.remove());for(let t=2;t<=91;t++){const n=`https://info.memxtrading.com/category/alerts-notices/page/${t}/`;try{const t=await fetch(n),o=await t.text(),i=new DOMParser().parseFromString(o,"text/html");i.querySelectorAll("hr, article").forEach(t=>e.appendChild(t.cloneNode(!0))),console.log(`Appended page ${t}`)}catch(a){console.error(`Error fetching page ${t}:`,a)}}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment