make a block out of php site?

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   make a block out of php site?
stclem
CZ Super Newbie
Age: 46
Gender: Male
Status: Offline
Joined: Sep 09, 2003
0.01 posts per day
Posts: 85
Points: 4,060
   
Can someone help me make a block out of this?

<?php

$theLocation="http://fdgdgfdgfdgfg.com";   

$startingpoint = " fggh gfdgdfrg r";
$endingpoint = "d ffd gfg fd gfgdf;";

set_time_limit(60); // give us more than 30 seconds on the server's default timeout to process this script, just in case

preg_match("/^(https?:\/\/)?([^\/]*)(.*)/i", "$theLocation", $matches);
$theDomain = "http://" . $matches[2];
$page = $matches[3];

$fd = fopen($theDomain.$page, "r");  // "rb" may work better on NT servers
$value = "";
while(!feof($fd)){
   $value .= fread($fd, 4096);   
}
fclose($fd);
$start= strpos($value, "$startingpoint"); 
$finish= strpos($value, "$endingpoint"); 
$length= $finish-$start;
$value=substr($value, $start, $length);

$value = eregi_replace( "<\/?b>", "", $value ); // Remove <b> tags.

$ebayLink = "http%3A//cgi.ebay.com/ws/eBayISAPI.dll%3FViewItem%26item%3D"; // the urlencoded link

$value = eregi_replace( "href=\"http://cgi.ebay.com/ws/eBayISAPI.dll\?ViewItem&item=", "href=\"http://www.qksrv.net/click-" . "$ebayID" . "-5463217?loc=" . "$ebayLink", $value );

$value = eregi_replace( "href=", "target=\"_blank\" href=", $value );

$FinalOutput = preg_replace("/(href=\"?)(\/[^\"\/]+)/", "\\1" . $theDomain . "\\2", $value);

echo $FinalOutput; //prints it to your page

echo "<a href=\"http://www.mikenew.net\"><img src=\"http://www.mikenew.net/images/php.gif\" alt=\"web site content, automatic updates\" width=\"20\" height=\"20\" border=\"0\"></a>";
flush (); //force

?>



Back to top Reply with quote
#2   
Staffie
CZ Revered Member
 Codezwiz Site Donator
uk.gif
Occupation: Investigation Officer
Age: 39
Gender: Male
Website:
Status: Offline
Joined: May 27, 2003
0.19 posts per day
Posts: 1454
Points: 401,085
   
what is it?




_________________
Back to top Reply with quote
#3   
stclem
CZ Super Newbie
Age: 46
Gender: Male
Status: Offline
Joined: Sep 09, 2003
0.01 posts per day
Posts: 85
Points: 4,060
   
it is a script who grab information from other sites.



Back to top Reply with quote
#4   re: make a block out of php site?
Taut
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif california.gif
Occupation: Entrepreneur
Gender: Female
Fav. Sports Team: SF Giants
Status: Offline
Joined: May 27, 2003
0.70 posts per day
Posts: 5530
Points: 481,695
   
what type of information are you wanting? news, posts? looks more like you are looking for the RSS feed

review this post about that same subject
[ Register or login to view links on this board. ]


taut



Back to top Reply with quote
#5   
stclem
CZ Super Newbie
Age: 46
Gender: Male
Status: Offline
Joined: Sep 09, 2003
0.01 posts per day
Posts: 85
Points: 4,060
   
its not a rss feed. This script let me take some text from another site. But only the things i want to. The other post does not help me...

The script i postet is working if i try it, but when i want to include the script.php file in a block it dont work.

If someone knows how to inclkude a php file in a block it would help me to.



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum