Accessing remote XML files like Netvibes.com does

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • carllucas
    New Member
    • Oct 2006
    • 35

    #1

    Accessing remote XML files like Netvibes.com does

    I would like to create my onw rss feed reader. I've been able to get as far as being able to fetch parse and print news stories form various different sources however I have a big problem.

    When I try to run it online I get an "access denied" error. There reason for this error I know is that most browers have a security setting that won't allow you to access files across servers.

    In order to get the javascript to work I have to change my security setting to below recommended level. It also means that other people would have to do this which doesn't really fly.

    How can I work around this. How do sites like netvibes.com do it for example?

    Thanks
  • b1randon
    Recognized Expert New Member
    • Dec 2006
    • 171

    #2
    Originally posted by carllucas
    I would like to create my onw rss feed reader. I've been able to get as far as being able to fetch parse and print news stories form various different sources however I have a big problem.

    When I try to run it online I get an "access denied" error. There reason for this error I know is that most browers have a security setting that won't allow you to access files across servers.

    In order to get the javascript to work I have to change my security setting to below recommended level. It also means that other people would have to do this which doesn't really fly.

    How can I work around this. How do sites like netvibes.com do it for example?

    Thanks
    This is one of the most restrictive boundaries to Web 2.0 projects. Because of the cross-site scripting restriction you'll have to make a call (probably AJAX) to your sever where you can aggregate data from outside resources, pack it up in XML and send it back to the browser. Such a pain, but it is a reality you have to work with.

    Comment

    • carllucas
      New Member
      • Oct 2006
      • 35

      #3
      Originally posted by b1randon
      This is one of the most restrictive boundaries to Web 2.0 projects. Because of the cross-site scripting restriction you'll have to make a call (probably AJAX) to your sever where you can aggregate data from outside resources, pack it up in XML and send it back to the browser. Such a pain, but it is a reality you have to work with.
      Thanks, B1randon. What sort of call to my server do I have to make that will allow me to aggregate data from remote sources, and how do I do this? And how do I "pack it up in XML"?

      Have you been able to do it this way?

      Comment

      • elgemcdlf
        New Member
        • Jan 2007
        • 7

        #4
        Pull your data down totally independant from any browser. Parse and temp write your data to a directory on your web server with a PUT command and then pull the data into your site. If you look into MSXML3 , 4, 6 (MS really dropped the ball on this one) 6 is an upgrade of 4 not a complete stand alone install and 4 is the same of 3 so you have to install all 3 as I understand it for it to work. Actually you could just run the script from the webserver (eliminating the PUT command portion) and trigger it from a JS in your site. I can post some basic code for pulling the data down to a local level if you need it. I am using the code in Lotus Approach so it is Lotus Script but very similiar to JS and VBS. Should not be a big deal to convert.

        Comment

        • carllucas
          New Member
          • Oct 2006
          • 35

          #5
          Elgemcdlf, I gather from what you're saying that the way to get around this is to use cgi to fetch and parse the data then just display it from my server, right? This might be the way I'll have to do it.

          But is still begs the question as to how Netvibes is able to get you to enter in a remote xml file from anywhere and it parses it for you live.

          It's generous of you to offer to share your code. It would be very helpful. Thanks.

          Comment

          • elgemcdlf
            New Member
            • Jan 2007
            • 7

            #6
            It has been awhile since I have done any Net type work. Basically what happens at the site you are exampling is they are most likely running a SOAP engine. Probably AXIS on an Apache server. You are sending a SOAP request and it has a return (response). Both of which are XML format. So if you are submitting an XML doc it is taking that doc and parsing it out to display in a web page? The way that works is the elements are put into id'd areas of a page.

            Perhaps I am not fully understanding what you are trying to do. I thought you were trying to retrieve data from a server to use as content in your site. If so you just use something like:

            Dim xml
            Dim http

            Set xml = CreateObject("M SXML2.DOMDocume nt")
            xml= "whatever_you_d esire_to_send_a s_a_string"

            Set http = CreateObject("M icrosoft.XMLHTT P")
            http.open "POST", "whoever_you_ar e_connecting_to "
            http.send xml

            While http.readyState <> 4
            Wend
            Msgbox http.responseTe xt, , "Output SOAP Message"

            There are variations of this snippet but this is basically what takes place. This runs from MSXML3. Once you had this coded the way you needed simply write a snippet of JS that would call it from your page and then another that would take the results and place them on your page.

            You could do an OnLoad() with JS calling a cgi script that utilized something like this that also had functions that parsed out the XML and then placed it into your page. There may be an easier way but I am working from a app to app mentality. I am pulling info from servers connected to the Net and using that data in my app. The above is VBS style. If you are on a UNIX or Linux server best written in perl but I think you should have an idea now. Either that or I simply made it more confusing :)

            Comment

            • carllucas
              New Member
              • Oct 2006
              • 35

              #7
              Okay, I'm going to look into "SOAP" since I've heard quite a bit about it. Thanks again.

              Comment

              Working...