Advertisement
Guest User

t1 scraper

a guest
Jul 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function (c, a) //usage t:#s.username.target, page:"0"
  2. {
  3.     var curr_args={}
  4.    
  5.     var reCnD=/(?:access directory with )(\w+):\"(\w+)/ //Gets the command && directory
  6.     var results=a.t.call(curr_args) //Call with empty arguments
  7.     var matches=reCnD.exec(results) //Uses the regex to find matches in the string
  8.     var cmd=matches[1] //matches[1]=first capturing group
  9.     var dir=matches[2] //matches [2]=second capturing group
  10.    
  11.     var reNnM=/(?:from engaging in criminal activity\.\n)(\w+) \| (\w+)/ //Gets the names of the news page and the mission statement page
  12.     results=a.t.call() //Call with no arguments
  13.     matches=reNnM.exec(results) //Uses the regex to find matches in the string
  14.     var nws=matches[1] //matches[1]=first capturing group
  15.     var mss=matches[2]//matches [2]=second capturing group
  16.    
  17.     curr_args[cmd]=nws //Changes current arguments to be {<command to open stuff>:"<name of news page>"}
  18.    
  19.     var rePr=/(?:project |Look for |new developments on |Work continues on |release date for )([\w\d()]+\.?[\w\d()]+)/g //Gets project names
  20.     results=a.t.call(curr_args)
  21.     matches=rePr.exec(results) //Gets the first match if one exists, has value null if one doesn't
  22.    
  23.     var projects=[] //Initializes array to store projects
  24.     while (matches!=null) //While there still is a match...
  25.     {
  26.         projects.push(matches[1]) //Throw that match onto the pile
  27.         matches=rePr.exec(results) //And try to find another one; plurals are used even though there is only one because I'm too lazy to delare a new variable
  28.     }
  29.  
  30.     projects=projects.slice(a.page*40,a.page*40+40) //Cut it up into a slice of fourty; different values of i give different slices
  31.  
  32.     curr_args[cmd]=mss //Changes current arguments to be {<command to open stuff>:"<name of mission statement page>"}
  33.  
  34.     var regPW=/(?:tegy )(\S+)/ //Matches the name of the strategy, which also happens to be the password for the directory
  35.     var password=regPW.exec(a.t.call(curr_args))[1] //Grabs the password; [1] at the end follows same logic as above
  36.     curr_args["p"]=password //Changes current args so that it contains {...,p:<password we obtained>,...}
  37.     curr_args["pass"]=password
  38.     curr_args["password"]=password
  39.    
  40.     curr_args[cmd]=dir
  41.    
  42.     var locs=[]
  43.     for (var project in projects) { //Note that we declare project inside the parentheses
  44.         curr_args["project"]=projects[project] //Look at a new project
  45.         results=a.t.call(curr_args) //Call target with new arguments
  46.        
  47.         if (typeof(results) == "string")
  48.         {
  49.             results = results.split("\n")
  50.         }
  51.        
  52.         locs.push(results) //Put the results in the loc array
  53.     }
  54.     return locs //Return loc array
  55.    
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement