Grabbing info off of other sites.

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
geoffreak
Registered User
Posts: 591
Joined: Sat Feb 12, 2005 8:39 am
Contact:

Grabbing info off of other sites.

Post by geoffreak »

It seems to me that I am one of the few that has no idea how to do this.
Can someone tell me how i might do this?
Anime Revolution - Your new #1 source for All things anime and manga!
READ MY BLOG ALREADY!
keithschm
Registered User
Posts: 299
Joined: Sat Oct 02, 2004 7:58 pm

Post by keithschm »

like what kind of info
Jimerson
Registered User
Posts: 90
Joined: Mon May 02, 2005 9:26 pm

Post by Jimerson »

Are you talking about like an rss feed?
agent00shoe
Registered User
Posts: 373
Joined: Sat Feb 12, 2005 9:39 pm

Post by agent00shoe »

Hope this helps. It's gutted from something else I'm working on.

Code: Select all

<?php

#page you want to open
$server = "http://www.phpbb.com/";

function openSite($website){

	$readSite = "";
	ini_set('user_agent','Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)'); 

	if($openSite = fopen ($website,"r")){
    while(!feof($openSite)){
		$readSite  .= fread($openSite, 4096);
	}
	fclose($openSite);
	}else{

		echo "Couldn't open $website...";
	}
	return $readSite;

}

#data will be the source code for the page you specify

$data = openSite($server);

?>
You can use regular expressions to get exactly what you want from the page source.
Post Reply

Return to “[2.0.x] MOD Writers Discussion”