Update fetch-samplecode.sh

This commit is contained in:
Liu Lantao 2016-12-24 21:15:23 +08:00 committed by GitHub
parent b9bc5c12e1
commit 8ecca5841f
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ CSV.open('samplecode.csv', 'wb') do |csv|
JSON.parse(File.open('search_result.json').read)['results'].keep_if {|v|
v['type'] == 'sample_code'
}.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
"