XML feed help please!! urgent....

8 replies
Ok, so I am getting a feed that has about 2,000 listings on it, it is very important for my business....

I am having to parse out the title of each listing into city and state, as there is actually not a field separate for those 2 items.

There is one big problem with the feed however, the feed is not consistent... Sometimes the city is first in the title, and sometimes the state is first in the title... This is making a lot of the 2,000 listings pop up on incorrect city and state pages on my website...

can someone help me? how can I fix this?
#feed #urgent #xml
  • Profile picture of the author kilgore
    Lots of ways to approach this one. But really, you might want to post this in the "Programming" subforum.

    Anyway, I'd probably start by doing something like creating an array of states. Then I'd do a search of your city/state field against this list of states. If there's a match, I'd assume that's the state and then I'd assume the rest of the text is the city. If I didn't get a match, I'd flag the record as an error so that I could manually edit it. Something like that at any rate.

    But anyway, it's impossible to really say without seeing your data or knowing what tool(s)/language(s. you're using.
    {{ DiscussionBoard.errors[10394122].message }}
    • Profile picture of the author David Beroff
      Originally Posted by kilgore View Post

      ...I'd do a search of your city/state field against this list of states. If there's a match, I'd assume that's the state and then I'd assume the rest of the text is the city.
      Originally Posted by thedark View Post

      As kilgore suggested the best approach is to have an array with state values and do a simple check. If the first item is in array, then it is a state, if not it is a city.
      And I just happen to live in Wyoming, PA (USA), which would totally break that; LOL! (And yes, the state was named after the region in Pennsylvania; source.)
      Signature
      Put MY voice on YOUR video: AwesomeAmericanAudio.com
      {{ DiscussionBoard.errors[10394955].message }}
  • Profile picture of the author austine3859
    my website is mobilehomesforsale.com

    Here is the feed im using...
    https://www.vmfhomes.com/Content/Feeds/rss.xml
    Signature

    I need GOOD real estate links for my nationwide real estate site...

    Mobile Homes for sale

    {{ DiscussionBoard.errors[10394220].message }}
  • Profile picture of the author thedark
    As kilgore suggested the best approach is to have an array with state values and do a simple check. If the first item is in array, then it is a state, if not it is a city.
    Signature

    Automatically add affiliate links in your website content with Auto Affiliate Links

    {{ DiscussionBoard.errors[10394275].message }}
  • Profile picture of the author robomedia
    Are you sure your code is ok ?
    I just tried that feed and it looks state is always in first position.
    Try this [PHP] <?php $xml = simplexml_load_file("https://www.vmfhomes.com/Content/Feeds/rss. - Pastebin.com - it will echo all items where state is not found.
    {{ DiscussionBoard.errors[10394382].message }}
  • Profile picture of the author austine3859
    Hmm... this is all great info.. I am trying to learn as fast as I can, also going to forward this to my developer guy as a lot of this is over my head...

    However, you can view my state page of Texas for example
    Mobile Homes For Sale In Texas

    Scroll down, and you can see that many listings show up in texas that should not be showing up on this state page....
    Signature

    I need GOOD real estate links for my nationwide real estate site...

    Mobile Homes for sale

    {{ DiscussionBoard.errors[10394402].message }}
    • Profile picture of the author KirkMcD
      It seems more like whatever function that is displaying by city doesn't work correctly.
      {{ DiscussionBoard.errors[10395220].message }}
  • Profile picture of the author austine3859
    The problem is figured out!! i got it guys. Thanks for advice, it actually led me to diagnose the problem and sit my butt down and figure it out... The bad news is it will take me about 6-12 hours to complelely fix ha...
    Signature

    I need GOOD real estate links for my nationwide real estate site...

    Mobile Homes for sale

    {{ DiscussionBoard.errors[10396352].message }}

Trending Topics