Skip to content

Instantly share code, notes, and snippets.


lukethacoder/large.js Secret

Last active Oct 6, 2019
What would you like to do?
remove all premium/starred articles from Medium
// not just giving you medium content, giving you the largest content
// remove all premium/starred articles from Medium
let container = document.querySelector('.js-mainfeed');
let currentPostCount = 0;
let totalRemoved = 0;
const body = document.querySelector('body');
const totalRemovedEl = document.createElement('div');
totalRemovedEl.setAttribute("style", "position: fixed; height: 50px; width: 50px; bottom: 0; right: 0; background-color: #fff; color: rgba(0,0,0,.84); box-shadow: 0px 0px 11px 0px rgba(140,140,140,0.2); display: flex; justify-content: center; align-items: center;");
const removeElement = (el) => {
totalRemovedEl.innerText = totalRemoved;
const removeThoseDamnStarPosts = () => {
if (container.childElementCount > currentPostCount) {
let inViewPosts = document.querySelectorAll('.streamItem');
inViewPosts.forEach(el => {
el.querySelector('.svgIcon--star') ? removeElement(el) : console.log('FREE CONTENT - YEEEEW')
currentPostCount = container.childElementCount;
window.addEventListener('scroll', removeThoseDamnStarPosts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.