How To Display RSS and Twitter Count in Plain Text

by Alex

Here is a neat trick to making your blog look better. I hate seeing those default Feedburner and Twittercounter chicklets on other people’s blog, because they look so ugly. No matter what color you change them, they never look nice. So, wouldn’t a neat trick be to display these counter on your own terms?

As you can see here on Blogussion, at the top nav menu there is the count for both RSS and the Blogussion Twitter followers. I like to have them display as text because I can easily customize the looks of them on my own terms.

Why text is better than a chicklet

When you change to the text form, I almost guarantee you will see more conversions and will gain new subscribers – if you do it right!

The real perk of using this text block is that it just shows the number of followers/subscribers you have. That means you are free to add any kind of text you want before or after that count. The real trick here is how to hook people in to clicking that link and subscribing to your feed or following you on Twitter.

A simple example of what may be a good catch to sign up would be something like “Come join 1,568 other people who are learning about blogging.” It’s simple, catchy and it shows that there are a number of people who are learning about blogging by reading from your blog.

Displaying RSS Count

Create a new file, name it feed.php and paste the following into it:

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

//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 cool feedburner count

echo $fb;

?>

Edit the line at the very top with the name of your feed. For example, I would put “Blogussion” on the line. Then just simply add this line of code wherever you want the count to display: <?php include("feed.php"); ?>

Script found on Hongkiat.com

Displaying Twitter Count

Create a file called twitter.php and paste the following code into it:

<?php
$tw = get_option("twitterfollowerscount");
if ($tw['lastcheck'] < ( mktime() - 3600 ) )
{
$xml=file_get_contents('http://twitter.com/users/show.xml?screen_name=Feed here');
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) {
$tw['count'] = $match[1];
}
$tw['lastcheck'] = mktime();
update_option("twitterfollowerscount",$tw);
}
echo $tw['count'];
?>
Script found at WP Recipes

Again, edit what’s in bold to your Twitter name and paste this code wherever you want the count to display: <?php include("twitter.php"); ?>

So those are two coll little tricks that really make a difference on your blog. Let me know what you guys think of using this trick, let alone sharing the number of subscribers on your blog.

Photo by Stephen Coles

Back to the top

by

To learn more about this author and see all of their posts, click below.

View Full Profile →

Discover the Real Meaning...

of what it means to master the psychology of your blogging practice. Find out one of the most missed aspects to blogging now, totally free!

Nick Tart | JuniorBiz July 31, 2009 at 1:21 pm

Hey Alex! I agree. By displaying them with numbers you set yourself apart and it removes the advertisement-look of the chicklets. It’s certainly a nice touch you’ve added here and I think a lot of people will benefit from this post.

As far as sharing your numbers, it’s a great idea as long as you have enough. I’d say 100 subscribers and 2,000 followers are the cut-off. It’s just one more way to prove the legitimacy of your site.

Congrats on your RSS count, by the way. It goes up almost every time I visit! Personally, those numbers are the first thing I notice when I visit your blog.
.-= Nick Tart | JuniorBiz´s last blog ..Not Every Business Owner is an Entrepreneur =-.

Thumb up 0 Thumb down 0
Alex July 31, 2009 at 2:34 pm

Thanks Nick! I think the RSS count could be a lot better, but I do have some things rolling out to make it higher of course!
.-= Alex´s last blog ..Young Blogger Interviews #2: Liane from Better Blogging for Bloggers =-.

Thumb up 1 Thumb down 0
Jeremiah July 31, 2009 at 2:26 pm

Omg, thanks for sharing this with us! I was actually doing some face-lift operations on my blog this week and I kind of toyed with the idea of removing the ugly TwitterCounter and Feed Count clicklets from my sidebar in favor of plain text.

Thanks again, Alex!
.-= Jeremiah´s last blog ..7 Astonishing Wordpress Themes for Your Blog =-.

Thumb up 0 Thumb down 0
Alex July 31, 2009 at 2:36 pm

Hey Jeremiah! Haven’t seen you around in a while. ;)

