2016-06-07 15:53:14 +02:00
|
|
|
require_relative 'osia_helper'
|
|
|
|
|
2016-08-10 16:39:26 +02:00
|
|
|
UNIQUES = 'check-unique.txt' # should be unique
|
|
|
|
LINKS = 'check-links.txt' # allow dupes
|
2016-06-07 15:53:14 +02:00
|
|
|
|
|
|
|
def apps_archived(apps)
|
|
|
|
a = apps.select {|a| a['tags'] != nil }.select {|b| b['tags'].include?'archive'}
|
|
|
|
a.sort_by { |k, v| k['title'] }
|
|
|
|
end
|
|
|
|
|
|
|
|
j = get_json
|
|
|
|
a = j['projects']
|
|
|
|
archived = apps_archived a
|
2016-06-07 16:43:32 +02:00
|
|
|
active = a.reject { |x| archived.include? x }
|
2016-06-07 15:53:14 +02:00
|
|
|
|
2016-08-10 16:39:26 +02:00
|
|
|
uniques = []
|
2016-06-07 16:43:32 +02:00
|
|
|
active.each do |z|
|
2016-08-10 16:39:26 +02:00
|
|
|
uniques.push z['source']
|
|
|
|
uniques.push z['itunes'] unless z['itunes'].nil?
|
|
|
|
uniques.push z['screenshots'] unless z['screenshots'].nil?
|
2016-06-07 16:43:32 +02:00
|
|
|
end
|
|
|
|
|
2016-08-10 16:39:26 +02:00
|
|
|
uniques.each_with_index { |z, i| puts "#{i+1} #{z}" }
|
2016-06-07 15:53:14 +02:00
|
|
|
|
2016-08-10 16:39:26 +02:00
|
|
|
puts "Writing #{UNIQUES}"
|
|
|
|
File.open(UNIQUES, 'w') { |f| f.puts uniques }
|
2016-06-08 05:05:24 +02:00
|
|
|
|
2016-08-10 16:39:26 +02:00
|
|
|
links = []
|
2016-06-08 05:05:24 +02:00
|
|
|
active.each do |z|
|
2016-08-10 16:39:26 +02:00
|
|
|
links.push z['homepage'] unless z['homepage'].nil?
|
|
|
|
links.push z['title'] unless z['title'].nil?
|
|
|
|
links.push z['description'] unless z['description'].nil?
|
2016-08-05 21:47:23 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
c = j['categories']
|
|
|
|
c.each do |z|
|
2016-08-10 16:39:26 +02:00
|
|
|
links.push z['title']
|
2016-06-08 05:05:24 +02:00
|
|
|
end
|
|
|
|
|
2016-08-10 16:39:26 +02:00
|
|
|
links.each_with_index { |z, i| puts "#{i+1} #{z}" }
|
2016-06-08 05:05:24 +02:00
|
|
|
|
2016-08-10 16:39:26 +02:00
|
|
|
puts "Writing #{LINKS}"
|
|
|
|
File.open(LINKS, 'w') { |f| f.puts links }
|