Welcome to Sock Darning! Have a sock with a thinning heel or a toe hole you want to fix? Share your damage maps, yarn blend questions, and stitch experiments with other darning-minded visitors. Reading along is welcome too, so pull up a chair and join the conversation.

auto-scrolls until the page stops growing, then prints every unique facebook reel ID to the console

  • Thread starter Thread starter Austin Songer, CISSP
  • Start date Start date
A

Austin Songer, CISSP

Guest
photos.js

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
Show hidden characters

(() => {
let last = 0;
const timer = setInterval(() => {
window.scrollTo(0, document.body.scrollHeight);
if (document.body.scrollHeight === last) {
clearInterval(timer);
const ids = [...document.querySelectorAll('a[href*="/photo"], a[href*="fbid="]')]
.map(a => {
const fromPath = a.href.match(/\/photos?\/(\d+)/)?.[1];
const fromQuery = a.href.match(/[?&]fbid=(\d+)/)?.[1];
return fromPath || fromQuery || null;
})
.filter(Boolean);
console.log([...new Set(ids)].join('\n'));
}
last = document.body.scrollHeight;
}, 1500);
})();
unique-facebook-ids.js

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
Show hidden characters

let last = 0;
const timer = setInterval(() => {
window.scrollTo(0, document.body.scrollHeight);
if (document.body.scrollHeight === last) {
clearInterval(timer);
const ids = [...document.querySelectorAll('a[href*="/reel/"]')]
.map(a => a.href.match(/\/reel\/(\d+)/)?.[1])
.filter(Boolean);
console.log([...new Set(ids)].join('\n'));
}
last = document.body.scrollHeight;
}, 1500);
 
Top