OER in Education:TODO/Gateway

From OER in Education
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The script below produces gateway timeouts.

#!/usr/bin/perl
foreach (<DATA>) {
    s/\n//;
    $i++;
    mkdir("pages") if !-e "pages";
    system("wget -O pages/$i.html '$_' &");
};

__DATA__
http://oer.educ.cam.ac.uk/wiki/OER4Schools#menuexpand                                                                                                                                                   
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Overview
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Detailed_outline
http://oer.educ.cam.ac.uk/wiki/OER4Schools/How_to_use_this_resource
http://oer.educ.cam.ac.uk/wiki/OER4Schools/How_to_run_workshops
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Further_links
http://oer.educ.cam.ac.uk/wiki/OER4Schools/toc
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Introduction_to_interactive_teaching_and_the_use_of_ICT
http://oer.educ.cam.ac.uk/wiki/OER4Schools/What_is_interactive_teaching
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Introduction_to_interactive_teaching_with_ICT
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Activity_planning_and_reflection
http://oer.educ.cam.ac.uk/wiki/OER4Schools/ICTs_in_interactive_teaching
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Effective_use_of_ICT
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Leadership_for_Learning
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Whole_class_dialogue_and_effective_questioning
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Introduction_to_whole_class_dialogue_and_effective_questioning
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Questioning
http://oer.educ.cam.ac.uk/wiki/OER4Schools/More_on_questioning
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Concept_mapping
http://oer.educ.cam.ac.uk/wiki/OER4Schools/Engaging_the_community


Another script

#!/usr/bin/perl
if ($ARGV[0] eq "") {
	foreach (<DATA>) {
# Compare with static page:
#		$_ = "http://oer.educ.cam.ac.uk/download";
		s/\n//;
		$i++;
		mkdir("pages") if !-e "pages";
		# system("wget -O pages/$i.html '$_' &");
		system("perl $0 $i '$_' &");
# limit number of pages:
		exit if $i > 6;
# Introduce some time lag between requests:
		sleep 10;
	} 
} else {
	($date = `date +"%s"`) =~ s/\n//;
# Add -p to fetch requisites as well:
	system("wget -p -q --save-headers -O pages/$ARGV[0].html '$ARGV[1]'");
	($date2 = `date +"%s"`) =~ s/\n//;
	$s = $date2 - $date;
	print "$s\t$ARGV[0]\t$ARGV[1]\n";
};

__DATA__
(use same data as above)