Created
January 13, 2025 15:04
-
-
Save MatyiFKBT/64b32e9336be4af77cc7804261660794 to your computer and use it in GitHub Desktop.
Show new beers on Untappd - quick userscript might use later
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name New Beerz | |
// @namespace http://tampermonkey.net/ | |
// @version 2025-01-13 | |
// @description Add button to filter for new beeeeeeeerz. | |
// @author MatyiFKBT | |
// @match https://untappd.com/v/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=untappd.com | |
// @grant GM_addStyle | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
GM_addStyle(".menu-search-bar .filter-toggle, .menu-search-bar .search-form .search-btn { width:12%; padding-left:0; }"); | |
GM_addStyle(".hidden { display:none; }"); | |
const menu = document.querySelector(".menu-search-bar"); | |
const div = document.createElement("div"); | |
div.classList.add("filter-toggle"); | |
div.innerHTML = `<p><span id="show-new-btn">new</span></p>`; | |
menu.appendChild(div); | |
document.querySelector("#show-new-btn").addEventListener('click', ()=>{ | |
[...document.querySelectorAll('.menu-item#beer')].filter(e=>e.querySelector('.drankit')).map(e=>e.classList.toggle('hidden')); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment