Skip to content

Instantly share code, notes, and snippets.

@nuex
Created September 19, 2008 18:26
Show Gist options
  • Select an option

  • Save nuex/11630 to your computer and use it in GitHub Desktop.

Select an option

Save nuex/11630 to your computer and use it in GitHub Desktop.
little lib for parsing Yahoo! Store XML
require 'rubygems'
require 'roxml'
class Pricing
include ROXML
xml_name "Pricing"
xml_text :base_price, "BasePrice"
xml_text :localized_base_price, "LocalizedBasePrice"
end
class ProductRef
include ROXML
xml_name "ProductRef"
xml_attribute :id, "Id"
xml_attribute :url, "Url"
end
class Path
include ROXML
xml_name "Path"
xml_object :product_ref, ProductRef
end
class Product
include ROXML
xml_name "Product"
xml_attribute :id, "Id"
xml_text :code, "Code"
xml_text :description, "Description"
xml_text :url, "Url"
xml_text :thumb, "Thumb", ROXML::TAG_CDATA
xml_text :picture, "Picture", ROXML::TAG_CDATA
xml_text :weight, "Weight"
xml_text :orderable, "Orderable"
xml_text :taxable, "Taxable"
xml_text :caption, "Caption"
xml_object :path, Path
xml_object :pricing, Pricing
end
class StoreExport
include ROXML
xml_name "StoreExport"
xml_object :products, Product, ROXML::TAG_ARRAY, "Products"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment