[script] Show homepage, order apps

This commit is contained in:
dkhamsing 2016-05-11 08:19:04 -07:00
parent c482b2a570
commit 1663806dbe

View File

@ -33,11 +33,11 @@ def output_flag(lang)
end end
def apps_for_cat(apps, id) def apps_for_cat(apps, id)
apps.select do |a| s = apps.select do |a|
cat = a['category'] cat = a['category']
# puts cat.class
cat.class == Array ? cat.include?(id) : (cat == id) cat.class == Array ? cat.include?(id) : (cat == id)
end end
s.sort_by { |k, v| k['title'] }
end end
def output_apps(apps) def output_apps(apps)
@ -46,6 +46,7 @@ def output_apps(apps)
name = a['title'] name = a['title']
link = a['source'] link = a['source']
itunes = a['itunes'] itunes = a['itunes']
homepage = a['homepage']
desc = a['description'] desc = a['description']
tags = a['tags'] tags = a['tags']
stars = a['stars'] stars = a['stars']
@ -73,6 +74,7 @@ def output_apps(apps)
o << "\n" o << "\n"
o << " - #{link}\n" o << " - #{link}\n"
o << " - #{homepage}\n" unless homepage.nil?
o << " - #{itunes}\n" unless itunes.nil? o << " - #{itunes}\n" unless itunes.nil?
end end
o o