1
0
mirror of https://github.com/dkhamsing/open-source-ios-apps.git synced 2025-01-10 07:27:08 +01:00

[script] get screenshots, cleanup

This commit is contained in:
Daniel Khamsing 2016-08-10 07:39:26 -07:00
parent e0d2e93ca8
commit 4f08ea107c

View File

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