diff --git a/.github/osia_get_links.rb b/.github/osia_get_links.rb index a41398fa..3572d3b0 100644 --- a/.github/osia_get_links.rb +++ b/.github/osia_get_links.rb @@ -1,7 +1,7 @@ require_relative 'osia_helper' -OUTPUT = 'check-unique.txt' # should be unique -HP = 'check-links.txt' # allow dupes +UNIQUES = 'check-unique.txt' # should be unique +LINKS = 'check-links.txt' # allow dupes def apps_archived(apps) a = apps.select {|a| a['tags'] != nil }.select {|b| b['tags'].include?'archive'} @@ -13,30 +13,31 @@ a = j['projects'] archived = apps_archived a active = a.reject { |x| archived.include? x } -links = [] +uniques = [] active.each do |z| - links.push z['source'] - links.push z['itunes'] unless z['itunes'].nil? + uniques.push z['source'] + uniques.push z['itunes'] unless z['itunes'].nil? + uniques.push z['screenshots'] unless z['screenshots'].nil? end -links.each_with_index { |z, i| puts "#{i+1} #{z}" } +uniques.each_with_index { |z, i| puts "#{i+1} #{z}" } -puts "Writing #{OUTPUT}" -File.open(OUTPUT, 'w') { |f| f.puts links } +puts "Writing #{UNIQUES}" +File.open(UNIQUES, 'w') { |f| f.puts uniques } -hp = [] +links = [] active.each do |z| - hp.push z['homepage'] unless z['homepage'].nil? - hp.push z['title'] unless z['title'].nil? - hp.push z['description'] unless z['description'].nil? + links.push z['homepage'] unless z['homepage'].nil? + links.push z['title'] unless z['title'].nil? + links.push z['description'] unless z['description'].nil? end c = j['categories'] c.each do |z| - hp.push z['title'] + links.push z['title'] end -hp.each_with_index { |z, i| puts "#{i+1} #{z}" } +links.each_with_index { |z, i| puts "#{i+1} #{z}" } -puts "Writing #{HP}" -File.open(HP, 'w') { |f| f.puts hp } +puts "Writing #{LINKS}" +File.open(LINKS, 'w') { |f| f.puts links }