Skip to content

Instantly share code, notes, and snippets.

@natzir
natzir / Pseudo-Element-Highlighter-Bookmarklet.js
Created September 25, 2023 08:18
Pseudo-Element Highlighter Bookmarklet
javascript:(function(){function injectStyle(){var style=document.createElement('style');style.type='text/css';style.innerHTML='*::before, *::after {background-color: rgba(255,0,0,0.3) !important;}';document.head.appendChild(style);}injectStyle();})();
@natzir
natzir / Internal-Link-Checker-Bookmarklet.js
Last active February 19, 2024 08:51
Internal Link Checker Bookmarklet
@natzir
natzir / getPercentDiff.js
Last active February 29, 2024 02:16
getPercentDiff.js
javascript:(function()%7Bjavascript%3A!function()%7Bfunction%20e(e)%7Blet%20l%3De.querySelectorAll(%22tr%22)%2Cn%3Dl%5B1%5D%3Bif(!(n%26%26(n.querySelector(%22%3Anth-child(4)%20%3E%20span%20%3E%20span%20%3E%20span%22)%7C%7Cn.querySelector(%22%3Anth-child(7)%20%3E%20span%20%3E%20span%20%3E%20span%22))))for(let%20a%3D1%3Ba%3Cl.length%3Ba%2B%2B)%7Blet%20r%3Dl%5Ba%5D%3Br.cells%5B1%5D.getAttribute(%22data-numeric-value%22)%3Blet%20i%3Dr.cells%5B2%5D.getAttribute(%22data-numeric-value%22)%2Cc%3Dr.cells%5B3%5D.getAttribute(%22data-numeric-value%22)%3Br.cells%5B4%5D.getAttribute(%22data-numeric-value%22)%3Blet%20s%3Dr.cells%5B5%5D.getAttribute(%22data-numeric-value%22)%2Co%3Dr.cells%5B6%5D.getAttribute(%22data-numeric-value%22)%2Cd%3Di%2Cu%3Ds%2Cp%3Dt(c%2Cd)%2Ch%3Dt(o%2Cu)%2Cf%3Dr.querySelector(%22%3Anth-child(4)%20%3E%20span%20%3E%20span%22)%2Cm%3Dr.querySelector(%22%3Anth-child(7)%20%3E%20span%20%3E%20span%22)%2Cg%3Ddocument.createElement(%22span%22)%2C%24%3Ddocument.createElement(%22span%22)%3Bg.innerText%3D%60%20(
@natzir
natzir / crux-api-bulk.ipynb
Created July 4, 2023 09:10
CrUX-API-bulk.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@natzir
natzir / crux-from-google-serp.ipynb
Last active July 2, 2023 09:54
crux-from-google-serp.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var depth = parseInt(prompt("Please enter the scraping depth (we recommend between 1 to 3):", "2"));
if(!Number.isInteger(depth) || depth < 1) {
alert("Invalid depth! Setting depth to default (2).");
depth = 2;
}
var count = 1;
async function start() {
@natzir
natzir / Sistrix-Export-Clusters.js
Created August 9, 2021 13:19
Bookmark to extract Sistrix keyword clusters
javascript:(function(){output="<html><head><title>Sistrix Clusters by @Natzir9</title></head><body><button onclick=\"tableToExcel('sistrixTable','Sistrix Clusters')\">Export Sistrix Clusters</button><table%20id=\"sistrixTable\"><tr><th>Keyword</th><th>Count</th><th>Volume</th></tr>";var myValue=document.getElementById('sidebar').getElementsByClassName('value number');for(var i=0;i<myValue.length;i+=3){output=output+"<tr><td>"+myValue[i].innerText+"</td><td>"+myValue[i+1].innerText+"</td><td>"+Math.round(myValue[i+2].innerText)+"</td></tr>";};output+="</table>";with(window.open()){document.write(output);document.body.appendChild(document.createElement('script')).src='https://bl.ocks.org/insin/raw/1031969/tableToExcel.js';document.close();}})();
@natzir
natzir / google-api-indexing.ipynb
Created November 12, 2020 14:50
Google-API-Indexing.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@natzir
natzir / puppeteer-fetch-and-render.js
Last active August 25, 2023 23:44
Fetch and Render as Googlebot
// This code allows you to render a page as Googlebot with puppeter (headless Chrome).
// It even renders elements with the lazy-load implemented through IntersectionObserver.
// Copy and paste it here: https://try-puppeteer.appspot.com/
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Descriptors for other mobile devices: https://github.com/puppeteer/puppeteer/blob/main/src/common/DeviceDescriptors.ts
const mobile = {
name: 'Nexus 5X',
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.