Hello all,
I am not well-versed in HTTP requests.
How can I, using PHP, grab and parse the information from this XML page, using a GET HTTP Request?
http://heywatch.com/encoded_video/1850189.xml
Basically, this is a video that was encoded, and I am trying to pull some of the values from the recently encoded video. More specifically, I am trying to pull the video length, so that I can add it to my db.
I currently am using:
require_once "HTTP/Request.php";
$req =& new HTTP_Request("http://heywatch.com/encoded_video/1850189.xml");
$req->setBasicAuth("myusername", "mypassword");
$req->setMethod(HTTP_REQUEST_METHOD_GET);
$req->clearPostData();
if (!PEAR::isError($req->sendRequest())) {
$response2 = $req->getResponseBody();
} else {
$response2 = "";
}
echo $response1;
echo $response2;
But, I'm not sure how I would parse each piece of information. The HTTP GET Request information can be found here, but they don't provide any examples.
A nudge in the right direction on how to do this (using PEAR or cURL, whatever might be more efficient) would be appreciated.
Thanks!