Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Szukanie tekstu w zawartości strony
marcinpruciak
post
Post #1





Grupa: Zarejestrowani
Postów: 161
Pomógł: 9
Dołączył: 14.07.2008

Ostrzeżenie: (0%)
-----


Mam taki kod:

  1. <?
  2. function get_content($url)
  3. {
  4.     $ch = curl_init();
  5.  
  6.     curl_setopt ($ch, CURLOPT_URL, $url);
  7.     curl_setopt ($ch, CURLOPT_HEADER, 0);
  8.  
  9.     ob_start();
  10.  
  11.     curl_exec ($ch);
  12.     curl_close ($ch);
  13.     $string = ob_get_contents();
  14.  
  15.     ob_end_clean();
  16.     
  17.     return $string;     
  18. }
  19.  
  20. $content = get_content ("htt://rapidshare.com/files/37492574/tvc.rar");
  21.  
  22. $action = preg_match('<form action="(.+?)" method="post">', $content, $matches);
  23. $matches = $matches[0];
  24. $action = substr($matches, 13, -15);
  25. echo $action;
  26.  
  27.  $curl = curl_init($action);
  28.      curl_setopt($curl, CURLOPT_FAILONERROR, 1);
  29.      curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  30.      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  31.      curl_setopt($curl, CURLOPT_TIMEOUT, 50);
  32.      curl_setopt($curl, CURLOPT_POST, 1);
  33.      curl_setopt($curl, CURLOPT_POSTFIELDS, 'dl.start=Free'); 
  34.      $r = curl_exec($curl); 
  35.      curl_close($curl);
  36.   
  37.      echo $r;
  38.   
  39.  sleep('50');
  40.  
  41. // i co dalej??
  42. ?>



Pobiera on stronę pliku z rapidshare wybiera pobieranie sposobem darmowym i wyświetla w kodzie strony odliczanie, gdy to odliczanie się skończy (po 50sekundach) na stronie wyświetla się link. 

Teraz przy pomocy jakiejś funckcji w php chciałbym ten link skopiować. 



Nikt nie wie jak mi pomóc? 

A może jest jakiś całkiem inny prostrzy sposób na wyciągnięcie tego linka?


--------------------
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 19:23