0

Hai
i am using the curl option to validate the site for the rss feed.
my code is

<?php
// create a new cURL resource
$ch = curl_init();
$demo='http://chaitu09986025424.blog.co.in/feed/rss/';
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://validator.w3.org/feed/check.cgi?url=$demo");
curl_setopt($ch, CURLOPT_HEADER, false);

// grab URL and pass it to the browser
curl_exec($ch);
echo $info['http_code'] . " " . $http_codes[$info['http_code']];
// close cURL resource, and free up system resources
curl_close($ch);
?>

now the problem is that how do i read the file and pass the parameters...
the result of this would be

Congratulations!
This is a valid RSS feed.

Recommendations
This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

•line 11, column 107: Self reference doesn't match document location [help]

... rel="self" type="application/rss+xml" /> ^Source: http://chaitu09986025424.blog.co.in/feed/rss/
1.<?xml version="1.0" encoding="UTF-8"?>
2.<rss version="2.0"
3.xmlns:content="http://purl.org/rss/1.0/modules/content/"
4.xmlns:wfw="http://wellformedweb.org/CommentAPI/"
5.xmlns:dc="http://purl.org/dc/elements/1.1/"
6.xmlns:atom="http://www.w3.org/2005/Atom"
7.>
8.
9.<channel>
10.<title>Chaitu's</title>
11.<atom:link href="http://chaitu09986025424.blog.co.in/wp-rss2.php" rel="self" type="application/rss+xml" />
12.<link>http://chaitu09986025424.blog.co.in</link>
13.<description>Know about the World and gain some Knowledge</description>
14.<pubDate>Fri, 20 Nov 2009 11:18:56 +0000</pubDate>

how do i pass the This is a valid RSS feed. data in code so that i can validate the given url..

please some body help me on this..

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by cwarn23
0

Try this:

<?php
// create a new cURL resource
$ch = curl_init();
$demo='http://chaitu09986025424.blog.co.in/feed/rss/';
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://validator.w3.org/feed/check.cgi?url=$demo");
curl_setopt($ch, CURLOPT_HEADER, false);

// grab URL and pass it to the browser
$data=curl_exec($ch);
echo $info['http_code'] . " " . $http_codes[$info['http_code']];
// close cURL resource, and free up system resources
curl_close($ch);

//$data
//contains the result
?>
0

hai
i have tried this one but still i am not getting any information..
The same info which i am getting using the curl_exec($ch);
there is no result getting displayed using the

echo $info['http_code'] . " " . $http_codes[$info['http_code']];
0

Didn't realize you were trying to get those two variables to work but the data from the result is stored in the $data variable and should be possible to use the preg_match_all function to find the appropriate section of data.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.