Learn More

Tuesday, February 7, 2012

How To Read Blogger XML Feed Using Javascript

blogger logo
Like we have discussed before, all data of blogger are using xml feed. Because, Google is using xml feed as their basic data. To read blogger xml feed we must request that data using GET method. After that, server (in this case is Google) will send blogger xml feed to you. After that, you can read the data using any programming language. But in here, we only use JavaScript. As long as your blog is public, you don’t have to make authentication. Also, there are two ways url to get xml feed,

http://www.example.com/feeds/posts/default

or using

http://www.blogger.com/feeds/blogID/posts/default

Remember, these urls contain 25 posts for maximum. But in practice, the first url is always used by blogger users. Before we discuss how to read xml feed, it will more valuable if we start it with “what inside blogger xml feed?”.  To understand this, please type the address below on your browser

http://www.example.com/feeds/posts/default?redirect=false

Enter, and you will see an xml data on your browser now.


Inside blogger xml feed

Generally, blogger xml feed have format as follow


Remember, this feed is not always same, but basically, it will look like this. Example, gd:image tag is not always same for user using blogger profile and user using google+ profile. Another example, if you have not active post location, then georss:featurename will not publish on your xml feed. Inside entry tag you will see several link tag with specific url. Only link tag with attribute rel=’alternate’ describe truly url of your post.


Read blogger xml feed using JavaScript

It is very easy to read xml feed using javascript. First, you must specific what browser will used. Of course, you want all. And this is the code (this part is needed)



after that, specific what you want to read of your xml feed. Let say, you want to read content of entry tag. So this is the step (option)



For complete code, see below


You must put this code in your blog. Remember, this step is not always easy. Sometimes specific browser can read xml feed. But in here, we hope you have a picture how to read xml feed.

  1. Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups thanks once again.

    ReplyDelete
  2. Ηellо there, Ӏ ԁiscovereԁ your blog via Google аt the ѕame time aѕ lоoκing
    for a simіlar toρic, уour ωеb sіte сame up, it ѕeems good.

    I have boоkmarκed it in mу google booκmarks.


    Hello theгe, simрly changed into alert
    tο уour blog νіa Google, and
    found thаt it's really informative. I am gonna watch out for brussels. I will appreciate for those who continue this in future. Numerous other folks shall be benefited from your writing. Cheers!
    Also visit my blog post using existing orange sim card for iphone 3g

    ReplyDelete
  3. I wanted to have .xml feed for my own Blogger blog, if anyone in Disqus community have any idea, please do tell me, thanks!

    ReplyDelete
  4. Hi aivil vin, basically if you are using blogger.com as your blog provider, then automatically your blog has xml feed. As example, this blog is www.threelas.com then the xml feed is www.threelas.com/feeds/posts/default

    ReplyDelete
  5. Thanks for replying on this one, you are absolutely right in saying that, but i wanted to create a feed in the format http://www.yourdomain.com/feed.xml so that it could be included for content/job syndication in some job search engines where they ask this format which you can easily create in wordpress but don't know how to do that in Blogger.
    Thanks.

    ReplyDelete
  6. Unfortunately, you can't do that on blogger (at least right know).

    ReplyDelete
  7. Yeah..had that idea, but wanted to make sure, thanks.

    ReplyDelete
  8. good job, but i prefer using jsquery for ajax

    ReplyDelete
  9. You can also use read blogger xml with jquery ajax on http://www.threelas.com/2012/09/blogger-json-feed-with-jquery-ajax.html

    ReplyDelete