Jump to content

how to use curl option


Deoctor

Recommended Posts

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..

Link to comment
https://forums.phpfreaks.com/topic/182616-how-to-use-curl-option/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.