diff --git a/_META/fetch-samplecode.sh b/_META/fetch-samplecode.sh new file mode 100755 index 00000000..0277a805 --- /dev/null +++ b/_META/fetch-samplecode.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +curl 'https://developer.apple.com/search/search_data.php?q=swift%203&results=500' -s -e developer.apple.com -o search_result.json + +ruby -e "require 'json'; +require 'csv'; +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'] + } +end +" diff --git a/_META/samplecode.csv b/_META/samplecode.csv new file mode 100644 index 00000000..eb8f0bcf --- /dev/null +++ b/_META/samplecode.csv @@ -0,0 +1,25 @@ +avloopplayer,https://developer.apple.com/library/content/samplecode/avloopplayer/Listings/../Introduction/Intro.html +avexporter,https://developer.apple.com/library/content/samplecode/avexporter/Listings/../Introduction/Intro.html +AVFoundationSimplePlayer-iOS,https://developer.apple.com/library/content/samplecode/AVFoundationSimplePlayer-iOS/Listings/../Introduction/Intro.html +ReaderWriter,https://developer.apple.com/library/content/samplecode/ReaderWriter/Listings/../Introduction/Intro.html +AdaptiveElements,https://developer.apple.com/library/content/samplecode/AdaptiveElements/Listings/../Introduction/Intro.html +AdoptingMetalII,https://developer.apple.com/library/content/samplecode/AdoptingMetalII/Listings/../Introduction/Intro.html +DemoBots,https://developer.apple.com/library/content/samplecode/DemoBots/Listings/../Introduction/Intro.html +Fox,https://developer.apple.com/library/content/samplecode/Fox/Listings/../Introduction/Intro.html +IntentHandling,https://developer.apple.com/library/prerelease/content/samplecode/IntentHandling/Listings/../Introduction/Intro.html +Lister,https://developer.apple.com/library/content/samplecode/Lister/Listings/../Introduction/Intro.html +MPSCNNHelloWorld,https://developer.apple.com/library/content/samplecode/MPSCNNHelloWorld/Listings/../Introduction/Intro.html +MPSMatrixMultiplicationSample,https://developer.apple.com/library/content/samplecode/MPSMatrixMultiplicationSample/Listings/../Introduction/Intro.html +MetalImageFilters,https://developer.apple.com/library/content/samplecode/MetalImageFilters/Listings/../Introduction/Intro.html +MetalImageRecognition,https://developer.apple.com/library/content/samplecode/MetalImageRecognition/Listings/../Introduction/Intro.html +PrintPhoto,https://developer.apple.com/library/content/samplecode/PrintPhoto/Listings/../Introduction/Intro.html +Scoreboard,https://developer.apple.com/library/content/samplecode/Scoreboard/Listings/../Introduction/Intro.html +ShapeEdit,https://developer.apple.com/library/content/samplecode/ShapeEdit/Listings/../Introduction/Intro.html +SimpleTunnel,https://developer.apple.com/library/content/samplecode/SimpleTunnel/Listings/../Introduction/Intro.html +SpeakToMe,https://developer.apple.com/library/content/samplecode/SpeakToMe/Listings/../Introduction/Intro.html +TVMLGuide,https://developer.apple.com/library/content/samplecode/TVMLGuide/Listings/../Introduction/Intro.html +TalkingToTheLiveView,https://developer.apple.com/library/content/samplecode/TalkingToTheLiveView/Listings/../Introduction/Intro.html +ToolbarSample,https://developer.apple.com/library/content/samplecode/ToolbarSample/Listings/../Introduction/Intro.html +TouchCanvas,https://developer.apple.com/library/prerelease/content/samplecode/TouchCanvas/Listings/../Introduction/Intro.html +UICatalog,https://developer.apple.com/library/content/samplecode/UICatalog/Listings/../Introduction/Intro.html +UnicornChat,https://developer.apple.com/library/content/samplecode/UnicornChat/Listings/../Introduction/Intro.html