daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. javascript:
  2. function fail(){
  3. alert("You must be on the right page!");
  4. }
  5. function copy(id){
  6. var b=document.createElement("textarea"),c=document.getSelection();
  7. b.textContent=id,document.body.appendChild(b),c.removeAllRanges(),b.select(),document.execCommand("copy"),c.removeAllRanges(),document.body.removeChild(b)
  8. };
  9. function getMe(){
  10.     try{
  11.         var id = encodeURIComponent(require("TimelineController").getProfileID());
  12.         if(id!="null") return id;
  13.         else return "0";
  14.     }
  15.     catch (e){
  16.         return "0";
  17.     }
  18. }
  19. function getGroup(){
  20.     try{
  21.         var id = encodeURIComponent(require('ScriptPath').getSourcePageInfo().extraData.entity_id);
  22.         if(id!="null") return id;
  23.         else return "0";
  24.     }
  25.     catch (e){
  26.         return "0";
  27.     }
  28. }
  29. function getPage(){
  30.     try{
  31.         var id = encodeURIComponent(require("CurrentPage").getID());
  32.         if(id!="null") return id;
  33.         else return "0";
  34.     }
  35.     catch (e){
  36.         return "0";
  37.     }
  38. }
  39.  
  40. var id = getMe();
  41. if(id=="0"){
  42.     id = getGroup();
  43.     if(id=="0"){
  44.         id = getPage();
  45.     }
  46. }
  47. console.log(id);
  48. if(id!="0"){
  49.     copy(id);
  50. }
  51. else{
  52.     fail();
  53. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top