function InviteGr(id, gid, sid: string): string; var HTTP : TidHTTP; hash : string; Temp : string; Page : TStringList; Post : TStringList; Cook : TidCookieManager; I : Integer; begin HTTP := TidHTTP.Create(nil); Cook := TidCookieManager.Create(nil); Page := TStringList.Create; Cook.AddCookie('remixsid=' + sid, 'vkontakte.ru'); Cook.AddCookie('remixchk=5;', 'vkontakte.ru'); Cook.AddCookie('remixclosed_tabs=0;', 'vkontakte.ru'); Cook.AddCookie('remixlang=0;', 'vkontakte.ru'); Cook.AddCookie('remixgroup_closed_tabs=0;', 'vkontakte.ru'); Cook.AddCookie('audio_vol=52', 'vkontakte.ru'); HTTP.Request.Referer := 'http://vkontakte.ru/club' + gid; HTTP.Request.UserAgent := 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2) Gecko/20100115 MRA 5.6 (build 03278) Firefox/3.6 sputnik 2.1.0.18'; HTTP.Request.Accept := 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'; HTTP.Request.AcceptLanguage := 'ru,en-us;q=0.7,en;q=0.3'; HTTP.Request.Connection := 'keep-alive'; HTTP.Request.ContentType := 'application/x-www-form-urlencoded; charset=UTF-8'; HTTP.Request.Pragma := 'no-cache'; HTTP.Request.CacheControl := 'no-cache'; HTTP.Request.Host := 'vkontakte.ru'; HTTP.Request.AcceptCharSet := 'windows-1251,utf-8;q=0.7,*;q=0.7'; HTTP.Request.CustomHeaders.Add('X-Requested-With: XMLHttpRequest'); HTTP.CookieManager := Cook; HTTP.AllowCookies := True; HTTP.HandleRedirects := True; Page.Text := HTTP.Get('http://vkontakte.ru/club' + gid); for I := 0 to Page.Count -1 do begin If Pos('act=a_invite_friends', Page[i]) <> 0 Then begin hash := Page[i]; ShowMessage(hash); hash := Copy(hash, Pos('decodehash', hash) +12, Length(hash)); Delete(hash, Pos(#39, hash), Length(hash)); end; end; Post := TStringList.Create; Post.Add('friends=' + id); Post.Add('gid=' + gid); Post.Add('hash=' + DecodeHash(hash)); Temp := HTTP.Post('http://vkontakte.ru/groups_ajax.php?act=a_invite_friends', Post); Post.Free; Page.Free; Http.Free; Cook.Free; end;