Subscribe Via RSS

3174 Subscribers

Subscribe Via RSS
Subscribe Via Twitter

Followers

Subscribe Via Twitter
Displaying RSS Feeds As Text

March 16th, 2009 in Coding Tutorials by Richard Carpenter

Displaying RSS Feeds As Text

1 Star2 Stars3 Stars4 Stars5 Stars16 Votes, Rating: 3.94
Loading ... Loading ...
About The Author

About The Author: Richard Carpenter

Hi im Richard Carpenter im a freelance web and graphics designer from England. I am also a regular Blogger, Tutorial Writer, and owner of HV-Designs. You can follow me on twitter HERE. You may also view my portfolio HERE.

 

Richard Carpenter has written 322 posts.

Good afternoon everyone, today il be taking you through the steps of modifying your feed count. Ive had loads of e-mails asking how i designed my “stay connected” box and how i displayed my RSS count as pure text and not a feed burner image.

To display your feedburner RSS count as text we need to just add two snippets of code to our website. Open up a blank notepad document copy and paste the code below.

<?php
//get feedburner count
$whaturl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=hvdesigns";

//Initialize the Curl session
$ch = curl_init();   

//Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);   

//Set the URL
curl_setopt($ch, CURLOPT_URL, $whaturl);   

//Execute the fetch
$data = curl_exec($ch);   

//Close the connection
curl_close($ch);
$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];
//end get feedburner count

Where “hv-designs” is in the 1st bif of code, change that to your feed. Save the blank notepad document as “rss.php”, save it in the root of your websites directory. Now copy and paste the code below.

<?php include("rss.php"); ?>

Paste it any where inside the body of your website. Now all you need to do is add the code below.

<?php echo $fb;?>

Then paste it inside your website where you want the RSS count to be.

Be Part Of The Community!

Become part of the hv-designs community.

Subscribe Via RSS or Follow Us On Twitter.

Subscribe Via RSS Follow Us On Twitter

21 Responses to “Displaying RSS Feeds As Text”

  1. Inpakker says:

    Nice! Gonna use it,

  2. cruwdy says:

    thank you ;)
    very useful :D

  3. Luis says:

    Thats a great tip, i’ll use it on my new blog (cooming soon)

    Thanks!!!

  4. i reader :)

  5. Predator7 says:

    Very interesting. Thanks

  6. Murray says:

    Good little tut in the morning :)

  7. François says:

    Thanks to U!

  8. SMM says:

    Very interesting. Thanks to you!

  9. Renato says:

    thank you ;)

  10. This is very up-to-date information. I think I’ll share it on Facebook.

  11. Thanks Richard, I have been searching something like this for my blog.

  12. Luke says:

    Just spit balling here, wouldn’t a simpler method be:

    $url = “feed_url_here”; // the feed url
    $file = simplexml_load_file($url); // get the xml content
    $feed_count = $file -> feed -> entry['circulation']; // isolate circulations formally known as the “feed count”
    echo $feed_count; // print the feed count

    Great Tutorial though :D

  13. Duxcic says:

    very good work Richard.

  14. GeorgeOz says:

    Great Tutorials, how can you do this with the Twitter count?

  15. anand says:

    nice tutorial

    i like to create this for my blogger. how to i upload this file in root directory. or add a simple tutorial to add this code in blogger.

    i love your blog, good work keep it up

  16. great toturial

    but.Im using Blogger blog,not WordPress blog

    How to do that ??
    Thanks a lot

  17. TheShadow says:

    Hello,Thanks.It worked in my site.can you tell me how to add css too

Leave a Reply