Date: 06/23/06 (PHP Community) Keywords: rss, xml
i'm using cURL for the first time and just want to make sure i'm doing it right, i'm using it to grab an rss feed for processing. class ej_getfeed { public $XMLResponseRaw; function curlRequest() { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->URL); curl_setopt($ch, CURLOPT_TIMEOUT, 180); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); $data = curl_exec($ch); curl_close($ch); return($data); } function getFeed() { $rawData = $this->curlRequest(); $this->XMLResponseRaw = $rawData; } function pullXML($URL) { $this->URL = $URL; $this->getFeed(); return simplexml_load_string($this->XMLResponseRaw); } } any help would be greatly appreciated, since this is my first time ever touching cURL
Source: http://community.livejournal.com/php/464511.html