[script] update how to check itunes links

This commit is contained in:
Daniel Khamsing 2016-08-15 10:20:00 -07:00
parent cf7ca61552
commit 9aa28c1526
1 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,7 @@ require_relative 'osia_helper'
UNIQUES = 'check-unique.txt' # should be unique
LINKS = 'check-links.txt' # allow dupes
INFO = 'check-info.txt' # errors are allowed
def apps_archived(apps)
a = apps.select {|a| a['tags'] != nil }.select {|b| b['tags'].include?'archive'}
@ -14,10 +15,11 @@ archived = apps_archived a
active = a.reject { |x| archived.include? x }
uniques = []
info = []
active.each do |z|
uniques.push z['source']
uniques.push z['itunes'] unless z['itunes'].nil?
uniques.push z['screenshots'] unless z['screenshots'].nil?
info.push z['itunes'] unless z['itunes'].nil?
end
uniques.each_with_index { |z, i| puts "#{i+1} #{z}" }
@ -25,6 +27,9 @@ uniques.each_with_index { |z, i| puts "#{i+1} #{z}" }
puts "Writing #{UNIQUES}"
File.open(UNIQUES, 'w') { |f| f.puts uniques }
puts "Writing #{INFO}"
File.open(INFO, 'w') { |f| f.puts info }
links = []
active.each do |z|
links.push z['homepage'] unless z['homepage'].nil?