App-Open-Source-per-iPhone-.../.github/osia_get_links.rb

25 lines
537 B
Ruby
Raw Normal View History

2016-06-07 15:53:14 +02:00
require_relative 'osia_helper'
OUTPUT = 'temp-links'
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-06-07 16:43:32 +02:00
links = []
active.each do |z|
links.push z['source']
links.push z['itunes'] unless z['itunes'].nil?
end
links.each_with_index { |z, i| puts "#{i+1} #{z}" }
2016-06-07 15:53:14 +02:00
puts "Writing #{OUTPUT}"
File.open(OUTPUT, 'w') { |f| f.puts links }