2006-03-21 01:10:01 +01:00
#!/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.
2006-12-02 17:59:51 +01:00
REVISION = ` head -1 ../todo.txt | cut -c 1-4`
2006-03-21 01:10:01 +01:00
mkdir reference
cd reference
2006-11-20 19:27:37 +01:00
curl http://www.arduino.cc/en/Guide/HomePage -o Guide_index.html
2006-03-26 21:10:48 +02:00
curl http://www.arduino.cc/en/Main/FAQ -o FAQ.html
2006-04-14 13:55:06 +02:00
curl http://arduino.cc/en/Main/Environment -o environment.html
2007-03-04 19:06:00 +01:00
curl http://www.arduino.cc/en/Reference/HomePage -o index.html
2006-12-25 19:01:09 +01:00
curl http://www.arduino.cc/en/Reference/SoftwareSerial -o SoftwareSerial.html
2007-03-04 19:06:00 +01:00
curl http://www.arduino.cc/en/Reference/EEPROM -o EEPROM.html
2007-05-17 19:34:48 +02:00
curl http://www.arduino.cc/en/Reference/Stepper -o Stepper.html
2006-03-21 01:10:01 +01:00
curl http://www.arduino.cc/en/pub/skins/arduino/arduino.css -o arduino.css
2006-11-20 19:27:37 +01:00
for i in ` grep -o "http://www.arduino.cc/en/Guide/[^']*" Guide_index.html | sort -u | grep -v '?' | cut -d '/' -f 6` ; do curl http://www.arduino.cc/en/Guide/$i -o Guide_$i .html; done
2006-03-21 01:10:01 +01:00
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
2006-04-14 13:55:06 +02:00
for i in ` grep -o "http://www.arduino.cc/en/Serial/[^']*" index.html | sort -u | grep -v '?' | cut -d '/' -f 6` ; do curl http://www.arduino.cc/en/Serial/$i -o Serial_$i .html; done
2006-12-25 19:01:09 +01:00
for i in ` grep -o "http://www.arduino.cc/en/Reference/SoftwareSerial[^']*" SoftwareSerial.html | sort -u | grep -v '?' | cut -d '/' -f 6` ; do curl http://www.arduino.cc/en/Reference/$i -o $i .html; done
2007-03-04 19:06:00 +01:00
for i in ` grep -o "http://www.arduino.cc/en/Reference/EEPROM[^']*" EEPROM.html | sort -u | grep -v '?' | cut -d '/' -f 6` ; do curl http://www.arduino.cc/en/Reference/$i -o $i .html; done
2007-05-17 19:34:48 +02:00
for i in ` grep -o "http://www.arduino.cc/en/Reference/Stepper[^']*" Stepper.html | sort -u | grep -v '?' | cut -d '/' -f 6` ; do curl http://www.arduino.cc/en/Reference/$i -o $i .html; done
2006-04-14 13:55:06 +02:00
perl -i -pe "s|http://www.arduino.cc/en/Reference/[^?\"']*\?[^'\"]*|#|g" *.html # replace links to unknown pages with links to '#'
2006-11-20 19:27:37 +01:00
perl -i -pe "s|http://www.arduino.cc/en/Guide/([^']*)|Guide_\1.html|g" *.html # replace links to remote guide with links to local guide
2006-04-14 13:55:06 +02:00
perl -i -pe "s|http://www.arduino.cc/en/Reference/([^']*)|\1.html|g" *.html # replace links to remote reference with links to local reference
perl -i -pe "s|http://www.arduino.cc/en/Serial/([^']*)|Serial_\1.html|g" *.html # replace links to remove serial reference with links to local serial reference
2006-03-21 01:10:01 +01:00
perl -i -pe "s|http://www.arduino.cc/en/pub/skins/arduino/arduino.css|arduino.css|g" *.html
2006-01-13 01:03:30 +01:00
perl -i -pe "s|HomePage.html|index.html|g" *.html
2006-03-21 01:10:01 +01:00
perl -i -pe "s|href=\"/\"|href=\"http://www.arduino.cc/\"|g" *.html
cd ..
zip -r shared/reference.zip reference
2006-12-02 17:59:51 +01:00
rm -rf reference