-
-
Save t-wy/66faed8679d127793891ecb775efdaa9 to your computer and use it in GitHub Desktop.
javascript: fbid = /share_fbid":"(\d+)"/g.exec([...document.getElementsByTagName("script")].filter(x => x.innerHTML.includes("share_fbid"))[0].innerHTML)[1]; alert(location.href.split("/").slice(0, -1).join("/") + "/" + fbid); | |
// can be used in console / bookmark / address bar (remember to add back javascript if the browser strips it automatically) |
is it still works?
@gcobc12632 Facebook has created several URL formats since then. Some URL still keeps the ID, and for those looking like https://lp7vsba6mm.proxynodejs.usequeue.com/.../posts/pfbid...
, the post ID can no longer be found in any element.
However you may still try to create an embed via "…" at the top-right corner of the post or through https://uoj1eqlz6p.proxynodejs.usequeue.com/docs/plugins/embedded-posts/. The hyperlink tied to the Facebook logo at the top right corner should still be pointing to the URL with the original ID instead of the post ID.
- Open Inspector
- Ctrl+F looks for "share_fbid" in HTML
- Get the value of data-content-len="??????"
- In console, try
$x('//*[contains(@data-content-len,??????)]')[0].innerText.match(/share_fbid":"(.+?)",/)[1]
- If success, the pfbid can be replaced by this result
Further simplify~ run the following code in console will copy the shortest link form fb.com/1234567890
to clipboard
copy('fb.com/'+[...document.getElementsByTagName("script")].filter(x => x.innerHTML.includes("share_fbid"))[0].innerText.match(/share_fbid":"(.+?)",/)[1])
Further simplify~ run the following code in console will copy the shortest link form
fb.com/1234567890
to clipboardcopy('fb.com/'+[...document.getElementsByTagName("script")].filter(x => x.innerHTML.includes("share_fbid"))[0].innerText.match(/share_fbid":"(.+?)",/)[1])
amazing!
is it still works?