Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrienjoly/64a2729454181fabce01b441cf349d14 to your computer and use it in GitHub Desktop.
Save adrienjoly/64a2729454181fabce01b441cf349d14 to your computer and use it in GitHub Desktop.
A script to paste into the js console of a Facebook note (i.e. blog post) in order to extract its meta-data
// copy and paste that script in the js console, from a facebook "note" url
permalink = $$('.mts a')[0];
[_, monthName, day, year] = new Date(permalink.innerText.split(' at ')[0]).toString().split(' ');
monthNum = {
Jan: 0,
Feb: 1,
Mar: 2,
Apr: 3,
May: 4,
Jun: 5,
Jul: 6,
Aug: 7,
Sep: 8,
Oct: 9,
Nov: 10,
Dec: 11,
}[monthName.substr(0, 3)];
`
- date: "${year}-${monthNum}-${day}"
title: "${$$('h2')[0].innerText}"
url: "${permalink.href}"
source: "facebook.com"
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment