PageRenderTime 51ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/site/importer/includes/service.php

https://bitbucket.org/kaerast/ppl
PHP | 730 lines | 562 code | 124 blank | 44 comment | 13 complexity | ebf4950935d44f9bbcab2f160bfaff31 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0
  1. <?php
  2. //loader for each network
  3. // Version 5.8
  4. if ($service == "emailit"){
  5. //--------------------------------------------------------------EMAILIT.COM-------------------------------------------------------------------
  6. $display_array = array();
  7. list($username,$domain) = split('@',$username);
  8. $refering_site = "http://mail.google.com/mail/";//setting the site for refer
  9. $browser_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7";//setting browser type
  10. $mycookie = $username.'.cookie';
  11. $fh = fopen($mycookie,'w');
  12. fclose($fh);
  13. $path_to_cookie = realpath("$mycookie");
  14. $setcookie = fopen($path_to_cookie,'wb');//this opens the file and resets it to zero length
  15. fclose($setcookie);
  16. //---------------------------------------------------STEP 1
  17. $url = "http://email.it/";
  18. $page_result = curl_get($url,1,0);
  19. //---------------------------------------------------STEP 2
  20. $url = 'http://wm.email.it/webmail/wm_5/login.php?action=login';
  21. $postal_data = 'f_user='.$username.'&f_pass='.$password.'&LOGIN='.$username.
  22. '&PASSWD='.$password.'&Act_Login.x=18&Act_Login.y=6&Act_Login=Ok';
  23. $result = curl_post($url,$postal_data,1,0);
  24. preg_match_all('/frame src="menu.php.(.*?)"/',$result,$matches,
  25. PREG_PATTERN_ORDER);
  26. $matches = $matches[1][0];
  27. //---------------------------------------------------STEP 3
  28. $url = 'http://wm.email.it/webmail/wm_5/addressbook.php?startp=1&'.$matches.
  29. '&folde=&prem=undefined';
  30. $result = curl_get($url,1,0);
  31. preg_match_all('/function print_abook\(\) { window.open\(\'addressbook.php(.*?)\',/',
  32. $result,$matches,PREG_PATTERN_ORDER);
  33. $matches = $matches[1][0];
  34. //---------------------------------------------------STEP 1
  35. $url = 'http://wm.email.it/webmail/wm_5/quick_address.php'.$matches;
  36. $result = curl_get($url,1,0);
  37. preg_match_all('/<option value="(.*?)">.[a-zA-Z0-9]*&nbsp;&lt;(.*?)&gt;/',$result,
  38. $matches,PREG_PATTERN_ORDER);
  39. //print_r($matches);
  40. @unlink ($path_to_cookie);
  41. //------------------------------------------------------------------EMAILIT - END -----------------------------------------------------------------
  42. }
  43. if ($service == "gmail"){
  44. //------------------------------------------------------------------ GMAIL START -----------------------------------------------------------------
  45. $display_array = array();
  46. $refering_site = "http://mail.google.com/mail/";//setting the site for refer
  47. $browser_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7";//setting browser type
  48. $mycookie = $username.'.cookie';
  49. $fh = fopen($mycookie,'w');
  50. fclose($fh);
  51. $path_to_cookie = realpath("$mycookie");
  52. $setcookie = fopen($path_to_cookie,'wb');//this opens the file and resets it to zero length
  53. fclose($setcookie);
  54. //---------------------------------------------------STEP 1
  55. $url = "http://mail.google.com/mail/";
  56. $page_result = curl_get($url,1,0);
  57. //---------------------------------------------------STEP 2
  58. $postal_data = "ltmpl=yj_blanco&ltmplcache=2&continue=http%3A%2F%2Fmail.google.com%2Fmail%3F&service=mail&rm=false&ltmpl=yj_blanco&Email=".
  59. $username."&Passwd=".$password."&rmShown=1&null=Sign+in";
  60. $url = 'https://www.google.com/accounts/ServiceLoginAuth';
  61. $result = curl_post($url,$postal_data,1,0);
  62. // [pick up forwarding url]
  63. preg_match_all("/location.replace.\"(.*?)\"/",$result,$matches);
  64. $matches = $matches[1][0];
  65. //---------------------------------------------------STEP 3
  66. $url = $matches;
  67. $result = curl_get($url,1,0);
  68. //---------------------------------------------------STEP 4 - html only
  69. $url = 'https://mail.google.com/mail/?ui=html&zy=e';
  70. $result = curl_get($url,1,0);
  71. //---------------------------------------------------STEP 5 - open export contacts page
  72. $url = 'https://mail.google.com/mail/?ui=1&ik=&view=sec&zx=';
  73. $result = curl_get($url,1,0);
  74. preg_match_all("/value=\"(.*?)\"/",$result,$matches);
  75. $matches = $matches[1][0];
  76. //echo $matches;
  77. //---------------------------------------------------STEP 6 - download csv
  78. $postal_data = 'at='.$matches.'&ecf=g&ac=Export Contacts';
  79. $url = 'https://mail.google.com/mail/?ui=1&view=fec';
  80. $result = curl_post($url,$postal_data,1,0);
  81. @unlink ($path_to_cookie);
  82. //------------------------------------------------------------------GMAIL - END -----------------------------------------------------------------
  83. }
  84. if ($service == 'hotmail'){
  85. //------------------------------------------------------------------HOTMAIL START -----------------------------------------------------------------
  86. $display_array = array();
  87. $refering_site = "https://mid.live.com/si/login.aspx"; //setting the site for refer
  88. $browser_agent = "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320)"; //setting browser type
  89. $mycookie = $username.'.cookie';
  90. $fh = fopen($mycookie,'w');
  91. fclose($fh);
  92. $path_to_cookie = realpath("$mycookie");
  93. $setcookie = fopen($path_to_cookie,'wb');//this opens the file and resets it to zero length
  94. fclose($setcookie);
  95. //---------------------------------------------------STEP 1
  96. $url = "https://mid.live.com/si/login.aspx";
  97. $result =curl_get($url,1,0);
  98. preg_match('/action="(.*?)"/', $result, $regx);
  99. $part_url = $regx[1];
  100. //---------------------------------------------------STEP 2 - redirect
  101. $url = 'https://mid.live.com/si/'.$part_url;
  102. $postal_data ='__EVENTTARGET=&__EVENTARGUMENT=&LoginTextBox='.$username.'&DomainField=3&PasswordTextBox='.$password.'&PasswordSubmit=Sign+in';
  103. $result =curl_post($url,$postal_data,1,0);
  104. preg_match('/url=(.*?)"/', $result, $regx);
  105. $url = $regx[1];
  106. //---------------------------------------------------STEP 3 - redirect
  107. $result =curl_get($url,1,0);
  108. preg_match('/url=(.*?)"/', $result, $regx);
  109. $url = $regx[1];
  110. //---------------------------------------------------STEP 4 - redirect
  111. $result =curl_get($url,1,0);
  112. //---------------------------------------------------STEP 5 - load people page (loop through 5 pages)
  113. for ($count = 0; $count <= 120; $count += 40){
  114. $url = 'http://mobile.live.com/hm/contacts.aspx?bf=0&ts=1&c=to&i='.$count;
  115. $result_1 =curl_get($url,1,0);
  116. $result = $result.$result_1;
  117. }
  118. @unlink ($path_to_cookie);
  119. //------------------------------------------------------------------HOTMAIL - END -----------------------------------------------------------------
  120. }
  121. if ($service == "icq"){
  122. //------------------------------------------------------------------ICQ START -----------------------------------------------------------------
  123. $display_array = array();
  124. list($username,$domain)=split('@',$username);
  125. $refering_site = "http://icqmail.com"; //setting the site for refer
  126. $browser_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7"; //setting browser type
  127. $mycookie = $username.'.cookie';
  128. $fh = fopen($mycookie,'w');
  129. fclose($fh);
  130. $path_to_cookie = realpath("$mycookie");
  131. $setcookie = fopen($path_to_cookie,'wb');//this opens the file and resets it to zero length
  132. fclose($setcookie);
  133. //---------------------------------------------------STEP 1
  134. $url = "http://www.icqmail.com/";
  135. $page_result =curl_get($url,1,0);
  136. //---------------------------------------------------STEP 2
  137. $postal_data ='faction=login&domain=icqmail.com&username='.$username.'&password='.$password;
  138. $url = 'http://www.icqmail.com/default.asp';
  139. $result =curl_post($url,$postal_data,1,0);
  140. // [pick up forwarding url]
  141. preg_match_all("/url=\/(.*?)\"/", $result, $matches);
  142. $matches = $matches[1][0];
  143. //---------------------------------------------------STEP 3
  144. $url = 'http://www.icqmail.com/'.$matches;
  145. $result =curl_get($url,1,0);
  146. //---------------------------------------------------STEP 4 - html only
  147. $url = 'http://www.icqmail.com/js/nojs.asp?skipjs=1';
  148. $result =curl_get($url,1,0);
  149. // CHECKING IF LOGIN WAS SUCCESSFUL - by search of the @ sign in the csv
  150. preg_match_all("/ICQ Password/",$result,$array_at);
  151. $at_sign = $array_at[0];
  152. if (!empty($at_sign)) {
  153. $show = 1;
  154. $error_message = "No contacts found - check your login details and try again";
  155. }
  156. else {
  157. $url = 'http://www.icqmail.com/contacts/contacts_import_export.asp?action=export&app=Microsoft%20Outlook';
  158. $result =curl_get($url,1,0);
  159. $matches = 1;
  160. }
  161. @unlink ($path_to_cookie);
  162. //------------------------------------------------------------------ICQ - END -----------------------------------------------------------------
  163. }
  164. if ($service =="indiatimes"){
  165. //------------------------------------------------------------------INDIATIME START -----------------------------------------------------------------
  166. $display_array = array();
  167. list($myusername,$domain) = split('@',$username);
  168. $username = $myusername;
  169. $refering_site = "http://mail.lycos.com/lycos/Index.lycos";//setting the site for refer
  170. $browser_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";//setting browser type
  171. $mycookie = $username.'.cookie';
  172. $fh = fopen($mycookie,'w');
  173. fclose($fh);
  174. $path_to_cookie = realpath("$mycookie");
  175. $setcookie = fopen($path_to_cookie,'wb');//this opens the file and resets it to zero length
  176. fclose($setcookie);
  177. //---------------------------------------------------STEP 1
  178. $url = "http://infinite.indiatimes.com/";
  179. $page_result = curl_get($url,1,0);
  180. preg_match_all('%action="http://(.*?)"%',$page_result,$matches);
  181. $posturl = $matches[1][0];
  182. //echo $posturl;
  183. //---------------------------------------------------STEP 2
  184. $postal_data = 'login='.$username.'&passwd='.$password.'&Sign+in.x=29&Sign+in.y=7';
  185. $url = 'http://'.$posturl;
  186. $result = curl_post($url,$postal_data,1,2);
  187. //------------------------------------------------------get contacts
  188. $url = 'http://mb.indiatimes.com/home/'.$username.'/Contacts.csv';
  189. $result = curl_get($url,1,2);
  190. @unlink ($path_to_cookie);
  191. //------------------------------------------------------------------INDIATIMES - END -----------------------------------------------------------------
  192. }
  193. if ($service == "katamail"){
  194. //------------------------------------------------------------------KATAMAIL START -----------------------------------------------------------------
  195. $display_array = array();
  196. list($username,$domain) = split('@',$username);
  197. $refering_site = "http://mail.google.com/mail/";//setting the site for refer
  198. $browser_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7";//setting browser type
  199. $mycookie = $username.'.cookie';
  200. $fh = fopen($mycookie,'w');
  201. fclose($fh);
  202. $path_to_cookie = realpath("$mycookie");
  203. $setcookie = fopen($path_to_cookie,'wb');//this opens the file and resets it to zero length
  204. fclose($setcookie);
  205. //---------------------------------------------------STEP 1
  206. $url = "http://www.kataweb.it/";
  207. $page_result = curl_get($url,1,0);
  208. //---------------------------------------------------STEP 2
  209. $postal_data = 'frames=no&lang=it_IT&domain=katamail.com&login='.$username.
  210. '&passwd='.$password;
  211. $url = 'http://webmail.katamail.com/cgi-bin/wm/start';
  212. $result = curl_post($url,$postal_data,1,0);
  213. //---------------------------------------------------STEP 3
  214. $url = 'http://webmail.katamail.com/cgi-bin/wm/listaddr?lang=it_IT';
  215. $result = curl_get($url,1,0);
  216. preg_match_all('/friendA" value=\'%22(.*?)%20.*%3c(.*?)%/',$result,$matches,
  217. PREG_PATTERN_ORDER);
  218. @unlink ($path_to_cookie);
  219. //------------------------------------------------------------------KATAMAIL END -----------------------------------------------------------------
  220. }
  221. if ($service == "lycos"){
  222. //------------------------------------------------------------------LYCOS START -----------------------------------------------------------------
  223. $display_array = array();
  224. $refering_site = "http://mail.lycos.com/lycos/Index.lycos"; //setting the site for refer
  225. $browser_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; //setting browser type
  226. $mycookie = $username.'.cookie';
  227. $fh = fopen($mycookie,'w');
  228. fclose($fh);
  229. $path_to_cookie = realpath("$mycookie");
  230. $setcookie = fopen($path_to_cookie,'wb');//this opens the file and resets it to zero length
  231. fclose($setcookie);
  232. list($myusername,$domain) = split('@',$username);
  233. //Load Lycons.com
  234. if($domain == 'lycos.com'){
  235. //---------------------------------------------------STEP 1
  236. $url = "http://mail.lycos.com/lycos/mail/MailLeftLogin.lycos";
  237. $page_result =curl_get($url,1,0);
  238. //---------------------------------------------------STEP 2
  239. $postal_data = 'm_PR=27&m_CBURL=http://mail.lycos.com&m_U='.$myusername.'&m_P='.$password.'&m_AS=1&x=42&y=8';
  240. $url = "https://registration.lycos.com/login.php?m_PR=27";
  241. $result =curl_post($url,$postal_data,1,0);
  242. //---------------------------------------------------STEP 3
  243. $url = "http://mail.lycos.com/lycos/addrbook/ExportAddr.lycos?ptype=act&fileType=OUTLOOK";
  244. $result =curl_get($url,1,0);
  245. @unlink ($path_to_cookie);
  246. //Load Lycos.co.uk
  247. }else{
  248. $url = "http://secure.mail.lycos.co.uk/services/signin/mail.jsp";
  249. $page_result =curl_get($url,1,0);
  250. //---------------------------------------------------STEP 2
  251. $postal_data = 'login='.$username.'&hiddenlogin=Username&hiddenpassword=******&password='.$password;
  252. $url = "http://secure.mail.lycos.co.uk/lsu/signin/action.jsp";
  253. $result =curl_post($url,$postal_data,1,0);
  254. $url = "http://f012.mail.lycos.co.uk/lsu/signin/cookie.jsp?proxy=";
  255. $result =curl_get($url,1,0);
  256. $url = "http://f012.mail.lycos.co.uk/app/home/home.jsp";
  257. $result =curl_get($url,1,0);
  258. $url = "http://f012.mail.lycos.co.uk/app/msg/mail/compose/view.jsp?act=112";
  259. $result =curl_get($url,1,0);
  260. }
  261. //------------------------------------------------------------------LYCOS END -----------------------------------------------------------------
  262. }
  263. if ($service == "mail"){
  264. //------------------------------------------------------------------MAIL START -----------------------------------------------------------------
  265. $display_array = array();
  266. $refering_site = "http://mail.com/"; //setting the site for refer
  267. $browser_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; //setting browser type
  268. $mycookie = $username.'.cookie';
  269. $fh = fopen($mycookie,'w');
  270. fclose($fh);
  271. $path_to_cookie = realpath("$mycookie");
  272. $setcookie = fopen($path_to_cookie,'wb');//this opens the file and resets it to zero length
  273. fclose($setcookie);
  274. //---------------------------------------------------STEP 1
  275. $url = "http://www.mail.com";
  276. $page_result =curl_get($url,1,0);
  277. //---------------------------------------------------STEP 2
  278. $postal_data='login='.$username.'&password='.$password.'&redirlogin=1&siteselected=normal';
  279. $url = 'http://www2.mail.com/scripts/common/proxy.main?signin=1&lang=us';
  280. $result =curl_post($url,$postal_data,1,0);
  281. preg_match_all("/url=(.*?)\/templates/", $result, $matches);
  282. $base = $matches[1][0];
  283. //---------------------------------------------------STEP 1
  284. $url = $base.'/scripts/addr/addressbook.cgi?showaddressbook=1';
  285. $page_result =curl_get($url,1,0);
  286. preg_match_all("/ob=(.*?)&gab=1/", $page_result, $matches);
  287. $ob = $matches[1][0];
  288. //---------------------------------------------------STEP 1
  289. $url = $base.'/scripts/addr/external.cgi?.ob='.$ob.'&gab=1';
  290. $page_result =curl_get($url,1,0);
  291. //---------------------------------------------------STEP 2
  292. $postal_data ='showexport=showexport&action=export&format=csv';
  293. $url = $base.'/scripts/addr/external.cgi?.ob='.$ob.'&gab=1';
  294. $result =curl_post($url,$postal_data,1,0);
  295. @unlink ($path_to_cookie);
  296. //------------------------------------------------------------------MAIL END -----------------------------------------------------------------
  297. }
  298. if ($service == "rediffmail"){
  299. //------------------------------------------------------------------REDIFF START-----------------------------------------------------------------
  300. $display_array = array();
  301. list($username,$domain) = split('@',$username);
  302. $refering_site = "http://yahoo.com/";//setting the site for refer
  303. $browser_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";//setting browser type
  304. $mycookie = $username.'.cookie';
  305. $fh = fopen($mycookie,'w');
  306. fclose($fh);
  307. $path_to_cookie = realpath("$mycookie");
  308. $setcookie = fopen($path_to_cookie,'wb');//this opens the file and resets it to zero length
  309. fclose($setcookie);
  310. //---------------------------------------------------start
  311. $url = "http://www.rediff.com";
  312. $page_result = curl_get($url,1,0);
  313. //---------------------------------------------------login
  314. $url = 'http://mail.rediff.com/cgi-bin/login.cgi';
  315. $postdata = 'login='.$username.'&passwd='.$password.'&FormName=existing';
  316. $result = curl_post($url,$postdata,1,0);
  317. preg_match('/url=(.*?)"/', $result, $regs);
  318. $matches = $regs[1];
  319. //---------------------------------------------------redirect and get unique id
  320. $url = $matches;
  321. $result = curl_get($url,1,0);
  322. //get sessions id
  323. preg_match_all('/&session_id=(.*?)&/', $result, $regs);
  324. $matches = $regs[1][1];
  325. //get server address
  326. preg_match_all('%HREF="(.*?)/bn%', $result, $regs2);
  327. $matches2 = $regs2[1][1];
  328. //---------------------------------------------------load iframes address list
  329. $url=$matches2.'/bn/address.cgi?login='.$username.'&FormName=export&session_id='.$matches.'&FormName=group_book';
  330. $result = curl_get($url,1,0);
  331. //------------------------------------------------------------------REDIFF END-----------------------------------------------------------------
  332. }
  333. if ($service == "yahoo"){
  334. //------------------------------------------------------------------YAHOO START-----------------------------------------------------------------
  335. $display_array = array();
  336. $refering_site = "http://yahoo.com/"; //setting the site for refer
  337. $browser_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; //setting browser type
  338. $mycookie = $username.'.cookie';
  339. $fh = fopen($mycookie,'w');
  340. fclose($fh);
  341. $path_to_cookie = realpath("$mycookie");
  342. $setcookie = fopen($path_to_cookie,'wb');//this opens the file and resets it to zero length
  343. fclose($setcookie);
  344. //---------------------------------------------------STEP 1
  345. $url = "https://login.yahoo.com/config/mail?.intl=us";
  346. $page_result =curl_get($url,1,0);
  347. preg_match_all("/name=\".tries\" value=\"(.*?)\"/", $page_result, $tries);
  348. $tries_found = $tries[1][0];
  349. preg_match_all("/name=\".src\" value=\"(.*?)\"/", $page_result, $src);
  350. $src_found = $src[1][0];
  351. preg_match_all("/name=\".u\" value=\"(.*?)\"/", $page_result, $u);
  352. $u_found = $u[1][0];
  353. preg_match_all("/name=\".v\" value=\"(.*?)\"/", $page_result, $v);
  354. $v_found = $v[1][0];
  355. preg_match_all("/name=\".challenge\" value=\"(.*?)\"/", $page_result, $challenge);
  356. $challenge_found = $challenge[1][0];
  357. //---------------------------------------------------STEP 2 - submit login info
  358. $postal_data ='.tries='.$tries_found.'&.src='.$src_found.'&.md5=&.hash=&.js=&.last=&promo=&.intl=us&.bypass=&.partner=&.u=6bu841h2d7p4o&.v=0&.challenge='.$challenge_found.'&.yplus=&.emailCode=&pkg=&stepid=&.ev=&hasMsgr=1&.chkP=Y&.done=http://mail.yahoo.com&.pd=ym_ver%253d0&login='.$username.'&passwd='.$password;
  359. $url = 'https://login.yahoo.com/config/login?';
  360. $result =curl_post($url,$postal_data,1,0);
  361. preg_match_all("/replace\(\"(.*?)\"/", $result, $matches);
  362. $matches = $matches[1][0];
  363. //---------------------------------------------------STEP 3 - Redirect
  364. $url = $matches;
  365. $result =curl_get($url,1,0);
  366. //---------------------------------------------------STEP 4 - Redirect
  367. $url = 'http://us.rd.yahoo.com/mail_us/pimnav/ab/*http://address.mail.yahoo.com';
  368. $result =curl_get($url,1,0);
  369. //---------------------------------------------------STEP 5 - Open address book
  370. $url = 'http://address.mail.yahoo.com';
  371. $result =curl_get($url,1,0);
  372. preg_match_all("/rand=(.*?)\"/", $result, $array_names);
  373. $rand_value = str_replace('"', '', $array_names[0][0]);
  374. //---------------------------------------------------STEP 6 - Export address book
  375. $url = 'http://address.mail.yahoo.com/?1&VPC=import_export&A=B&.rand='.$randURL;
  376. $result =curl_get($url,1,0);
  377. preg_match_all("/id=\"crumb1\" value=\"(.*?)\"/", $result, $array_names);
  378. $matches = $array_names[1][0];
  379. //---------------------------------------------------STEP 7 - Checking if address book is empty
  380. IF (empty($matches)){
  381. $show = 1;
  382. $error_message = "No contacts found - check your login details and try again";
  383. }ELSE{
  384. //---------------------------------------------------STEP 8 - submit login info
  385. $postal_data ='.crumb='.$matches.'&VPC=import_export&A=B&submit%5Baction_export_yahoo%5D=Export+Now';
  386. $url = 'http://address.mail.yahoo.com/index.php';
  387. $result =curl_post($url,$postal_data,1,0);
  388. $matches = 1;
  389. }
  390. @unlink ($path_to_cookie);
  391. //------------------------------------------------------------------YAHOO END-----------------------------------------------------------------
  392. }
  393. if ($service == "fastmail"){
  394. //------------------------------------------------------------------FASTMAIL START-----------------------------------------------------------------
  395. $display_array = array();
  396. $refering_site = "http://fastmail.com/";//setting the site for refer
  397. $browser_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";//setting browser type
  398. $mycookie = $username.'.cookie';
  399. $fh = fopen($mycookie,'w');
  400. fclose($fh);
  401. $path_to_cookie = realpath("$mycookie");
  402. $setcookie = fopen($path_to_cookie,'wb');//this opens the file and resets it to zero length
  403. fclose($setcookie);
  404. //---------------------------------------------------1
  405. $url = "http://fastmail.fm";
  406. $page_result = curl_get($url,1,0);
  407. preg_match('/name="memail" action="(.*?)"/', $page_result, $regs);
  408. $result = $regs[1];
  409. //---------------------------------------------------2
  410. $url = $result;
  411. $postdata = 'MLS=LN-*&FLN-UserName='.$username.'&FLN-Password='.$password.'&MSignal_LN-AU*=Login&FLN-ScreenSize=-1';
  412. $page_result = curl_post($url,$postdata,1,0);
  413. preg_match('/content="0;url=(.*?)"/', $page_result, $regs);
  414. $result = $regs[1];
  415. preg_match('/Ust=(.*?)&MSignal/', $page_result, $regs2);
  416. $result2 = $regs2[1];
  417. //---------------------------------------------------3
  418. $url = 'http://fastmail.fm/mail/?Ust='.$result2;
  419. $postdata = 'MLS=UA-*&SAD-AL-SF=DN3_0&MSS=!AD-*&SAD-AL-DR=20&SAD-AL-TP=0&SAD-AL-SpecialSortBy=SNM:0&_charset_=ISO-8859-1&FUA-Group=0&FUA-DownloadFormat=OL&MSignal_UA-Download*=Download';
  420. $result = curl_post($url,$postdata,1,0);
  421. //------------------------------------------------------------------Fastmail END-----------------------------------------------------------------
  422. }
  423. if ($service == "rambler"){
  424. //------------------------------------------------------------------MAIL.RU START-----------------------------------------------------------------
  425. $display_array = array();
  426. $refering_site = "http://rambler.ru/";//setting the site for refer
  427. list($username,$domain) = split('@',$username);
  428. $browser_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";//setting browser type
  429. $mycookie = $username.'.cookie';
  430. $fh = fopen($mycookie,'w');
  431. fclose($fh);
  432. $path_to_cookie = realpath("$mycookie");
  433. $setcookie = fopen($path_to_cookie,'wb');//this opens the file and resets it to zero length
  434. fclose($setcookie);
  435. //---------------------------------------------------1
  436. $url = "http://rambler.ru";
  437. $page_result = curl_get($url,1,0);
  438. //---------------------------------------------------2
  439. $url = 'http://mail.rambler.ru/script/auth.cgi';
  440. $postdata = 'domain=rambler.ru&url=7&login='.$username.'&passw='.$password.'&long_session=on';
  441. $page_result = curl_post($url,$postdata,1,0);
  442. //---------------------------------------------------3
  443. $url = 'http://mail.rambler.ru/mail/contacts.cgi?mode=popup;1e59';
  444. $page_result = curl_get($url,1,0);
  445. preg_match_all("/add_email\(\'(.*?)&lt;(.*?)&gt;/", $page_result, $matches, PREG_SET_ORDER);
  446. @unlink ($path_to_cookie);
  447. //------------------------------------------------------------------MAIL.RU END-----------------------------------------------------------------
  448. }
  449. ?>