File_get_contents workaround

software development

#1

Ok here goes. I have a php script that I am trying to use that will scrape the “comments” section of a myspace, then I have a flash embedded on my myspace profile page that is supposed to use the php and display the comments into the flash. The problem I am having is that the php file has:

on one of the lines. From what I have read in the DH wiki is that file_get_contents is blocked and the code needs to be reworked. I tried updating the code to this:

But to no avail. I am very new at php so I am kind of stuck as to where to go. If anyone has any ideas it would be appreciated or if I can be pointed it would be helpful. I uploaded a copy of the original php script as a .txt file here:
http://www.redcrabgang.com/myspace/flash_comments.txt

Also the original tutorial for the project is here:
http://forum.myspace.com/index.cfm?fuseaction=messageboard.viewThread&groupID=105716338&page=0&EntryID=33978304&CategoryID=0&get=1&adTopicId=1&lastpagesent=4

Thanks for any help!


#2

My work around is to create a function that is used:

function getPage ($url) {
if (function_exists(‘curl_init’)) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER[‘HTTP_USER_AGENT’]);
return curl_exec($ch);
} else {
return file_get_contents($url);
}
}