Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Is this possible?
05-15-2012, 10:44 PM #1
- Join Date
- Sep 2008
- Thanked 0 Times in 0 Posts
Is this possible?
I've got a used car website, and I'm working on importing XML listing feeds automatically using cron jobs (pardon me if my use of terminology is a bit off... I'm new to this XML and cron job stuff). The problem is, many of the services that compile feeds for local dealers send out their listings in TXT format. They can do XML, but it comes at an additional cost.
Here's the basic format that I'm looking to use:
<listing> <id>6115</id> <year>2001</year> <make>Honda</make> <model>Civic</model> <title>2001 Honda Civic DX-A</title> <price>11860</price> <bodystyle>Sedan</bodystyle> <mileage>81780</mileage> <transmission>Manual</transmission> <doors>4</doors> <color>Grey</color> <interior_color>Black</interior_color> </listing>
Dealer_ID|Company_Name|Company_Address|Company_City|Company_State|Company_Zip|Company_Phone|Listing_ID|VIN|New_Used|Stock_No|Year|Make|Model|Body_Style|Doors|Trim|Ext_Color|Int_Color|Engine|Fuel|Drivetrain|Transmission|Mileage|Internet_Price|Certified|Options|Description|Photo_URLs 16661|"Sunset Motors"|"447 N.Okatie Hwy"|Ridgeland|SC|29936|843-705-5959|4228341|1B3EL46X15N504836|Used|12040|2005|Dodge|"Stratus Sdn"|Sedan|4|"4dr SXT"|Red|Gray|"4 Cylinder Engine"|Gas||A|135065|6995||"Cruise Control,Power Steering,Air Conditioning,Power Driver Mirror,Power Passenger Mirror,Steering wheel controls,Keyless Entry,Tilt Wheel,Alloy Ladder,Alloy Wheels,Auxiliary Power Oulet,Flex Fuel,Sunroof/Moonroof,Fog Lamps,Driver Air Bag,Power Door Locks,Emergency Trunk Release,Vehicle Anti-Theft System,Traction Control,Alarm,Side Air Bag,Passenger Air Bag,Child Safety Lock,Leather Seats,Bucket Seats,Power Driver Seat,Satellite Radio,AM/FM Stereo,CD Changer,CD Player,Power Windows,Rear Window Defroster"||http://images.v12soft.com/photos/5iOQx7e/4228341/199983_800600.jpg,http://images.v12soft.com/photos/5iOQx7e/4228341/097276_800600.jpg,http://images.v12soft.com/photos/5iOQx7e/4228341/246306_800600.jpg,http://images.v12soft.com/photos/5iOQx7e/4228341/356059_800600.jpg,http://images.v12soft.com/photos/5iOQx7e/4228341/416253_800600.jpg,http://images.v12soft.com/photos/5iOQx7e/4228341/587170_800600.jpg,http://images.v12soft.com/photos/5iOQx7e/4228341/631097_800600.jpg,http://images.v12soft.com/photos/5iOQx7e/4228341/724656_800600.jpg,http://images.v12soft.com/photos/5iOQx7e/4228341/839183_800600.jpg,http://images.v12soft.com/photos/5iOQx7e/4228341/944682_800600.jpg,http://images.v12soft.com/photos/5iOQx7e/4228341/1097494_800600.jpg,http://images.v12soft.com/photos/5iOQx7e/4228341/1184863_800600.jpg
Thanks for any advice you guys can offer.
05-16-2012, 02:16 AM #2
- Join Date
- May 2002
- Hayward, CA
- Thanked 24 Times in 22 Posts
The answer is yes, there should be ways to do that via a cron job. But you're probably going to need a different set of skills.
I'd recommend writing a Python script to do the hard work. You'll need four things:
- Fetch the text file, preferably via FTP (HTTP will work too)
- Read the contents of the text and parse it
- Write the output XML to a file
- Scheduling the cron job to run the Python script
I wouldn't do it by Excel - that's more work for you and for your computer. Python should be more than capable of that. Perl will also work, as will PHP.