cUrl problems... :\

bozidar310196

New Member
Messages
2
Reaction score
0
Points
0
Hi! My first post! :D

Do you see something wrong whit this piece of code?

function get_url_contents($url){
$crl = curl_init();
$timeout = 10;
curl_setopt ($crl, CURLOPT_URL,$url);
curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
$ret = curl_exec($crl);
curl_close($crl);
return $ret;
}

function getCont($url) {
if(trim($url)=="")
return "";
$dom = new DOMDocument();
$resp = get_url_contents($url);
$dom->loadXML($resp);
}

problem is that i'm getting something like this:

Warning: DOMDocument::loadXML() [domdocument.loadxml]: Empty string supplied as input in ...bla

On my local computer, it works perfectly.... :\
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
There's 2 problems with that code.

1) It's being blocked in our firewall because Content Scraping and Proxies aren't allowed, and
2) It's been suspended because Content Scraping isn't allowed. The method it's using to obtain the RSS feed is identical to a proxy, but if you read our TOS it explicitly disallows Content Scraping, which is loading an external URL's contents and then parsing its results.

All that was present on your account was RSS Magnet, which is a Content Scraper with a GUI.
 
Top