Evening Reading

by Brian Leahy, Jan 03, 2011 5:00pm PST

Oh boy! It's 2011 and it's time for gaming to ramp up again before the summer slump. There are a lot of great games coming out early this year and I'm definitely looking forward to LittleBigPlanet 2, Dead Space 2, and Marvel vs. Capcom 3. And that's just in the coming weeks!

Also, the first league of the 2011 GSL StarCraft II season has started with games already in the books and available as VODs. Access will cost you $10 with ads or $20 without.

Gaming News of the Day

Links from Morning Discussion




  • Ruby XML Parsing with Nokugiri/Xpath question in reply.

    Thread Truncated. Click to see all 2 replies.

    • I have a shopify store that I want to automatically update the product variants inventory levels with, using a live xml feed from the wholesaler I use.

      I'm learning to program (Ruby) and this is my first project, but after researching here is how I think it should work.

      Use Ruby/Nokugiri to parse the XML feed from the wholesaler, and then Xpath to locate both the unique product variant SKU code, and the stock level.

      Somehow I need to use this SKU to refer back to my Shopify store product XML list, and pull out the variants unique ID using the SKU code.

      Then use something like the builder gem to build the XML format that shopify needs, and then use curl to PUT the changes. I'm guessing I loop this process for every product?

      I know Shopify only has a 300 call limit, so I've got the article on putting a delay in the script, but I get the feeling the above method isn't the easiest way to go about this?

      With Shopify you need to apply the variant stock level update against unique variant xml files, so I need to build the unique xml file/code and PUT it against /admin/variants/thevariantid].xml

      I'm looking forward to trying to put this together and learning in the process, but am I on the right track with this? Are there simpler gems I should be looking at?

      n.b I've only recently started learning Ruby, and will head to Rails afterwards. I know a bit about XML and it's structure so should be ok finding what I need with XPath.