FB: Post Tools & Statistics

Shows exact timestamps and post information on Facebook Posts.

目前为 2019-08-11 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name FB: Post Tools & Statistics
  3. // @match https://www.facebook.com/*
  4. // @match https://*.facebook.com/*
  5. // @match http://www.facebook.com/*
  6. // @match http://*.facebook.com/*
  7. // @run-at document-start
  8. // @grant GM_addStyle
  9. // @author JZersche & wOxxOm
  10. // @require https://greasyfork.org/scripts/12228/code/setMutationHandler.js
  11. // @ require https://momentjs.com/downloads/moment.min.js
  12. // @ require https://momentjs.com/downloads/moment-with-locales.min.js
  13. // @ require https://html2canvas.hertzen.com/dist/html2canvas.js
  14. // @version 1.10 RELEASE
  15. // @namespace https://greasyfork.org/users/95175
  16. // @description Shows exact timestamps and post information on Facebook Posts.
  17. // ==/UserScript==
  18.  
  19. var options = {
  20. weekday: 'long',
  21. year: 'numeric',
  22. month: 'numeric',
  23. day: '2-digit'
  24. };
  25. GM_addStyle('a._5pcq:hover {text-decoration: none!important;}' + 'a._5ptz:hover {text-decoration: none;}' + '.h_1zif-zjsf {color: red;}' + '.full-timestamp { opacity: 0.95; color: #f00!important; }' + '.full-timestamp:hover { opacity: 1.0; }' + '.full-timestamp:before { content: ""; }' + '.full-timestamp:after { content: ""; }' + '.timestampContent { display: none; }' + '._5ptz.timestamp.livetimestamp .timestampContent { display: inline-block; }' + '._5pcp._5lel._2jyu._232_ {line-height: 16px;font-size:9px;}' /* Status Information Spacing */ + '.sponsored { color: #06b;}' + '.copybtnP { margin-bottom: 8px }' + '.copybtnP, .s2img {display: inline-block;}' + '.s2img {margin-right:4px;}' + '._3ds9 {border: 1px dashed #385898 !important; border-radius: 1px; padding-bottom: 0px !important; margin-bottom: 8px !important; background: #38589811;}' + '.copybtn, .copybtnP, .s2img { border: 1px solid #e2e4e5; background: #fff; color: #365899; border-radius: 8px; letter-spacing: 0.05px;font-weight: 700;height: 23px;}' + '.canvasArea {height: 23px;overflow: hidden;color: #c1c1c1;word-break: break-all;display: block;font-size: 10px;letter-spacing: -0.70px;font-family: "Segoe UI" !important;line-height: 11px;text-align: justify;margin-top: 5px;margin-bottom: 1px;background: #00000010;border-radius: 10px;border: 1px dashed #c1c1c1;margin-top: 5px;padding-bottom: 0px;padding-left: 1px;padding-right: 1px;}' + 'span.SaveAsImageFile a { border:0px solid red; position:relative; font-weight:600; color:#aaa;font-family: \'Segoe UI\';font-variant-caps: all-small-caps;}' + 'div._3ekx._29_4 div._6m3._--6 div._59tj._2iau { top: 7px !important;position: relative;}' + 'span.externalURLs { position: absolute;color: #606770;padding-left: 2px;display: inline-block;top: 4px;width: 489px;font-size: 10px;border-radius: 3px;background: #f2f3f5;left: 3px;white-space: pre;text-overflow: ellipsis;overflow: hidden;border: 1px dashed #bec3c9;}' + 'span.ViewImage { color: #888 !important; font-family: \'Segoe UI\';font-variant-caps: all-small-caps;}' + 'span.ViewImage a { color: #888 !important; font-family: \'Segoe UI\';font-variant-caps: all-small-caps;}');
  26. // process the already loaded portion of the page if any
  27. expandDates(document.querySelectorAll('abbr[data-utime]'));
  28. RecentTimestamps(document.querySelectorAll('.q_1zif-zjsq'));
  29. RecentPostURLs(document.querySelectorAll('.q_1zif-zjsq, ._5r69, ._6ks'));
  30. ExternalURLs(document.querySelectorAll('._52c6'));
  31. expandPostIDs(document.querySelectorAll('._5pcq'));
  32. document.querySelectorAll('.hasCaption');
  33. // process the stuff added from now on
  34. setMutationHandler(document, 'abbr[data-utime]', expandDates);
  35. setMutationHandler(document, '.q_1zif-zjsq', RecentTimestamps);
  36. setMutationHandler(document, '.q_1zif-zjsq, ._5r69, ._6ks', RecentPostURLs);
  37. setMutationHandler(document, '._52c6', ExternalURLs);
  38. setMutationHandler(document, '._5pcq', expandPostIDs);
  39. /*
  40. html2canvas(document.querySelector('._3576')).then(canvas => {
  41. document.getElementsByClassName('s2img')[0].addEventListener('click', function(event) {node.insertAdjacentHTML('afterend', canvas.toDataURL());})
  42. });
  43. */
  44. setMutationHandler({
  45. target: document.querySelector('._3576'),
  46. selector: '.s2img',
  47. handler: nodes => nodes.forEach(node => {
  48. node.setAttribute("style", "color: red; border: 1px solid red;");
  49. node.addEventListener('click', function (event) {
  50. //node.closest('._5pcp._5lel').setAttribute("style", "font-size: 7px;line-height: 16px;");
  51. node.setAttribute("style", "color: #5550; border: 1px solid #0000; display:none;");
  52. node.nextSibling.setAttribute("style", "color: #00ff; border: 1px solid #00ff; display:inline-block;");
  53. //var PageTitleColorPROMPT = '#fff';
  54. //console.log(event.target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className);
  55. //event.target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.setAttribute("style", "background:#222;");
  56. var PageTitleColorPROMPT = prompt('Enter the HTML Hex Color # the Page Title should be:','#fff');
  57. /* Name of Page Color Change on Click */
  58. /* Likes Information (Hide/Show) */
  59. var classCheck0 = event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.children;
  60. var classCheck1 = event.target.parentNode.children;
  61. var classCheck2 = event.target.parentNode;
  62.  
  63.  
  64. if (classCheck0.length >= 0 && window.location.href.match(/(facebook\.com\/(\D+|\D+\d+)\/posts\/\d+|(https:\/\/www\.facebook\.com\/(\w+)\/posts\/\d+\?))/)) {
  65. event.target.parentNode.setAttribute("style", "background:#222;");
  66. console.log('URL is supported 0 by script. 1.04 Version. OK :) :: ' + window.location.href);
  67.  
  68. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined) {
  69. node.nextSibling.value = 'Archived Post [Mode: 2]';
  70. node.nextSibling.setAttribute('style','color:#f04;background:#1110;border:1px solid #f04;text-align:left;:font-size:10px;margin-right:4px;');
  71. console.log('Capture: Mode #2');
  72. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  73. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style','display:none;');
  74. //event.target.parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(https://i.imgur.com/ZL0LHeL.png); background-size: 38px 16px; background-repeat: no-repeat; display: block; height: 20px; width: 43px; background-position: 0px 0px !important; top: -1px;margin-left:0px;');
  75. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[2].setAttribute("style", "display:none;");
  76. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[3].setAttribute("style", "display:none;");
  77. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  78. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  79. }
  80. else {
  81. node.nextSibling.value = 'Archived Post [Mode: 2]';
  82. node.nextSibling.setAttribute('style','color:#f04;background:#1110;border:1px solid #f04;text-align:left;:font-size:10px;margin-right:4px;');
  83. console.log('Capture: Mode #1');
  84. }
  85.  
  86. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #222; display:block; border:0px solid #222!important;");
  87. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: #222; display:block; border:0px solid #222!important;");
  88. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  89. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].childNodes[0].setAttribute("style", "border-bottom: 2px solid #0000;");
  90. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  91. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#222;");
  92. //if(!window.location.href.match(/\d/)) {};
  93. //node.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.children[1].children[2].children[1].children[0].children[0].children[1].children[1].children[0].children[0].children[0].children[2].setAttribute("style", "display:none;");
  94. //node.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.children[1].children[2].children[1].children[0].children[0].children[1].children[1].children[0].children[0].children[0].children[3].setAttribute("style", "display:none;");
  95. var iCapture = event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode;
  96. html2canvas(iCapture, {useCORS: true, backgroundColor: '#222', logging: true, x: 338, y: 425, width: 510}).then(canvas => {
  97. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  98. var iNameGen = Math.random().toString(36).substring(2, 15);
  99. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  100. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  101. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  102. setTimeout(function () {
  103. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  104. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  105. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #2220;color: #f68;float: right;border: 1px solid #9990;');
  106. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base64';
  107. /* Likes Information (Show) */
  108. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  109. }, 0);
  110. })
  111. }
  112.  
  113.  
  114.  
  115. else if (classCheck0.length >= 0 && window.location.href.match(/(facebook\.com\/(\D+|\D+\d+)\/photos\/a.\d{1,45}\/\d{1,26}.+)/)) {
  116. console.log('URL is supported 3 by script. 1.04 Version. OK :) :: ' + window.location.href);
  117. event.target.parentNode.setAttribute("style", "background:#222;");
  118.  
  119. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined) {
  120. node.nextSibling.value = 'Archived Post [Mode: 3]';
  121. node.nextSibling.setAttribute('style','color:#40f;background:#1110;border:1px solid #40f;text-align:left;:font-size:10px;');
  122.  
  123. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  124. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style','display:none;');
  125. //event.target.parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(https://i.imgur.com/ZL0LHeL.png); background-size: 38px 16px; background-repeat: no-repeat; display: block; height: 20px; width: 43px; background-position: 0px 0px !important; top: -1px;margin-left:0px;');
  126. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[2].setAttribute("style", "display:none;");
  127. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[3].setAttribute("style", "display:none;");
  128. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  129. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  130. }
  131. else {
  132.  
  133. node.nextSibling.value = 'Archived Post [Mode: 4]';
  134. node.nextSibling.setAttribute('style','color:#40f;background:#1110;border:1px solid #40f;text-align:left;:font-size:10px;');
  135. }
  136.  
  137. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #222; display:block; border:0px solid #222!important;");
  138. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: #222; display:block; border:0px solid #222!important;");
  139. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  140. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].childNodes[0].setAttribute("style", "border-bottom: 2px solid #0000;");
  141. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  142. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#222;");
  143. //if(!window.location.href.match(/\d/)) {};
  144. //node.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.children[1].children[2].children[1].children[0].children[0].children[1].children[1].children[0].children[0].children[0].children[2].setAttribute("style", "display:none;");
  145. //node.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.children[1].children[2].children[1].children[0].children[0].children[1].children[1].children[0].children[0].children[0].children[3].setAttribute("style", "display:none;");
  146. var iCaptureM3 = event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode;
  147. //setTimeout(function () {
  148. html2canvas(iCaptureM3, {useCORS: true, backgroundColor: '#222', logging: true, x: 336, y: 425, width: 509}).then(canvas => {
  149. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  150. var iNameGen = Math.random().toString(36).substring(2, 15);
  151. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  152. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  153. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  154. setTimeout(function () {
  155. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  156. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  157. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #2220;color: #86f;float: right;border: 1px solid #9990;');
  158. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base64';
  159. /* Likes Information (Show) */
  160. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  161. }, 0);
  162. });
  163. //}, 100);
  164. }
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174. else {
  175. console.log('URL is ' + window.location.href); console.log('Capturing statuses on this page is NOT supported! ');
  176. node.setAttribute("style", "color: #6666; border: 1px solid #8888; display:inline-block;");
  177. node.value = 'Coming Soon';
  178. }
  179.  
  180.  
  181.  
  182.  
  183. });
  184. })
  185. });
  186. /* — Insert Copy Text Button — */
  187. setMutationHandler({
  188. target: document.querySelector('._3576'),
  189. selector: '.copybtnP',
  190. handler: nodes => nodes.forEach(node => {
  191. node.setAttribute("style", "color:blue; border: 1px solid blue;");
  192. node.addEventListener('click', function (event) {
  193. var classCheck = document.getElementsByClassName('canvasArea');
  194. var status_content = event.target.closest("._1dwg._1w_m._q7o").childNodes[0].nextSibling.childNodes[0].nextSibling;
  195. console.log(event.target.parentNode.parentNode.nextSibling.nextSibling.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling.className);
  196. console.log(event.target.closest("._1dwg._1w_m._q7o").childNodes[0].nextSibling.childNodes[0].nextSibling.className);
  197. if (classCheck.length > 0) {
  198. status_content = event.target.previousSibling.previousSibling.previousSibling;
  199. }
  200. //alert(status_content + ' (Working)');
  201. //alert(event.target.previousSibling.innerText);
  202. getSelection().removeAllRanges();
  203. var range = document.createRange();
  204. range.selectNode(status_content);
  205. window.getSelection().addRange(range);
  206. try {
  207. var successful = document.execCommand('copy');
  208. var msg = successful ? 'successful' : 'unsuccessful';
  209. //console.log('Copying text command was ' + msg);
  210. } catch (err) {
  211. console.log('Oops, unable to copy');
  212. }
  213. return false;
  214. })
  215. })
  216. });
  217. /* — Gather Status Information — */
  218. var nodeCount = 0;
  219. var NumIncr = 0;
  220. setMutationHandler({
  221. target: document.querySelector('._3576'),
  222. selector: '._5pcq',
  223. processExisting: false,
  224. handler: nodes => nodes.forEach(node => {
  225. nodeCount++;
  226. /*console.log(nodeCount);*/
  227. node.setAttribute("style", "font-size:10.5px;position:reltive;top:-4px;letter-spacing:1px;color:#0e2;");
  228. /* Set a delay so script shows last */
  229. setTimeout(function () {
  230. if (!node.parentNode.innerHTML.match(/copybtnP"|s2img"/)) {
  231. //console.log('(' + NumIncr++ + ') ' + node.innerText);
  232. console.log(node.innerText);
  233. node.insertAdjacentHTML('afterend', '<input type="button" class="copybtnP" name="copyp" value="Copy Text"/>');
  234. node.insertAdjacentHTML('afterend', '<br><input type="button" class="s2img" name="s2img" value="Export Status"/>');
  235. }
  236. }, 0);
  237. })
  238. });
  239. setMutationHandler({
  240. target: document.querySelector('.fbPhotosPhotoCaption'),
  241. selector: '.hasCaption',
  242. handler: nodes => nodes.forEach(node => {
  243. node.style.color = '#f00';
  244. var PhotoCaption = document.getElementsByClassName('hasCaption')[0];
  245. console.log('Current Image: ' + PhotoCaption.innerText);
  246. if (!document.getElementsByClassName('fbPhotosPhotoCaption')[0].innerHTML.includes('copybtn"')) {
  247. PhotoCaption.insertAdjacentHTML('afterend', '<input type="button" class="copybtn" name="copy" value="Copy"/>');
  248. }
  249. var copyTextareaBtn = document.querySelector('.copybtn');
  250. copyTextareaBtn.addEventListener('click', function (event) {
  251. var copy_text = document.getElementsByClassName("hasCaption")[0];
  252. var range = document.createRange();
  253. range.selectNode(copy_text);
  254. window.getSelection().addRange(range);
  255. try {
  256. var successful = document.execCommand('copy');
  257. var msg = successful ? 'successful' : 'unsuccessful';
  258. console.log('Copying text command was ' + msg);
  259. } catch (err) {
  260. console.log('Oops, unable to copy');
  261. }
  262. });
  263. })
  264. });
  265.  
  266. function pad(n, width, z) {
  267. z = z || '0';
  268. n = n + '';
  269. return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
  270. }
  271.  
  272. function expandDates(e) {
  273. for (var t, a = 0; t = e[a++];) t.querySelector(".full-timestamp") || t.insertAdjacentHTML("beforeend", '<span class="full-timestamp"> on ' + moment(new Date(1e3 * t.dataset.utime)).format("l \\at LTS"))
  274. }
  275.  
  276. function RecentTimestamps(e) {
  277. for (var t, n = 0; t = e[n++];)
  278. if (!t.querySelector(".full-timestamp")) {
  279. if (1 == t.innerText.includes("min")) {
  280. var a = t.innerText.match(/[0-9]{1,2}/),
  281. s = parseInt(a, 10);
  282. t.insertAdjacentHTML("beforeend", '<span class="full-timestamp"> <span style="color:#365899">(' + moment(new Date).subtract(s, "minutes").format("h:mm:ss A") + ' ≃ <span style="color:#365899">ᴀᴘᴘʀᴏxɪᴍᴀᴛᴇ)</span><br>')
  283. }
  284. if (1 == t.innerText.includes("hr")) {
  285. var r = t.innerText.match(/[0-9]{1,2}/),
  286. m = parseInt(r, 10),
  287. o = 10 * parseInt(moment(new Date).format("mm") / 10, 10),
  288. l = 10 * parseInt(moment(new Date).format("ss") / 10, 10);
  289. t.insertAdjacentHTML("beforeend", '<span class="full-timestamp"> <span style="color:#365899">on ' + moment(new Date).subtract(m, "hours").format("l \\at h:") + pad(o, 2) + ":" + pad(l, 2) + '<span style="color:#365899"> ≃ (ᴀᴘᴘʀᴏxɪᴍᴀᴛᴇ)</span><br>')
  290. }
  291. }
  292. }
  293.  
  294. function RecentPostURLs(e) {
  295. if (e.parentNode) {
  296. for (var a = 0; a < e.length; a++) {
  297. var r = e[a];
  298. !1 === r.innerHTML.includes("<br>") && "_5r69" != r.className && (r.getElement, r.insertAdjacentHTML("afterend", '<br><span style="color:#9c9dc3">' + r.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling.href.replace(/\?fref=nf/, "").replace("&__tn__=", "").replace("&__tn__=m-R", "").replace("7%2Cdm-R-R", "").replace("%2Cdm-R-R", "").replace(/&eid=.+/, "").match(/facebook.com\/[a-z|A-Z|[0-9|\-|_|.]+.[a-zA-Z|[0-9|\-|_|.|]+[a-zA-Z|[0-9|\-|_|.|?=]+/) + "</span>"))
  299. }
  300. }
  301. }
  302.  
  303. function ExternalURLs(e) {
  304. for (var n = 0; n < e.length; n++) {
  305. var r = e[n],
  306. a = r.href.replace(/https:\/\/l\.facebook.com\/l.php\?u=/, "");
  307. !1 === r.innerHTML.includes("<br>") && "_5r69" != r.className && r.insertAdjacentHTML("afterend", '<span class="externalURLs">' + decodeURIComponent(a.replace(/\+/g, " ")).replace(/.fbclid=[\D}\d]+/, "").slice(0, 256) + "</span>")
  308. }
  309. }
  310.  
  311. function expandPostIDs(e) {
  312. for (var r = 0; r < e.length; r++) {
  313. var p = e[r];
  314. !1 === p.innerHTML.includes("<br>") && "_5pcq" === p.className && p.insertAdjacentHTML("beforeend", "<br>" + p.href.replace(/(\?__xts__%.+|\/\?type=\d&__xts__%.+)/gm, "").replace("permalink.php?", "&nbsp;permalink.php?").replace("/groups/", "Group: ").replace("/permalink/", "<br>Post ID: ").slice(24, 100).replace("/", ""))
  315. }
  316. }