How To Pull Information From XML File

Comments

8 comments

  • John Sawyer

    Hey Faisal, did you find an answer to this?

    0
    Comment actions Permalink
  • Andreas Forstinger

    Hi,
    I think you could have it with some API coding. With a hook you could retrieve the XML in a script, extract the wanted value and store it in some field of the item.
    Regards

    0
    Comment actions Permalink
  • PHG Admin

    Working the issue now however Podio is rejecting the XMLHttpRequest as "undefined". Pre-pending "window.document" is similarly rejected.  Thoughts?

    0
    Comment actions Permalink
  • Glauber Carvalho

    Did you guys figure it out? I have been trying to do for a while. Thanks. 

    0
    Comment actions Permalink
  • Carolin Grable

    Anyone find a solution?

     

    0
    Comment actions Permalink
  • Juan Lazarde

    Keeping this alive. Has anyone found a solution?

    Avoiding Globiflow, I need to parse and find the information within the XML.

    Here's how I'm getting the XML link, using my own zws-ID from Zillow:

    ZillowXML_Link

          var str = @Property Address.join().split(",")[0].toString().split(' ').join('-');
          var zip = @Property Address.join().split(",")[2].toString().split(' ').join('-');
          "http://www.zillow.com/webservice/GetDeepSearchResults.htm?zws-id=X1-ZWz1a84vilprm3_82rpe&address="+str+"&citystatezip=" +zip

    So that gets me the link. Ideally, I would 'GET' the actual XML into a variable, but I'm not using Globiflow.

    I click on the Link, copy and paste the XML into a Text Variable, i.e. ZillowXML_Text.

    Then, I'd like to get the ZillowXML_Text parsed so I can get Zestimate for example:

    ...

    <zestimate>
    <amount currency="USD">136905</amount>
    ....
     
    Any help appreciated.
    0
    Comment actions Permalink
  • Gus H.

    This has been discussed on the GF Forum. Plz do a search for ZESTIMATE in the forum, and you will get a few discussions on that. Have fun digesting it. 

    0
    Comment actions Permalink
  • Juan Lazarde

    Thanks Gus.

     

    Wanted to share the code I came up with, it works (no GlobiFlow) and it's inspired on the work by sensei Rainer (link here).

    //Manual Zillow Pull from XML

    //STEP 1: Create Calculated field, I called it: 'Zillow XML Link'
    //Get the XML data from here
    var dummy = @Unique ID
    "http://www.zillow.com/webservice/GetDeepSearchResults.htm?
    zws-id=[YOUR API GOES HERE]&address=1828-Spindrift-Dr&citystatezip=92037"

    //STEP 2: Paste your XML data into a Text Box
    // I called it 'Zillow XML Paste'

    //STEP 3: Create Calculated field, I called it: 'Zillow TakeMeAtFaceValue'
    function findString(string) {
    var a = @Zillow XML Paste; // a is the whole text
    var b = "<" + string + ">"; // b is the search string
    var c = b.length; // c is length of b
    var d = a.indexOf(b); // d is the 1st position of b
    var e = c + d; // e is the last position of b
    var f = a.indexOf('<', e+1); // f is the next XML tag
    return a.substr(e, f-e).replace("\n"," "); // finds the text
    };

    // Find all these items in the XML tags
    var strings = [
    ["homedetails", "Zillow Link"],
    ["comparables", "Comps"],
    ["street", "Street"],
    ["city", "City"],
    ["state", "State"],
    ["zipcode", "Zipcode"],
    ["latitude", "Lat"],
    ["longitude", "Lon"],
    ["zpid", "ZPID"],
    ["useCode", "Home Style"],
    ["taxAssessmentYear", "Tax Assessment Year"],
    ["taxAssessment", "Tax Assessment"],
    ["lotSizeSqFt", "Lot (sqft)"],
    ["finishedSqFt", "Floor Size (sqft)"],
    ["bathrooms", "Bathroom(s)"],
    ["bedrooms", "Bedroom(s)"],
    ["lastSoldDate", "Last Sold Date"],
    ["lastSoldPrice currency=\"USD\"", "Last Sold Price"],
    ["amount currency=\"USD\"", "Zestimate"],
    ["last-updated", "Zestimate Update Date"],
    ["zindexValue", "Zindex"]
    ];
    var show = "";

    try {
    for (var i =0; i < strings.length; i++) {
    show += strings[i][1] + ": " + findString(strings[i][0]) + "\n";
    };
    } catch(e) {
    "N/A";
    };

    Here's what you get:

    Zillow Link: https://www.zillow.com/homedetails/1828-Spindrift-Dr-La-Jolla-CA-92037/16839116_zpid/
    Comps: http://www.zillow.com/homes/comps/16839116_zpid/
    Street: 1828 Spindrift Dr
    City: LA JOLLA
    State: CA
    Zipcode: 92037
    Lat: 32.850627
    Lon: -117.263058
    ZPID: 16839116
    Home Style: SingleFamily
    Tax Assessment Year: 2017
    Tax Assessment: 1.0139323E7
    Lot (sqft): 23522
    Floor Size (sqft): 11145
    Bathroom(s): 5.0
    Bedroom(s): 5
    Last Sold Date: 07/31/1998
    Last Sold Price: 2590000
    Zestimate: 14849678
    Zestimate Update Date: 09/10/2018
    Zindex: 1,742,900
    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk