How To Display RSS and Twitter Count in Plain Text

How To Display RSS and Twitter Count in Plain Text

by Alex · 36 comments

in Blog Design

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
StumbleuponDelicious
  • Share/Bookmark

Article by Alex

Alex has written 137 awesome article(s) for us.
Visit Alex's blog

Hi, I'm Alex. I am a 16 year old Mac Loving blogger and die hard New England Patriots fan from New Jersey. I'm also very active on Twitter, and I have a personali(ish) blog called Asnio. I am the co-owner of Blogussion, and have mad love for this place.

Summary

Displaying the text count rather than the chicklet for RSS and Twitter counts, you will see an increase of subscribers and followers if you can hook them in the right way.


Similar Articles

Stay in the Loop!

Did you love this post? If you did, there's more to come (and plenty to catch up on) with a variety of ways to stay up to date:

{ 4 trackbacks }

Display RSS Count & Twitter Follower Count in Text Form
August 7, 2009 at 7:31 pm
Flashback Monday - Discount Coupon Codes, Funny Picutes, And New Video Series
August 10, 2009 at 12:15 pm
Add a Custom Feedburner Count to your Wordpress Blog | Three Styles
November 2, 2009 at 9:37 am
uberVU - social comments
November 4, 2009 at 3:50 am

{ 32 comments… read them below or add one }

1 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

Reply

2 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

Reply

3 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

Reply

4 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

Reply

5 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

Reply

6 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?

Reply

7 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

Reply

8 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 !

Reply

9 Alex August 1, 2009 at 10:22 am

Looks good man, nice implementation!

Reply

10 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?

Reply

11 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

Reply

12 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?

Reply

13 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

Reply

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

Reply

15 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

Reply

16 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

Reply

17 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

Reply

18 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

Reply

19 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

Reply

20 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

Reply

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

Reply

22 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

Reply

23 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

Reply

24 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

Reply

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

Reply

26 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

Reply

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

Reply

28 Joomla Developer August 8, 2009 at 2:51 am

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

Reply

29 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

Reply

30 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?

Reply

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

Reply

32 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

Reply

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv Enabled