472,353 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

How to retrieve RSS feed from blogger?

Here's the code for the index.xml file on the blogger

Expand|Select|Wrap|Line Numbers
  1.  
  2. <?xml version="1.0" encoding="<$MTPublishCharset$>"?>
  3. <rss version="2.0">
  4.    <channel>
  5.       <title><$MTBlogName remove_html="1" encode_xml="1"$></title>
  6.       <link><$MTBlogURL$></link>
  7.       <description><$MTBlogDescription remove_html="1" encode_xml="1"$></description>
  8.       <language><$MTBlogLanguage ietf="1"$></language>
  9.       <copyright>Copyright <$MTDate format="%Y"$></copyright>
  10.       <lastBuildDate><MTEntries lastn="1"><$MTEntryDate format_name="rfc822"$></MTEntries></lastBuildDate>
  11.       <generator>http://www.sixapart.com/movabletype/?v=<$MTVersion$></generator>
  12.       <docs>http://blogs.law.harvard.edu/tech/rss</docs> 
  13.  
  14.       <MTEntries lastn="15">
  15.       <item>
  16.          <title><$MTEntryTitle remove_html="1" encode_xml="1"$></title>
  17.          <description><$MTEntryBody encode_xml="1"$></description>
  18.          <link><$MTEntryPermalink encode_xml="1"$></link>
  19.          <guid><$MTEntryPermalink encode_xml="1"$></guid>
  20.          <category><$MTEntryCategory remove_html="1" encode_xml="1"$></category>
  21.          <pubDate><$MTEntryDate format_name="rfc822"$></pubDate>
  22.       </item>
  23.       </MTEntries>
  24.    </channel>
  25. </rss>
  26.  
Here's my javascript file which returns an allert that it could not handle the file -- I'm sure it has to do with me not defining what variables that the blogger is returning, but is there a way to handle such variables?

Expand|Select|Wrap|Line Numbers
  1.  
  2. var channelvar=xml_doc.getElementsByTagName('channel');
  3. var titlevar=xml_doc.getElementsByTagName('title');
  4. var linkvar=xml_doc.getElementsByTagName('link');
  5. var descriptionvar=xml_doc.getElementsByTagName('description');
  6. var languagevar=xml_doc.getElementsByTagName('language');
  7. var copyrightvar=xml_doc.getElementsByTagName('copyright');
  8. var lastBuildDatevar=xml_doc.getElementsByTagName('lastBuildDate');
  9. var generatorvar=xml_doc.getElementsByTagName('generator');
  10. var docsvar=xml_doc.getElementsByTagName('docs');
  11. var guidvar=xml_doc.getElementsByTagName('guid');
  12. var categoryvar=xml_doc.getElementsByTagName('category');
  13. var pubDatevar=xml_doc.getElementsByTagName('pubDate');
  14.  
  15.  
  16. for (i=0;i<channelvar.length;i++)
  17.   {
  18.   if (channelvar[i].nodeType==1)
  19.     { 
  20. document.writeln(titlevar[i].childNodes[0].nodeValue + '<br>');
  21. document.writeln("<a href='" + linkvar[i].childNodes[0].nodeValue + "' target=_blank>" + linkvar[i].childNodes[0].nodeValue + "</a><br>");
  22. document.writeln(descriptionvar[i].childNodes[0].nodeValue + '<br>');
  23. document.writeln(languagevar[i].childNodes[0].nodeValue);
  24. document.writeln(copyrightvar[i].childNodes[0].nodeValue);
  25. document.writeln(lastBuildDatevar[i].childNodes[0].nodeValue);
  26. document.writeln(generatorvar[i].childNodes[0].nodeValue);
  27. document.writeln(docsvar[i].childNodes[0].nodeValue);
  28. document.writeln(guidvar[i].childNodes[0].nodeValue);
  29. document.writeln(categoryvar[i].childNodes[0].nodeValue);
  30. document.writeln(pubDatevar[i].childNodes[0].nodeValue + "<br>&nbsp;<br>");
  31.     }
  32.   }
  33.  
  34.  
As usual, thanks in advance for any help :-)
May 20 '07 #1
1 2067
Dököll
2,364 Expert 2GB
Hi!

I am not sure why it is not doing what you intended it to. Here's an RSS Feed validator site: http://www.feedvalidator.org/

Give it a go, see what comes up, ok!
Jul 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Brady Love | last post by:
I am currently working an an app that will post and edit blogs on blogger. Right now I have it so I can recive a list of the blogs and the content...
2
by: Pete.Cloth | last post by:
Can someone please help me with this. I need to align a picture onto a "blogger"? HELP!
3
by: Hymer | last post by:
Hello, I have a blog with link information at the bottom of each article. I just added a text-to-speech link from Talkr where you can "Listen to...
6
by: Jim | last post by:
I'm a newbie so I'm probably doing something simple and dumb but I just can't get Blogger to accept a JavaScript for/next loop. Here's what I've...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.