Google owned blogging platform providing a free way to manage blogs. It is following atom feed to provide sitemaps to search engines. This blog is also from blogger platform. You can submit this sitemap URL to google web master tools to have better SEO. Ok, now we will see how to generate Atom feed for Blogger blog. Observe below syntax


start-index and max-results will decide the atom feed content
<blog url>/atom.xml?redirect=false&start-index=1&max-results=50
Click on below link to get latest 3 articles feed
Click on below link to get 5th latest article feed

XML Structure

Atom feed gives data in XML format. Find below for format 
<feed ----->
     <category term="---"/>
     <category term="---"/>
     <content ---->

Java Program

Lets move to java program. We need to read atom feed xml nodes to get the required data. The below example is for reading article titles and their tags. Observe below java program. This program reads all articles titles and tags of this blog
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

public class BloggerReader {
    static int FEED_COUNT = 50;
    public static void main(String[] args) {
        try {
            int START_INDEX = 1; 
            while (true) {
                // Atom feed URL
                URL url = new URL(
                                + FEED_COUNT);
                InputStream input = url.openStream();

                // XPATH to get entries
                DocumentBuilderFactory factory = DocumentBuilderFactory
                DocumentBuilder builder = factory.newDocumentBuilder();
                Document doc = builder.parse(input);
                XPathFactory xPathfactory = XPathFactory.newInstance();
                XPath xpath = xPathfactory.newXPath();
                XPathExpression expr = xpath.compile("/feed/entry");

                // Get Nodelist of entries
                NodeList nl = (NodeList) expr.evaluate(doc,

                // iterate Nodelist
                for (int i = 0; i < nl.getLength(); i++) {
                    NodeList nl1 = nl.item(i).getChildNodes();

                    // iterate child nodes
                    for (int j = 0; j < nl1.getLength(); j++) {
                        Node node = nl1.item(j);
                        if (node.getNodeName().equals("title")) {
                            // print title
                        } else if (node.getNodeName().equals("category")) {
                            // print categories
                START_INDEX += FEED_COUNT;
                if(FEED_COUNT > nl.getLength()) {
        } catch (SAXParseException err) {
        } catch (SAXException e) {
        } catch (Throwable t) {


  1. I enjoyed over read your blog post. Your blog have nice information, I got good ideas from this van rental montreal amazing blog. I am always searching like this type blog post. I hope I will see again.

  2. Good evening guys! Don't waste a lot of time for boring research and stupid topics. I have one advice just use the best paper writing service I always used during my university period and never felt nervous about grades. Studying can be so much easier when you know who you should ask for help.

  3. Here data.expanded variable which makes Accordion collapse and expand. Whenever user clicks on it, this variable will be toggled! Not every student will require help with their nursing research paper. However, for important papers, it is often best to have your work edited carefully before you submit to ensure that your work will be worthy of the best grades.

  4. Pretty useful material in your blog almost for all students, and they can simultaneously explore something new. The Best Essay Service Overview personal statement service. Continue in the same spirit, performing excellent work that will be a great help for you.

  5. Furthermore, our plagiarism software tool is consistently upgraded ( ) to ensure that it detects plagiarized texts with high certainty and accuracy.

  6. There is nothing wrong with rewarding yourself or taking a break, on this site when it comes to making a healthier lifestyle a habit, consistency every day benefits you in the long run.



Popular Posts