Looking forward to seeing your blog face-lift! You should definitely go this route though, you have a nice design and I think those chicklets would hurt it. :(
.-= Alex´s last blog ..Young Blogger Interviews #2: Liane from Better Blogging for Bloggers =-.

Thumb up 0 Thumb down 0
Jeremiah August 3, 2009 at 1:39 pm

Ah, yes, I’ve been falling off “the blogging horse” as of late. My trip to North Carolina to let my parents see my daughter for two weeks disconnected me from the world and I’ve been busy with my day job catching up on some hours of work I missed. Shouldn’t be too bad in the coming weeks, now that I’m all in order in my day life!

*ugh* Life after High School is the pits, hahaha.
.-= Jeremiah´s last blog ..7 Astonishing Wordpress Themes for Your Blog =-.

Thumb up 0 Thumb down 0
Mastermind Internet Marketing July 31, 2009 at 4:27 pm

I have tried using the Twitter Counter once, but I found it to be too ugly. It just messed the whole layout for me so I just go for the cute Twitter bird icon to magnitize people :P

~Igor
.-= Mastermind Internet Marketing´s last blog ..Twitter Overrated? =-.

Thumb up 0 Thumb down 0
Alex July 31, 2009 at 10:58 pm

It does look very ugly! There are so many Twitter birds out there for use, and many look great.
.-= Alex´s last blog ..Young Blogger Interviews #2: Liane from Better Blogging for Bloggers =-.

Thumb up 0 Thumb down 0
The Bad Blogger August 1, 2009 at 1:38 am

Thanks for your information of changing to a nice Rss Feed count, now my blog feed count display, is absolutely unique…. you can take a look too !
.-= The Bad Blogger´s last blog ..4 Stupid Marketing Concept You Should Dump Right Away ! =-.

Thumb up 0 Thumb down 0
Alex August 1, 2009 at 10:22 am

Looks good man, nice implementation!

Thumb up 0 Thumb down 0
Liane YoungBlogger August 1, 2009 at 3:51 am

Yep! Text is definitely better than chicklet. But I’m really very tempted to still use chicklet because adding stuffs that will match to my blog’s color theme is my weakness :D
.-= Liane YoungBlogger´s last blog ..[Poll Results] Is Blog Advertising Really Dead? =-.

Thumb up 0 Thumb down 0
Alex August 1, 2009 at 10:23 am

Haha, well red text would look just fine!
.-= Alex´s last blog ..Young Blogger Interviews #2: Liane from Better Blogging for Bloggers =-.

Thumb up 0 Thumb down 0
Enk. August 1, 2009 at 6:12 am

Wow, that was a cool tut for twitter.. comes handy !
Thanks.

Don’t forget to check out the Contest I’ve started on my blog ! ;)
.-= Enk.´s last blog ..US to force Apple over Google Voice on iPhone? =-.

Thumb up 0 Thumb down 0
Jake | Web Journey August 1, 2009 at 12:48 pm

I think it’s cool to display text, but I wouldn’t go so far as to say the chicklets are ugly. They look fine to me.
.-= Jake | Web Journey´s last blog ..Vipre Antivirus Review =-.

Thumb up 0 Thumb down 0
Seth W August 1, 2009 at 3:09 pm

I think the chicklets are not horrible, but I do think they leave something to be desired when it comes to conforming with your theme.

Thumb up 0 Thumb down 0
Tycoon Blogger August 1, 2009 at 3:07 pm

Useful information but I disagree with you. I think people look for the chicklet and it is much more visible than just the text. In fact, if you did not tell me that your subscriber count is at the top, I probably would not have found it.
.-= Tycoon Blogger´s last blog ..Blog Comments = Link Juice and Free Promotion =-.

Thumb up 0 Thumb down 0
Alex August 1, 2009 at 10:11 pm

I guess it’s just a matter of taste then. I know it’s not visible here, as I don’t want my blog to be filled up with RSS messages.
.-= Alex´s last blog ..Young Blogger Interviews #2: Liane from Better Blogging for Bloggers =-.

Thumb up 0 Thumb down 0
Klaus @ TechPatio August 1, 2009 at 4:58 pm

Like Tycoon Blogger said, if I haven’t read this article, I would never have seen your subscriber count :)

But with that said, I also think that the current feedburner chicklets are ugly and that’s partly why I don’t have one on my site – and also because it doesn’t look so good to advertise that I only have 30 or so subscribers :)

