Advertisement
Guest User

дебил-функция

a guest
Apr 8th, 2012
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.42 KB | None | 0 0
  1. Auth_in_API_3(no_show_Auth_in_API_3="")
  2. {
  3.     global
  4.     Static  otvet,post,url,hash,reconn_data,location
  5.    
  6.     if(no_show_Auth_in_API_3="")
  7.     {
  8.         TrayTip("Auth in API","Please wait")
  9.     }
  10.        
  11.         url:="http://oauth.vk.com/authorize?client_id=2274003&response_type=token&redirect_uri=http://api.vk.com/blank.html&_hash=0"
  12.         http_%os%(otvet:="",url)
  13.        
  14.         ip_h:=RegexReplace(otvet, ".*ip_h' value='(.*?)'.*", "$1")
  15.         to:=RegexReplace(otvet, ".*to' value='(.*?)'.*", "$1")
  16.                  
  17.                 // ну а если произошла какая либо ошибка (не спарсился или не нашелся например ip_h
  18.                 // мы все равно шлем дальше запросы. мы же в танке.
  19.        
  20.         url:="https://login.vk.com/?act=login&soft=1"
  21.         post:="q=1&ip_h=" ip_h "&from_host=api.vk.com&to=" to "&expire=0&email=" UrlEncode(mail) "&pass=" UrlEncode(pass)
  22.         reconn_data:=http_%os%(otvet:="",url,post) 
  23.  
  24.  
  25.  
  26.         location:=RegexReplace(reconn_data, ".*Location: (.*?)`n.*", "$1")
  27.         reconn_data:=http_%os%(otvet:="",location)
  28.         cookie:="cookie: remixsid=" . RegexReplace(reconn_data, ".*remixsid=(.*?);.*", "$1") . "; remixap=1; remixchk=5"
  29.    
  30.        
  31.         location:=parse(otvet,"ocation.href = '","'")
  32.         reconn_data:=http_%os%(otvet:="",location,"",cookie)           
  33.        
  34.         api_token:=parse(reconn_data,"access_token=","&")
  35.         iphone_mid:=parse(reconn_data,"user_id=","`n")
  36.        
  37. TrayTip()
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement