Update fetch-samplecode.sh
This commit is contained in:
parent
b9bc5c12e1
commit
8ecca5841f
|
@ -8,7 +8,7 @@ CSV.open('samplecode.csv', 'wb') do |csv|
|
||||||
JSON.parse(File.open('search_result.json').read)['results'].keep_if {|v|
|
JSON.parse(File.open('search_result.json').read)['results'].keep_if {|v|
|
||||||
v['type'] == 'sample_code'
|
v['type'] == 'sample_code'
|
||||||
}.sort_by {|x| x['title']}.each{|sc|
|
}.sort_by {|x| x['title']}.each{|sc|
|
||||||
csv << [sc['url'].match('\/samplecode\/([^\/]*)\/')[1], 'https://developer.apple.com' + sc['url'] + 'Introduction/Intro.html']
|
csv << [sc['url'].match('\/samplecode\/([^\/]*)\/')[1], 'https://developer.apple.com' + sc['url'] + 'Introduction/Intro.html', sc['title']]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
"
|
"
|
||||||
|
|
Loading…
Reference in New Issue