Skip to content

Commit 787bb47

Browse files
committed
Modified fetch.sh to grab reference from arduino.cc and to automatically create reference.zip.
1 parent 518812a commit 787bb47

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

build/fetch.sh

+20-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
curl http://arduino.berlios.de/index.php/Main/Howto -o howto.html
2-
curl http://arduino.berlios.de/index.php/Reference/HomePage -o index.html
3-
curl http://arduino.berlios.de/pub/skins/arduino/arduino.css -o arduino.css
4-
for i in `grep -o "http://arduino.berlios.de/index.php/Reference/[^']*" index.html | sort -u | grep -v '?' | cut -d '/' -f 6`; do curl http://arduino.berlios.de/index.php/Reference/$i -o $i.html; done
5-
perl -i -pe "s|http://arduino.berlios.de/index.php/Reference/[^?\"']*\?[^'\"]*|#|g" *.html
6-
perl -i -pe "s|http://arduino.berlios.de/index.php/Reference/([^']*)|\1.html|g" *.html
7-
perl -i -pe "s|http://arduino.berlios.de/pub/skins/arduino/arduino.css|arduino.css|g" *.html
1+
#!/bin/sh
2+
3+
# fetch.sh
4+
# David A. Mellis
5+
# Script to download reference pages from Arduino website and change links
6+
# to point to local copies of the pages. A terrible hack.
7+
8+
mkdir reference
9+
cd reference
10+
curl http://www.arduino.cc/en/Main/Howto -o howto.html
11+
curl http://www.arduino.cc/en/Reference/HomePage -o index.html
12+
curl http://www.arduino.cc/en/pub/skins/arduino/arduino.css -o arduino.css
13+
for i in `grep -o "http://www.arduino.cc/en/Reference/[^']*" index.html | sort -u | grep -v '?' | cut -d '/' -f 6`; do curl http://www.arduino.cc/en/Reference/$i -o $i.html; done
14+
perl -i -pe "s|http://www.arduino.cc/en/Reference/[^?\"']*\?[^'\"]*|#|g" *.html
15+
perl -i -pe "s|http://www.arduino.cc/en/Reference/([^']*)|\1.html|g" *.html
16+
perl -i -pe "s|http://www.arduino.cc/en/pub/skins/arduino/arduino.css|arduino.css|g" *.html
817
perl -i -pe "s|HomePage.html|index.html|g" *.html
9-
perl -i -pe "s|/\\?PHPSESSID=[^\"]*|http://arduino.berlios.de/|g" *.html
18+
perl -i -pe "s|href=\"/\"|href=\"http://www.arduino.cc/\"|g" *.html
19+
cd ..
20+
zip -r shared/reference.zip reference
21+
rm -rf reference

0 commit comments

Comments
 (0)