SHARE
TWEET

getPostLink

tambascot Jun 9th, 2016 (edited) 5 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * getPostLink
  3.  *
  4.  * Get a direct link to your facebook posts by parsing "embed post" code.
  5.  */
  6.  
  7. function getPostLink(textBlock) {
  8.   this.textBlock = textBlock;
  9.   var substring1 = textBlock.split("?");
  10.   var substring2 = substring1[1].split("&");
  11.     var substring3 = substring2[0].replace("href=", "");
  12.   var substring4 = substring3.replace(/%3A/g, ":");
  13.   var substring5 = substring4.replace(/%2F/g, "/");
  14.    
  15.  
  16.   return substring5;
  17. }
RAW Paste Data
Top