Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Problem sa definicijama PHP Garbbera!?

[es] :: PHP :: Problem sa definicijama PHP Garbbera!?

[ Pregleda: 3127 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Q_Line
BiH

Član broj: 4879
Poruke: 76

Sajt: www.google.ba


Profil

icon Problem sa definicijama PHP Garbbera!?03.04.2004. u 10:04 - pre 244 meseci
Pozdrav!

Imam djelom problema sa ovim php grabberom... sistem djelom radi kako treba no kad mu se zada kao pocetna opcija tag tabele kaze da ne moze naci izvor...

Evo koda scripta:

Code:
  // Global Variables 
$filename = "http://www.wtowatch.org/whatsNew/";      // Location of the News Source 
$start = "<b>Daily News";            // Start Grabbing Code 
$stop  = "</table>";                 // Stop Grabbing Code 
$page  = "wtowatch.txt";            //cache file name
  

  // Get contents of the specified URL and writes it into a string 
$fd = fopen( $filename, "r" ); 
$contents = fread( $fd, 20000 ); 
fclose( $fd ); 

  // Isolates desired section. 
if(eregi("$start(.*)$stop", $contents, $printing)) { 
  $substring=$printing[1]; 
  

  // while is added as there are multiple instances of the </table> string & eregi 
  // searches to include the most that matches, not the next. 
 while(eregi("(.*)$stop", $substring, $printing)) { 
     $substring=$printing[1]; 
   }; 

 } else { 
   echo "Didn't find Daily summary"; 
 } 

  // Replaces specific HTML tags and text 
$printing[1] = eregi_replace( "- .* records</b>", "", $printing[1] ); // Text 
$printing[1] = eregi_replace( "<IMG SRC=[^>]*>", "", $printing[1] );   // Images 
$printing[1] = eregi_replace( "<font[^>]*>", "", $printing[1] ); // Fonts 
$printing[1] = eregi_replace( "</font>", "", $printing[1] ); 
$printing[1] = eregi_replace( "<tr[^>]*>", "<li>", $printing[1] ); // Table Codes 
$printing[1] = eregi_replace( "<td[^>]*>", "", $printing[1] ); 
$printing[1] = eregi_replace( "</tr>", "", $printing[1] ); 
$printing[1] = eregi_replace( "</td>", "", $printing[1] ); 

  // Adds Absolute URL 
$printing[1] = eregi_replace( "href=\"", "href=\"http://www.wtowatch.org", $printing[1]); 

  //  Saves output to include file 
$cartFile = fopen("$page","w"); 
fwrite($cartFile,$printing[1]); 
fclose($cartFile); 


E kad u:

$start = "<b>Daily News"; // Start Grabbing Code

postavim npr:

$start = "<table align=\"center\" width=\"300\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"; // Start Grabbing Code

scripta kaze da ne moze naci source.
Vjerovatno zbog:
while(eregi("(.*)$stop", $substring, $printing))
opcije i visestrukog ponavljanja <table kao taga u html kodu!

Da li se ovo moze nekako srediti!?

Tnx!
"Q" 9G - Ponosni Titin pionir
 
Odgovor na temu

-zombie-
Tomica Jovanovic
freelance programmer
ni.ac.yu

Član broj: 4128
Poruke: 3448
*.beotel.net

Sajt: localhost


+5 Profil

icon Re: Problem sa definicijama PHP Garbbera!?04.07.2004. u 17:24 - pre 240 meseci
šta tačno želiš da grebeš?



 
Odgovor na temu

[es] :: PHP :: Problem sa definicijama PHP Garbbera!?

[ Pregleda: 3127 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.