Like every blog, Google Blog’s have there own Feed that can be called by many ways for your work. You can get the data from blogger feed means blogs and can use it anywhere. It is built for the purpose of Fetching Data From Blogger Feed. You can use many languages to Fetch Data From Blogger Feed but here we are sharing a simple way in simple language to work online.
You can use pure JavaScript to Fetch Data From Blogger Feed and can use it anywhere on your blog. You can get latest posts, comments, dates, categories etc after Fetching Data From Blogger Feed. Every feed have its own design so Google Blogger have the following design for its feed. The following is JSON path for Blogger data:
Object | Description | Example |
---|---|---|
json.feed.id.$t | Show blog ID | tag:blogger.com,1999:blog-12345 |
json.feed.updated.$t | Last update of a blog | 2016-01-31T18:21:57.051+07:00 |
json.feed.category[] | Categories / label array of a blog | |
json.feed.category[i].term | Show the i-th category | Blogger |
json.feed.title.$t | Show blog name | Google Blog |
json.feed.subtitle.$t | Show description of a blog | Insights from Googlers into our products, technology, and the Google culture |
json.feed.author[] | Array of blog authors | Google Blogs, Google Blogs |
json.feed.author[i].name.$t | Show the i-th blog author name | Google Blogs |
json.feed.author[i].uri.$t | Show the i-th profile author uri | https://profiles.google.com/123456789 |
json.feed.openSearch$totalResults.$t | Show total posts | 777 |
json.feed.entry[] | Posts array of a blog | |
json.feed.entry[i].id.$t | Show the i-th post ID | tag:blogger.com,1999:blog-8508.post-12345678 |
json.feed.entry[i].title.$t | Show the i-th post title | Blogger JSON Feed API |
json.feed.entry[i].published.$t | Show time published of the i-th post | 2013-07-07T12:56:00.000+07:00 |
json.feed.entry[i].updated.$t | Show when the i-th post is updated | 2013-07-07T12:56:47.089+07:00 |
json.feed.entry[i].category[] | Show array of post categories | |
json.feed.entry[i].category[x].term | Show the x-th category of the i-th post | Blogger API |
json.feed.entry[i].summary.$t | Show post summary | Maybe sometimes we need a widget … |
json.feed.entry[i].content.$t | Show post content | Maybe sometimes we need a widget for certain features, but the widgets are not available … |
json.feed.entry[i].link[] | Links array of a post | |
json.feed.entry[i].link[x].href | Show the x-th link of the i-th post | http://www.bloggerever.com/2013/blogger.html |
json.feed.entry[i].author[] | Array of post authors | |
json.feed.entry[i].author[x].name.$t | Name of the x-th author on the i-th post | Danang Probo Sayekti |
json.feed.entry[i].author[x].uri.$t | Show uri author profile | https://plus.google.com/+Google |
json.feed.entry[i].author[x].gd$image.src | Image uri of the x-th author profile on the i-th post | //lh4.googleusercontent.com/photo.jpg |
json.feed.entry[i].media$thumbnail.url | Show image on the i-th post | http://3.bp.blogspot.com/logo.jpg |
json.feed.entry[i].thr$total.$t | Show total threaded comments | 7 |
Now to Fetch Data From Blogger Feed, you can use pure JavaScript. Like check out the following code will extract out your recent post. It will fetuch all post titles and their links so you can get a dimple sitemap.
<script type="text/javascript"> function recentPost(json) { for (var i = 0; i < json.feed.entry.length; i++) { for (var j = 0; j < json.feed.entry[i].link.length; j++) { if (json.feed.entry[i].link[j].rel == 'alternate') { var postUrl = json.feed.entry[i].link[j].href; break; } } var postTitle = json.feed.entry[i].title.$t; var postSummary = json.feed.entry[i].summary.$t; var item = '<div class="item"><h3><a href=' + postUrl + '>' + postTitle + '</h3></a><p>' + postSummary + '</p></div>'; document.write(item); } } </script> <script src="https://googleblog.blogspot.com/feeds/posts/summary/-/ads?max-results=5&alt=json-in-script&callback=recentPost"></script>
So you can update the upper code from the upper list of Google blogger Feed hints and can get many more other data in JavaScript easily. So use JavaScript to Fetch Data From Blogger Feed.
Last Words:
That’s all we have. If you have any problem with this code in your template then feel free to contact us with full explanation of your problem. We will reply you as time allow to us. Don’t forget to share this with your friends so they can also take benefit from it and leave your precious feedback in our comment form below. Happy blogging, See you in next article…
Hi,
What a nice and useful blog for all the bloggers and the JS developer. Really you have posted a very useful script. Thanks for sharing…
Welcome here and thanks for reading our article and sharing your views.
nice post dear and it is very useful for all bloggers thanks for the sharing.
Welcome here and thanks for reading our article and sharing your views..
I’ve read the book and really enjoyed Google it.
Welcome here and thanks for reading our article and sharing your views.
These article is given detail about Fetch Data From Blogger Feed Using Pure JavaScript.Thanks for share it with us.
Welcome here and thanks for reading our article and sharing your views.
I’ve tried it, and it worked. Thanks for sharing
Welcome here and thanks for reading our article and sharing your view. This will be very helpful to us to let us motivate to provide you more awesome and valuable content from a different mind. Thanks again.