1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-30 19:52:13 +01:00

Modified fetch.sh to grab reference from arduino.cc and to automatically create reference.zip.

This commit is contained in:
David A. Mellis 2006-03-21 00:10:01 +00:00
parent 518812a1e9
commit 787bb4762f

View File

@ -1,9 +1,21 @@
curl http://arduino.berlios.de/index.php/Main/Howto -o howto.html
curl http://arduino.berlios.de/index.php/Reference/HomePage -o index.html
curl http://arduino.berlios.de/pub/skins/arduino/arduino.css -o arduino.css
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
perl -i -pe "s|http://arduino.berlios.de/index.php/Reference/[^?\"']*\?[^'\"]*|#|g" *.html
perl -i -pe "s|http://arduino.berlios.de/index.php/Reference/([^']*)|\1.html|g" *.html
perl -i -pe "s|http://arduino.berlios.de/pub/skins/arduino/arduino.css|arduino.css|g" *.html
#!/bin/sh
# fetch.sh
# David A. Mellis
# Script to download reference pages from Arduino website and change links
# to point to local copies of the pages. A terrible hack.
mkdir reference
cd reference
curl http://www.arduino.cc/en/Main/Howto -o howto.html
curl http://www.arduino.cc/en/Reference/HomePage -o index.html
curl http://www.arduino.cc/en/pub/skins/arduino/arduino.css -o arduino.css
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
perl -i -pe "s|http://www.arduino.cc/en/Reference/[^?\"']*\?[^'\"]*|#|g" *.html
perl -i -pe "s|http://www.arduino.cc/en/Reference/([^']*)|\1.html|g" *.html
perl -i -pe "s|http://www.arduino.cc/en/pub/skins/arduino/arduino.css|arduino.css|g" *.html
perl -i -pe "s|HomePage.html|index.html|g" *.html
perl -i -pe "s|/\\?PHPSESSID=[^\"]*|http://arduino.berlios.de/|g" *.html
perl -i -pe "s|href=\"/\"|href=\"http://www.arduino.cc/\"|g" *.html
cd ..
zip -r shared/reference.zip reference
rm -rf reference