Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RSS .xml with OpenInTbWebBrowser function
#1
Hi Gintaras,
I am not sure if this is way beyond the scope of QM (i.e. turning QM into an RSS reader) but I was just wondering whether it was possible to enhance the OpenInTbWebBrowser function to display RSS .xml files properly - it does such an amazing job with the already supported file formats: (htm, txt, doc, xls, pdf, gif, folder, etc).

In the meaningtime, I treid opening up Google Reader in a Toolbar with OpenInTbWebBrowser and it worked perfectly for all the RSS feeds. The only downside is that there is a login requirement. I will look through someof the free standalone RSS feedreaders and see if I can get them to show up in that QM window.

If any one has any suggestions, that would be great. Thanks!!

Stuart
#2
You can download the XML using IntGetFile. Then extract title, text (HTML), etc using IXml interface. Then create new html page with all the titles and text, and display it in the web browser control. Or just display single message (HTML) in the web browser control.
#3
Thanks Gintaras...
I started to make the code myself:

Macro
Code:
Copy      Help
str AJNR_RSS
IntGetFile "http://www.ajnr.org/rss/mfc.xml" AJNR_RSS


out
IXml x=CreateXml

x.FromFile(AJNR_RSS) ;;load XML file
err out "Error: %s" x.XmlParsingError; ret ;;error if the file is corrupted

But I am stuck at this point because I don't understand how to extract the html or other features using the IXml interface - I am a bit confused even after reading the documentation and looking around online...
Perhaps a simple example for me to "reverse engineer" to reach understanding.
Thanks,
Stuart
#4
Macro
Code:
Copy      Help
;download xml to AJNR_RSS
str AJNR_RSS
IntGetFile "http://www.ajnr.org/rss/mfc.xml" AJNR_RSS
;out AJNR_RSS
;out

;load into IXml
IXml x=CreateXml
x.FromString(AJNR_RSS)

;get all <item> nodes
ARRAY(IXmlNode) a
x.Path("rdf:RDF/item" a)

;extract <title> and other nodes and format html page in s
int i
str s title link descr
for i 0 a.len
,IXmlNode& n=a[i]
,title=n.Child("title").ChildValue("![")
,link=n.ChildValue("link")
,descr=n.Child("description").ChildValue("![")
,s.formata("<h3><a href=''%s''>%s</a></h3><p>%s</p><hr>[]" link title descr)

s-"<html><head></head><body>[]"
s+"</body></html>"
;out s

;save and run
str temp="$temp$\rss.htm"
s.setfile(temp)
run temp
#5
Very cool. I think I understand the IXml interface a little better. It's very cool to have a little RSS reader written in QM!
Thanks
Stuart


Forum Jump:


Users browsing this thread: 1 Guest(s)