Skip to content

Commit 8591b37

Browse files
committed
rename script
Signed-off-by: Liu Lantao <[email protected]>
1 parent 4a3454b commit 8591b37

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

_META/fetch-samplecode.sh renamed to .scripts/fetch-samplecode.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

3-
curl 'https://developer.apple.com/search/search_data.php?q=swift%203&results=500' -s -e developer.apple.com -o search_result.json
3+
curl 'https://developer.apple.com/search/search_data.php?q=swift%203&results=500' -s -e developer.apple.com -o /tmp/search_result.json
44

55
ruby -e "require 'json';
66
require 'csv';
7-
CSV.open('samplecode.csv', 'wb') do |csv|
8-
JSON.parse(File.open('search_result.json').read)['results'].keep_if {|v|
7+
CSV.open('_projects.csv', 'wb') do |csv|
8+
JSON.parse(File.open('/tmp/search_result.json').read)['results'].keep_if {|v|
99
v['type'] == 'sample_code'
1010
}.sort_by {|x| x['title']}.each{|sc|
1111
csv << [sc['url'].match('\/samplecode\/([^\/]*)\/')[1], 'https://developer.apple.com' + sc['url'] + 'Introduction/Intro.html', sc['title']]
File renamed without changes.

0 commit comments

Comments
 (0)