Pagina 1 van 1

Vraag mbt 4CM_Grabber.

Geplaatst: 16 jun 2006, 20:30
door farid
Beste Phpbb-ers,

Ik gebruik voor het grabben van bepaalde data onderstaand script:

Code: Selecteer alles

<?php 
############################################################### 
# Script Title: 4CM_Grabber 
#         File: 4CM_Grabber.php 
#  Description: This script will Grab information from a given web site 
#       Author: John B. Abela 
#        Email: support@4cm.com 
#          Web: http://www.4cm.com/ 
#      Version: 2.0.5 
# 
#  Copyright © 1996-2000 www.4cm.com.  All Rights Reserved. 
# 
# 
#  www.4cm.com (4CM) offers no warranties on this script. 
#  The downloader of the script is solely responsible for any 
#  problems caused by the installation of the script or use 
#  of the script, including possible legal action for the grabbing 
#  of the data, as a result of this script! 
# 
#  ALL COPYRIGHT NOTICES REGARDING: www.4cm.com 
#  MUST REMAIN INTACT IN THE SCRIPT AND IN THE HTML OF THE SCRIPT!  
# 
#  For more info on this script, see: 
#  http://www.4cm.com/ 
# 
#  (Please be kind and sign our guestbook at: 
#     http://www.4cm.com/guestbook/  and say your using 
#       this script!!) 
############################################################### 

######################## 
## Mandatory Setting  ## 
######################## 


$GrabURL = "http://www.actuelewaterdata.nl/cgi-bin/measurements/IJ51.Hm0?template=golfperfreqtemp"; //- Complete URL of the page your grabbing from! 
$GrabStart = 'uur is'; //- HTML Code To Start Grab. Must Be A Unique Bit Of Code! 
$GrabEnd = '<br /></strong></p>'; //- HTML Code To End Grab. Must Be A Unique Bit Of Code! 

$GrabURL1 = "http://www.actuelewaterdata.nl/cgi-bin/measurements/IJ51.Hmax?template=golfperfreqtemp"; //- Complete URL of the page your grabbing from! 
$GrabStart1 = 'uur is'; //- HTML Code To Start Grab. Must Be A Unique Bit Of Code! 
$GrabEnd1 = '<br /></strong></p>'; //- HTML Code To End Grab. Must Be A Unique Bit Of Code! 

$GrabURL2 = "http://www.actuelewaterdata.nl/cgi-bin/measurements/IJ51.Tm02?template=golfperfreqtemp"; //- Complete URL of the page your grabbing from! 
$GrabStart2 = 'uur is'; //- HTML Code To Start Grab. Must Be A Unique Bit Of Code! 
$GrabEnd2 = '<br /></strong></p>'; //- HTML Code To End Grab. Must Be A Unique Bit Of Code! 

$GrabURL3 = "http://www.actuelewaterdata.nl/cgi-bin/measurements/IJ51.Tmax?template=golfperfreqtemp"; //- Complete URL of the page your grabbing from! 
$GrabStart3 = 'uur is'; //- HTML Code To Start Grab. Must Be A Unique Bit Of Code! 
$GrabEnd3 = '<br /></strong></p>'; //- HTML Code To End Grab. Must Be A Unique Bit Of Code! 




############################# 
## Do Not Edit Below Here  ## 
## Do Not Edit Below Here  ## 
############################# 

echo "<font face=Verdana size=1><B>Actuele gegevens Wijk aan Zee delivered by Bennis.nu</B><BR>"; 
echo $DataPrint[1]; //- DO NOT CHANGE
echo $DataPrint1[1]; //- DO NOT CHANGE
echo $DataPrint2[1]; //- DO NOT CHANGE

$OpenFile = fopen("$GrabURL", "r"); //- DO NOT CHANGE 
$RetrieveFile = fread($OpenFile, 200000); //- Reduce This To Save Memory 
$GrabData = eregi("$GrabStart(.*)$GrabEnd", $RetrieveFile, $DataPrint); 

$OpenFile1 = fopen("$GrabURL1", "r"); //- DO NOT CHANGE 
$RetrieveFile1 = fread($OpenFile1, 200000); //- Reduce This To Save Memory 
$GrabData1 = eregi("$GrabStart1(.*)$GrabEnd1", $RetrieveFile1, $DataPrint1)

