Skip to content

Commit

Permalink
Dekker's requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rickyrobinson committed Jan 21, 2012
1 parent effbf65 commit 7461832
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/yelp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ def extract_categories items, parent = nil
if item.name == "li"
key = item.content.match(/\((.*)\)/)[1]
name = item.content.match(/^(.*) \(/)[1]
cats << {:key => key, :name => name, :parent => parent}
prev = key
short_name = name.split[0]
prev = {:key => key, :name => name, :shortName => short_name, :parent => parent[:key], :numChildren => 0, :icon => "https://foursquare.com/img/categories/arts_entertainment/arcade_32.png"}
cats << prev
parent[:numChildren] += 1
elsif item.name == "ul"
subcats = self.extract_categories item.children, prev
cats += subcats
Expand Down

0 comments on commit 7461832

Please sign in to comment.