I’ll keep your trick in mind when I update my theme to Thesis, it might come in handy – thanks!
.-= Klaus @ TechPatio´s last blog ..My Top 10 Favorite TV Shows =-.

Thumb up 0 Thumb down 0
Alex August 3, 2009 at 11:20 pm

It’s a good trick for using later definitely.
.-= Alex´s last blog ..Young Blogger Interviews #2: Liane from Better Blogging for Bloggers =-.

Thumb up 0 Thumb down 0
Prada Shoes August 2, 2009 at 3:37 pm

I think it’s cool to display text, but I wouldn’t go so far as to say the chicklets are ugly. They look fine to me. Thanks

Thumb up 0 Thumb down 0
Alex August 3, 2009 at 11:20 pm

I guess it’s just a personal preference!
.-= Alex´s last blog ..Young Blogger Interviews #2: Liane from Better Blogging for Bloggers =-.

Thumb up 0 Thumb down 0
DaneBlogger August 2, 2009 at 6:05 pm

This article is pretty useful, and I like that it’s text instead of a button or chicklet, it’s just nice to be able to use the number of subscribers and followers in a sentence..

Thumb up 0 Thumb down 0
Alex August 3, 2009 at 11:21 pm

That’s the best part of this tutorial: you can actually use this in any sentence!
.-= Alex´s last blog ..Young Blogger Interviews #2: Liane from Better Blogging for Bloggers =-.

Thumb up 0 Thumb down 0
Max August 3, 2009 at 1:18 am

Hey Alex, it’s great you actually ended up putting this up, but i’m still having trouble getting it to work on my site. I follow the instructions correctly but for some reason it says something about the get option having an error?
.-= Max´s last blog ..Just A Filler =-.

Thumb up 0 Thumb down 0
Alex August 3, 2009 at 11:23 pm

What is the exact error you get Max?
.-= Alex´s last blog ..Young Blogger Interviews #2: Liane from Better Blogging for Bloggers =-.

Thumb up 0 Thumb down 0
Jeremiah August 5, 2009 at 1:09 pm

By the way, Alex, you should mention in the article that using the FeedBurner count script requires PHP5 to be installed on your web server. A lot of hosts default to PHP4, so you might need to switch an option or contact your host to speak to them about an upgrade (if possible).

Thumb up 0 Thumb down 0
Richael | Domain Marvelous August 6, 2009 at 3:04 am

Thanks for the scripts. I hated to place these chicklets on my sites becuase of the look; now I can edit these small but important stats to interesting text links.
.-= Richael | Domain Marvelous´s last blog ..Domain Name Promo Codes for August =-.

Thumb up 0 Thumb down 0
Ramses August 7, 2009 at 1:32 pm