#$OpenFile2 = fopen("$GrabURL2", "r"); //- DO NOT CHANGE 
#$RetrieveFile2 = fread($OpenFile2, 200000); //- Reduce This To Save Memory 
#$GrabData2 = eregi("$GrabStart2(.*)$GrabEnd2", $RetrieveFile2, $DataPrint2)

#$OpenFile3 = fopen("$GrabURL3", "r"); //- DO NOT CHANGE 
#$RetrieveFile3 = fread($OpenFile3, 200000); //- Reduce This To Save Memory 
#$GrabData3 = eregi("$GrabStart3(.*)$GrabEnd3", $RetrieveFile3, $DataPrint3)


#fclose($OpenFile); //- DO NOT CHANGE 
#fclose($OpenFile1); //- DO NOT CHANGE
#fclose($OpenFile2); //- DO NOT CHANGE
#fclose($OpenFile3); //- DO NOT CHANGE 

 
#################### 
## End of Script  ## 
#################### 



?> 

<html>
<table width="428" border="0" cellspacing="0" cellpadding="0"> 
<tr> 
<td width="180"><font size="3" face="Arial, Helvetica, sans-serif"><strong>zo moet het dus</strong></font></td> 
<td width="248"><font size="2">&nbsp;</font></td> 
</tr> 
<tr> 
<td>&nbsp;</td> 
<td>&nbsp;</td> 
</tr> 
<tr> 
<td><font size="2" face="Arial, Helvetica, sans-serif"><strong>Golven </strong></font></td> 
<td>&nbsp;</td> 
</tr> 
<tr> 
<td><font size="2" face="Arial, Helvetica, sans-serif">Golfhoogte:</font></td> 
<td><font size="2"><?php echo $DataPrint[1]; ?></font></td> 
</tr> 
<tr> 
<td><font  size="2" face="Arial, Helvetica, sans-serif">Max. golfhoogte:</font></td> 
<td><font  size="2"><?php echo $DataPrint1[1]; ?></font></td> 
</tr>
<tr> 
<td><font size="2" face="Arial, Helvetica, sans-serif">Golfperiode kort:</font></td> 
<td><font size="2"><?php echo $DataPrint2[1]; ?></font></td>
</tr>
<tr> 
<td><font size="2" face="Arial, Helvetica, sans-serif">Golfperiode lang:</font></td> 
<td><font size="2"><?php echo $DataPrint3[1]; ?></font></td>
</tr>
 
</table> 
</body> 
</html>

Dit geeft als output op de pagina: (klik op de link)

http://www.bennis.nu/phpBB/grab.php

Zoals je ziet heb ik daar geen output van de gegevens zoals ik ze in bovenstaand script heb opgevraagd.

Ziet iemand wat ik heb fout gedaan?

Ik zelf denk dat het in het volgende stukje zit: (Heb nu een gedeelte remarked, anders wordt de pagina niet weergegeven.)

Code: Selecteer alles

$OpenFile = fopen("$GrabURL", "r"); //- DO NOT CHANGE 
$RetrieveFile = fread($OpenFile, 200000); //- Reduce This To Save Memory 
$GrabData = eregi("$GrabStart(.*)$GrabEnd", $RetrieveFile, $DataPrint); 

$OpenFile1 = fopen("$GrabURL1", "r"); //- DO NOT CHANGE 
$RetrieveFile1 = fread($OpenFile1, 200000); //- Reduce This To Save Memory 
$GrabData1 = eregi("$GrabStart1(.*)$GrabEnd1", $RetrieveFile1, $DataPrint1)

#$OpenFile2 = fopen("$GrabURL2", "r"); //- DO NOT CHANGE 
#$RetrieveFile2 = fread($OpenFile2, 200000); //- Reduce This To Save Memory 
#$GrabData2 = eregi("$GrabStart2(.*)$GrabEnd2", $RetrieveFile2, $DataPrint2)

#$OpenFile3 = fopen("$GrabURL3", "r"); //- DO NOT CHANGE 
#$RetrieveFile3 = fread($OpenFile3, 200000); //- Reduce This To Save Memory 
#$GrabData3 = eregi("$GrabStart3(.*)$GrabEnd3", $RetrieveFile3, $DataPrint3)

Ik hoop dat iemand iets kan vinden.

Alvast bedankt.

groet,

Farid

PS op de site van de ontwikkelaar is geen support te vinden.

Geplaatst: 20 jun 2006, 20:11
door farid
Inmiddels de hele code opnieuw ingevuld en nu gaat het beter.... :thumb:

Geen idee waar de fout exact zat.