It seems that the Twitter code doesn’t work anymore (I think they changed the API yesterday), but Twounter does work (http://themesphere.com/twitter-counter-wordpress-plugin.html).

DIsclaimer: I’m just a user of the plugin.

Thumb up 0 Thumb down 0
Joomla Developer August 8, 2009 at 2:51 am

The script you provided really nice. I never think like this. Thanks a lot…

Thumb up 0 Thumb down 0
Ramses August 11, 2009 at 3:16 pm

Okay, after using this script my feed isn’t working anymore. All I get when I go to the feedburner(!) url is the number of subscribers: http://feeds.feedburner.com/spanish–only–com

Thumb up 0 Thumb down 0
tom September 3, 2009 at 5:35 pm

Is this strictly for word press? I’m trying to use this on a test server without wordpress. i tried the example you provided and got errors.

Fatal error: Uncaught exception ‘Exception’ with message ‘String could not be parsed as XML’ in D:\html\feed.php:19 Stack trace: #0 D:\html\feed.php(19): SimpleXMLElement->__construct(”) #1 {main} thrown in D:\html\feed.php on line 19

line 19 – $xml = new SimpleXMLElement($data);

how does this include the twitter.php file?

Thumb up 0 Thumb down 0
jeeremie May 5, 2010 at 1:51 am

I am getting this error too. I can’t find a way to fix it.

Thumb up 0 Thumb down 0
farbige kontaktlinsen October 20, 2009 at 1:44 pm

Twitter is really a great invention, but I think blogging is even more important to create some traffic. But I can use some of the tips.

Thumb up 0 Thumb down 0
JavaCarl October 26, 2009 at 6:37 pm

Ok need a little help here, don’t understand the create file in the instructions. where do I paste this code?
.-= JavaCarl´s last blog ..Blog Evolution =-.

Thumb up 0 Thumb down 0
Adam April 15, 2010 at 12:13 pm

I know is an old post, but I was wondering if there is a way you can add the two numbers together?

Like grab both the RSS and Twitter counts, then say “over X subscribers” which would include both.

And I’m curious…is there a way to get your Facebook Fan Page count too?

Thanks!!!

-Adam

Thumb up 0 Thumb down 0
Design Saga July 21, 2010 at 2:21 pm

If anyone wants an updated version for wordpress then I have wrote some tutorials on it..

RSS – http://www.designsaga.com/wordpress/wordpress-displaying-your-rss-count/
Twitter – http://www.designsaga.com/wordpress/wordpress-displaying-your-twitter-followers/

Thumb up 0 Thumb down 0
Tony August 3, 2010 at 9:15 pm

Remember…you have to enable the Feedburner Awareness API first.

Thumb up 0 Thumb down 0
Nim @ Online Jobs August 15, 2010 at 4:04 pm

Thanks for this script. I will try to use it on my other blog and hopefully it will work out fine there.

Thumb up 0 Thumb down 0
Nim @ Online Jobs August 15, 2010 at 4:05 pm

I’m sorry I think I have clicked the submit button twice.

Thumb up 0 Thumb down 0
Jacob Stoops August 20, 2010 at 11:56 am

Fantastic scripts Alex! I’d been at the mercy of many buggy Wordpress plugins till I found this article – so, so helpful! You saved me hours of my life :-)

Thanks again.

Thumb up 0 Thumb down 0
Morton Mullner September 23, 2010 at 3:24 pm

“Hi. this really is kind of an -unconventional- query , but have other visitors asked you how get the menu bar to seem like you have acquired it? I also have a blog and am seriously looking to alter all around the theme, nonetheless am terrified to demise to mess with it for worry of the lookup engines punishing me. I’m very new to all of this !!!..so i’m just not constructive precisely how you can attempt to to all of it however. I will just hold working on it a single working day at a time.”

Thumb up 0 Thumb down 0
Content management system mumbai December 3, 2010 at 12:15 am

useful info, this was helpful for me and i am also tried this code n its really works

Thumb up 0 Thumb down 0
Dating Sites January 18, 2011 at 8:58 am

I love the valuable data you offer for your articles. I can bookmark your weblog and have my youngsters test up right here generally. I am moderately positive they’re going to be told a variety of new stuff here than any one else!

Thumb up 0 Thumb down 0
facebook likes February 9, 2011 at 3:27 am

Unusual this put up is totaly unrelated to what I was searching google for, however it was once indexed at the first page. I assume your doing one thing right if Google likes you sufficient to put you on the first web page of a non similar search.

Thumb up 0 Thumb down 0
Freddy Ronero February 20, 2011 at 9:30 pm

I just want to tell you that I am just new to blogging and honestly liked this blog site. Likely I’m going to bookmark your blog post . You amazingly come with good articles. Thanks a lot for revealing your webpage.

Thumb up 0 Thumb down 0
Thomas Frank February 22, 2011 at 1:57 am

Thanks so much for this tip, Alex! I’ve been looking for a good way to implement feed and twitter counts on my new blog design.

Thumb up 0 Thumb down 0
Gio February 23, 2011 at 10:02 am

You got yours working?
I’m newbie, what exactly should I change on the twitter count code to have it working? ANYAONE???

Thanks
Gio-

Thumb up 0 Thumb down 0
Thomas Frank February 23, 2011 at 10:44 am

Gio –

Sorry, I haven’t tried implementing it yet. I’ll let you know if I get it working.

Thumb up 0 Thumb down 0
Gio February 23, 2011 at 10:03 am

I’m newbie, what exactly should I change on the twitter count code to have it working? ANYAONE???

Thanks

Thumb up 0 Thumb down 0

Comments on this entry are closed.

Previous post:

Next post: