Return to Snippet

Revision: 1854
at November 22, 2006 10:18 by rolandog


Updated Code
/* 'Get Podcasts'
* if isOPML is false, it pops up an escaped version in HTML.
* if isOPML is true, it pops up an OPML version.
* Either way, you need to copy and save the results as a file with an .opml extension
* You can then add it to your Aggregator of choice:
*/

var isOPML=false;
var entry=document.getElementById('entry-14040355');
var ul=entry.getElementsByTagName('ul')[1];
var links=ul.getElementsByTagName('a');
var smalls=entry.getElementsByTagName('small');
var names=[];var cond=false;var text=url=title="";
for(var i=0;i<smalls.length;++i){
	cond=false;text=smalls[i].childNodes[0].nodeValue;
	for(var j=0;j<names.length;++j){
		if(text==names[j]){
			cond=true;
		}
	}
	if(!cond){
		names.push(text);
	}
}
//So far, names=["Purdue University","Southwest Tech","Berkeley","College of St. Scholastica","John Hopkins University","UCLA","Western Kentucky University","College of DuPage","NC State University","City University of New York","Ohio State University"];
function filter(name){
	var t=output="";
	for(var k=0;k<links.length;++k){
		t=smalls[k].childNodes[0].nodeValue;
		if(t==name){
			url=links[k].href;
			title=links[k].childNodes[0].nodeValue;
			output=output+'			<outline text="'+title+'" title="'+title+'" type="rss" xmlUrl="'+url+'" htmlUrl="'+url+'"/>'+"\n";
		}
	}
	return output;
}
var header='<opml version="1.0">'+"\n"+'	<head>'+"\n"+'		<title>Free Academic Podcasts</title>'+"\n"+'	</head>'+"\n"+'	<body>'+"\n";
var body='';
names.sort();
var p='Choose from which university you would like to get the podcasts from:\n 0. All';
for(var l=0;l<names.length;++l){
	p=p+'\n '+(l+1)+'. '+names[l];
}
var reply=prompt(p,"");
var choice=parseInt(reply)-1;
if(choice<0||choice>names.length-1||isNaN(choice)){
	for(var l=0;l<names.length;++l){
		body=body+'		<outline title="'+names[l]+'" text="'+names[l]+'">'+"\n"+filter(names[l])+'		</outline>'+"\n";
	}
}else{
	body='		<outline title="'+names[choice]+'" text="'+names[choice]+'">'+"\n"+filter(names[choice])+'		</outline>'+"\n";
}
body=body.replace(/="\s/g,'="');
body=body.replace(/&/g,'&amp;');
var footer='	</body>'+"\n"+'</opml>';
var htmlHeader='<html><head><title>Free Academic Podcasts</title></head><body>';
var htmlFooter='</body></html>';
var opml=(isOPML)?header+body+footer:htmlHeader+(((((header+body+footer).replace(/&/g,'&amp;')).replace(/>/g,'&gt;')).replace(/</g,'&lt;')).replace(/\n/g,'<br>\n'))+htmlFooter;
function popOPML(code){
	var gOPML=window.open('','Free Academic Podcasts','top=300,left=200,height=480,width=640');
	var tmp=gOPML.document;
	tmp.open();
	tmp.write(code);
	tmp.close();
}
popOPML(opml);

/*Resulting Bookmarklet:*/
/*javascript:(function(){var%20isOPML=false;var%20entry=document.getElementById('entry-14040355');var%20ul=entry.getElementsByTagName('ul')[1];var%20links=ul.getElementsByTagName('a');var%20smalls=entry.getElementsByTagName('small');var%20names=[];var%20cond=false;var%20text=url=title='';for(var%20i=0;i&lt;smalls.length;++i){cond=false;text=smalls[i].childNodes[0].nodeValue;for(var%20j=0;j&lt;names.length;++j){if(text==names[j]){cond=true}}if(!cond){names.push(text)}}function%20filter(name){var%20t=output='';for(var%20k=0;k&lt;links.length;++k){t=smalls[k].childNodes[0].nodeValue;if(t==name){url=links[k].href;title=links[k].childNodes[0].nodeValue;output=output+'			&lt;outline%20text=%22'+title+'%22%20title=%22'+title+'%22%20type=%22rss%22%20xmlUrl=%22'+url+'%22%20htmlUrl=%22'+url+'%22/&gt;'+%22\n%22}}return%20output}var%20header='&lt;opml%20version=%221.0%22&gt;'+%22\n%22+'	&lt;head&gt;'+%22\n%22+'		&lt;title&gt;Free%20Academic%20Podcasts&lt;/title&gt;'+%22\n%22+'	&lt;/head&gt;'+%22\n%22+'	&lt;body&gt;'+%22\n%22;var%20body='';names.sort();var%20p='Choose%20from%20which%20university%20you%20would%20like%20to%20get%20the%20podcasts%20from:\n%200.%20All';for(var%20l=0;l&lt;names.length;++l){p=p+'\n%20'+(l+1)+'.%20'+names[l];}var%20reply=prompt(p,%22%22);var%20choice=parseInt(reply)-1;if(choice&lt;0||choice&gt;names.length-1||isNaN(choice)){for(var%20l=0;l&lt;names.length;++l){body=body+'		&lt;outline%20title=%22'+names[l]+'%22%20text=%22'+names[l]+'%22&gt;'+%22\n%22+filter(names[l])+'		&lt;/outline&gt;'+%22\n%22;}}else{body='		&lt;outline%20title=%22'+names[choice]+'%22%20text=%22'+names[choice]+'%22&gt;'+%22\n%22+filter(names[choice])+'		&lt;/outline&gt;'+%22\n%22;}var%20tx='='+'%22';body=body.replace(/=%22\s/g,tx);body=body.replace(/&amp;/g,'&amp;amp;');var%20footer='	&lt;/body&gt;'+%22\n%22+'&lt;/opml&gt;';var%20htmlHeader='&lt;html&gt;&lt;head&gt;&lt;title&gt;Free%20Academic%20Podcasts&lt;/title&gt;&lt;/head&gt;&lt;body&gt;';var%20htmlFooter='&lt;/body&gt;&lt;/html&gt;';var%20opml=(isOPML)?header+body+footer:htmlHeader+(((((header+body+footer).replace(/&amp;/g,'&amp;amp;')).replace(/&gt;/g,'&amp;gt;')).replace(/&lt;/g,'&amp;lt;')).replace(/\n/g,'&lt;br&gt;\n'))+htmlFooter;function%20popOPML(code){var%20gOPML=window.open('','Free%20Academic%20Podcasts','top=300,left=200,height=480,width=640');var%20tmp=gOPML.document;tmp.open();tmp.write(code);tmp.close()}popOPML(opml);})()*/

Revision: 1853
at November 22, 2006 10:17 by rolandog


Updated Code
/* 'Get Podcasts'
* if isOPML is false, it pops up an escaped version in HTML.
* if isOPML is true, it pops up an OPML version.
* Either way, you need to copy and save the results as a file with an .opml extension
* You can then add it to your Aggregator of choice:
*/

var isOPML=false;
var entry=document.getElementById('entry-14040355');
var ul=entry.getElementsByTagName('ul')[1];
var links=ul.getElementsByTagName('a');
var smalls=entry.getElementsByTagName('small');
var names=[];var cond=false;var text=url=title="";
for(var i=0;i<smalls.length;++i){
	cond=false;text=smalls[i].childNodes[0].nodeValue;
	for(var j=0;j<names.length;++j){
		if(text==names[j]){
			cond=true;
		}
	}
	if(!cond){
		names.push(text);
	}
}
//So far, names=["Purdue University","Southwest Tech","Berkeley","College of St. Scholastica","John Hopkins University","UCLA","Western Kentucky University","College of DuPage","NC State University","City University of New York","Ohio State University"];
function filter(name){
	var t=output="";
	for(var k=0;k<links.length;++k){
		t=smalls[k].childNodes[0].nodeValue;
		if(t==name){
			url=links[k].href;
			title=links[k].childNodes[0].nodeValue;
			output=output+'			<outline text="'+title+'" title="'+title+'" type="rss" xmlUrl="'+url+'" htmlUrl="'+url+'"/>'+"\n";
		}
	}
	return output;
}
var header='<opml version="1.0">'+"\n"+'	<head>'+"\n"+'		<title>Free Academic Podcasts</title>'+"\n"+'	</head>'+"\n"+'	<body>'+"\n";
var body='';
names.sort();
var p='Choose from which university you would like to get the podcasts from:\n 0. All';
for(var l=0;l<names.length;++l){
	p=p+'\n '+(l+1)+'. '+names[l];
}
var reply=prompt(p,"");
var choice=parseInt(reply)-1;
if(choice<0||choice>names.length-1||isNaN(choice)){
	for(var l=0;l<names.length;++l){
		body=body+'		<outline title="'+names[l]+'" text="'+names[l]+'">'+"\n"+filter(names[l])+'		</outline>'+"\n";
	}
}else{
	body='		<outline title="'+names[choice]+'" text="'+names[choice]+'">'+"\n"+filter(names[choice])+'		</outline>'+"\n";
}
body=body.replace(/="\s/g,'="');
body=body.replace(/&amp;/g,'&amp;amp;');
var footer='	</body>'+"\n"+'</opml>';
var htmlHeader='<html><head><title>Free Academic Podcasts</title></head><body>';
var htmlFooter='</body></html>';
var opml=(isOPML)?header+body+footer:htmlHeader+(((((header+body+footer).replace(/&amp;/g,'&amp;amp;')).replace(/>/g,'&amp;gt;')).replace(/</g,'&amp;lt;')).replace(/\n/g,'<br>\n'))+htmlFooter;
function popOPML(code){
	var gOPML=window.open('','Free Academic Podcasts','top=300,left=200,height=480,width=640');
	var tmp=gOPML.document;
	tmp.open();
	tmp.write(code);
	tmp.close();
}
popOPML(opml);

/*Resulting Bookmarklet:*/
/*javascript:(function(){var%20isOPML=false;var%20entry=document.getElementById('entry-14040355');var%20ul=entry.getElementsByTagName('ul')[1];var%20links=ul.getElementsByTagName('a');var%20smalls=entry.getElementsByTagName('small');var%20names=[];var%20cond=false;var%20text=url=title='';for(var%20i=0;i&amp;lt;smalls.length;++i){cond=false;text=smalls[i].childNodes[0].nodeValue;for(var%20j=0;j&amp;lt;names.length;++j){if(text==names[j]){cond=true}}if(!cond){names.push(text)}}function%20filter(name){var%20t=output='';for(var%20k=0;k&amp;lt;links.length;++k){t=smalls[k].childNodes[0].nodeValue;if(t==name){url=links[k].href;title=links[k].childNodes[0].nodeValue;output=output+'			&amp;lt;outline%20text=%22'+title+'%22%20title=%22'+title+'%22%20type=%22rss%22%20xmlUrl=%22'+url+'%22%20htmlUrl=%22'+url+'%22/&amp;gt;'+%22\n%22}}return%20output}var%20header='&amp;lt;opml%20version=%221.0%22&amp;gt;'+%22\n%22+'	&amp;lt;head&amp;gt;'+%22\n%22+'		&amp;lt;title&amp;gt;Free%20Academic%20Podcasts&amp;lt;/title&amp;gt;'+%22\n%22+'	&amp;lt;/head&amp;gt;'+%22\n%22+'	&amp;lt;body&amp;gt;'+%22\n%22;var%20body='';names.sort();var%20p='Choose%20from%20which%20university%20you%20would%20like%20to%20get%20the%20podcasts%20from:\n%200.%20All';for(var%20l=0;l&amp;lt;names.length;++l){p=p+'\n%20'+(l+1)+'.%20'+names[l];}var%20reply=prompt(p,%22%22);var%20choice=parseInt(reply)-1;if(choice&amp;lt;0||choice&amp;gt;names.length-1||isNaN(choice)){for(var%20l=0;l&amp;lt;names.length;++l){body=body+'		&amp;lt;outline%20title=%22'+names[l]+'%22%20text=%22'+names[l]+'%22&amp;gt;'+%22\n%22+filter(names[l])+'		&amp;lt;/outline&amp;gt;'+%22\n%22;}}else{body='		&amp;lt;outline%20title=%22'+names[choice]+'%22%20text=%22'+names[choice]+'%22&amp;gt;'+%22\n%22+filter(names[choice])+'		&amp;lt;/outline&amp;gt;'+%22\n%22;}var%20tx='='+'%22';body=body.replace(/=%22\s/g,tx);body=body.replace(/&amp;amp;/g,'&amp;amp;amp;');var%20footer='	&amp;lt;/body&amp;gt;'+%22\n%22+'&amp;lt;/opml&amp;gt;';var%20htmlHeader='&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Free%20Academic%20Podcasts&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;';var%20htmlFooter='&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;';var%20opml=(isOPML)?header+body+footer:htmlHeader+(((((header+body+footer).replace(/&amp;amp;/g,'&amp;amp;amp;')).replace(/&amp;gt;/g,'&amp;amp;gt;')).replace(/&amp;lt;/g,'&amp;amp;lt;')).replace(/\n/g,'&amp;lt;br&amp;gt;\n'))+htmlFooter;function%20popOPML(code){var%20gOPML=window.open('','Free%20Academic%20Podcasts','top=300,left=200,height=480,width=640');var%20tmp=gOPML.document;tmp.open();tmp.write(code);tmp.close()}popOPML(opml);})()*/

Revision: 1852
at November 19, 2006 21:33 by rolandog


Updated Code
/* 'Get Podcasts'
* if isOPML is false, it pops up an escaped version in HTML.
* if isOPML is true, it pops up an OPML version.
* Either way, you need to copy and save the results as a file with an .opml extension
* You can then add it to your Aggregator of choice:
*/

var isOPML=false;
var entry=document.getElementById('entry-14040355');
var ul=entry.getElementsByTagName('ul')[1];
var links=ul.getElementsByTagName('a');
var smalls=entry.getElementsByTagName('small');
var names=[];var cond=false;var text=url=title="";
for(var i=0;i<smalls.length;++i){
	cond=false;text=smalls[i].childNodes[0].nodeValue;
	for(var j=0;j<names.length;++j){
		if(text==names[j]){
			cond=true;
		}
	}
	if(!cond){
		names.push(text);
	}
}
//So far, names=["Purdue University","Southwest Tech","Berkeley","College of St. Scholastica","John Hopkins University","UCLA","Western Kentucky University","College of DuPage","NC State University","City University of New York","Ohio State University"];
function filter(name){
	var t=output="";
	for(var k=0;k<links.length;++k){
		t=smalls[k].childNodes[0].nodeValue;
		if(t==name){
			url=links[k].href;
			title=links[k].childNodes[0].nodeValue;
			output=output+'			<outline text="'+title+'" title="'+title+'" type="rss" xmlUrl="'+url+'" htmlUrl="'+url+'"/>'+"\n";
		}
	}
	return output;
}
var header='<opml version="1.0">'+"\n"+'	<head>'+"\n"+'		<title>Free Academic Podcasts</title>'+"\n"+'	</head>'+"\n"+'	<body>'+"\n";
var body="";
for(var l=0;l<names.length;++l){
	body=body+'		<outline title="'+names[l]+'" text="'+names[l]+'">'+"\n"+filter(names[l])+'		</outline>'+"\n";
}
body=body.replace(/="\s/g,'="');
body=body.replace(/&/g,'&amp;');
var footer='	</body>'+"\n"+'</opml>';
var htmlHeader='<html><head><title>Free Academic Podcasts</title></head><body>';
var htmlFooter='</body></html>';
var opml=(isOPML)?header+body+footer:htmlHeader+(((((header+body+footer).replace(/&/g,'&amp;')).replace(/>/g,'&gt;')).replace(/</g,'&lt;')).replace(/\n/g,'<br>\n'))+htmlFooter;
function popOPML(code){
	var gOPML=window.open('','Free Academic Podcasts','top=300,left=200,height=480,width=640');
	var tmp=gOPML.document;
	tmp.open();
	tmp.write(code);
	tmp.close();
}
popOPML(opml);

/*Resulting Bookmarklet:*/
/*javascript:(function(){var%20isOPML=false;var%20entry=document.getElementById('entry-14040355');var%20ul=entry.getElementsByTagName('ul')[1];var%20links=ul.getElementsByTagName('a');var%20smalls=entry.getElementsByTagName('small');var%20names=[];var%20cond=false;var%20text=url=title='';for(var%20i=0;i&lt;smalls.length;++i){cond=false;text=smalls[i].childNodes[0].nodeValue;for(var%20j=0;j&lt;names.length;++j){if(text==names[j]){cond=true}}if(!cond){names.push(text)}}function%20filter(name){var%20t=output='';for(var%20k=0;k&lt;links.length;++k){t=smalls[k].childNodes[0].nodeValue;if(t==name){url=links[k].href;title=links[k].childNodes[0].nodeValue;output=output+'			&lt;outline%20text=%22'+title+'%22%20title=%22'+title+'%22%20type=%22rss%22%20xmlUrl=%22'+url+'%22%20htmlUrl=%22'+url+'%22/&gt;'+%22\n%22}}return%20output}var%20header='&lt;opml%20version=%221.0%22&gt;'+%22\n%22+'	&lt;head&gt;'+%22\n%22+'		&lt;title&gt;Free%20Academic%20Podcasts&lt;/title&gt;'+%22\n%22+'	&lt;/head&gt;'+%22\n%22+'	&lt;body&gt;'+%22\n%22;var%20body='';for(var%20l=0;l&lt;names.length;++l){body=body+'		&lt;outline%20title=%22'+names[l]+'%22%20text=%22'+names[l]+'%22&gt;'+%22\n%22+filter(names[l])+'		&lt;/outline&gt;'+%22\n%22}var%20tx='='+'%22';body=body.replace(/=%22\s/g,tx);body=body.replace(/&amp;/g,'&amp;amp;');var%20footer='	&lt;/body&gt;'+%22\n%22+'&lt;/opml&gt;';var%20htmlHeader='&lt;html&gt;&lt;head&gt;&lt;title&gt;Free%20Academic%20Podcasts&lt;/title&gt;&lt;/head&gt;&lt;body&gt;';var%20htmlFooter='&lt;/body&gt;&lt;/html&gt;';var%20opml=(isOPML)?header+body+footer:htmlHeader+(((((header+body+footer).replace(/&amp;/g,'&amp;amp;')).replace(/&gt;/g,'&amp;gt;')).replace(/&lt;/g,'&amp;lt;')).replace(/\n/g,'&lt;br&gt;\n'))+htmlFooter;function%20popOPML(code){var%20gOPML=window.open('','Free%20Academic%20Podcasts','top=300,left=200,height=480,width=640');var%20tmp=gOPML.document;tmp.open();tmp.write(code);tmp.close()}popOPML(opml);})()*/

Revision: 1851
at November 13, 2006 02:44 by rolandog


Updated Code
var entry=document.getElementById('entry-14040355');
var ul=entry.getElementsByTagName('ul')[1];
var links=ul.getElementsByTagName('a');
var smalls=entry.getElementsByTagName('small');
var names=[];var cond=false;var text=url=title="";
for(var i=0;i<smalls.length;++i){
	cond=false;text=smalls[i].childNodes[0].nodeValue;
	for(var j=0;j<names.length;++j){
		if(text==names[j]){
			cond=true;
		}
	}
	if(!cond){
		names.push(text);
	}
}
//names=["Purdue University","Southwest Tech","Berkeley","College of St. Scholastica","John Hopkins University","UCLA","Western Kentucky University","College of DuPage","NC State University","City University of New York","Ohio State University"];
function filter(name){
	var t=output="";
	for(var k=0;k<links.length;++k){
		t=smalls[k].childNodes[0].nodeValue;
		if(t==name){
			url=links[k].href;
			title=links[k].childNodes[0].nodeValue;
			output=output+'			<outline text="'+title+'" title="'+title+'" type="rss" xmlUrl="'+url+'" htmlUrl="'+url+'"/>'+"\n";
		}
	}
	return output;
}
var header='<opml version="1.0">'+"\n"+'	<head>'+"\n"+'		<title>Free Academic Podcasts</title>'+"\n"+'	</head>'+"\n"+'	<body>'+"\n";
var body="";
for(var l=0;l<names.length;++l){
	body=body+'		<outline title="'+names[l]+'" text="'+names[l]+'">'+"\n"+filter(names[l])+'		</outline>'+"\n";
}
body=body.replace(/="\s/g,'="');
body=body.replace(/&/g,'&');
var footer='	</body>'+"\n"+'</opml>';
var opml=header+body+footer;
function popOPML(code){
	var gOPML=window.open('','Free Academic Podcasts','top=300,left=200,height=480,width=640');
	var tmp=gOPML.document;
	tmp.open();
	tmp.write(code);
	tmp.close();
}
popOPML(opml);

/*Bookmarklet:*/
/*javascript:(function(){var%20entry=document.getElementById('entry-14040355');var%20ul=entry.getElementsByTagName('ul')[1];var%20links=ul.getElementsByTagName('a');var%20smalls=entry.getElementsByTagName('small');var%20names=[];var%20cond=false;var%20text=url=title='';for(var%20i=0;i<smalls.length;++i){cond=false;text=smalls[i].childNodes[0].nodeValue;for(var%20j=0;j<names.length;++j){if(text==names[j]){cond=true}}if(!cond){names.push(text)}}function%20filter(name){var%20t=output='';for(var%20k=0;k<links.length;++k){t=smalls[k].childNodes[0].nodeValue;if(t==name){url=links[k].href;title=links[k].childNodes[0].nodeValue;output=output+'			<outline%20text=%22'+title+'%22%20title=%22'+title+'%22%20type=%22rss%22%20xmlUrl=%22'+url+'%22%20htmlUrl=%22'+url+'%22/>'+%22\n%22}}return%20output}var%20header='<opml%20version=%221.0%22>'+%22\n%22+'	<head>'+%22\n%22+'		<title>Free%20Academic%20Podcasts</title>'+%22\n%22+'	</head>'+%22\n%22+'	<body>'+%22\n%22;var%20body='';for(var%20l=0;l<names.length;++l){body=body+'		<outline%20title=%22'+names[l]+'%22%20text=%22'+names[l]+'%22>'+%22\n%22+filter(names[l])+'		</outline>'+%22\n%22}var%20tx='='+'%22';body=body.replace(/=%22\s/g,tx);body=body.replace(/&/g,'&amp;');var%20footer='	</body>'+%22\n%22+'</opml>';var%20opml=header+body+footer;function%20popOPML(code){var%20gOPML=window.open('','Free%20Academic%20Podcasts','top=300,left=200,height=480,width=640');var%20tmp=gOPML.document;tmp.open();tmp.write(code);tmp.close()}popOPML(opml);})()*/

Revision: 1850
at November 13, 2006 02:43 by rolandog


Updated Code
var entry=document.getElementById('entry-14040355');
var ul=entry.getElementsByTagName('ul')[1];
var links=ul.getElementsByTagName('a');
var smalls=entry.getElementsByTagName('small');
var names=[];var cond=false;var text=url=title="";
for(var i=0;i<smalls.length;++i){
	cond=false;text=smalls[i].childNodes[0].nodeValue;
	for(var j=0;j<names.length;++j){
		if(text==names[j]){
			cond=true;
		}
	}
	if(!cond){
		names.push(text);
	}
}
//names=["Purdue University","Southwest Tech","Berkeley","College of St. Scholastica","John Hopkins University","UCLA","Western Kentucky University","College of DuPage","NC State University","City University of New York","Ohio State University"];
function filter(name){
	var t=output="";
	for(var k=0;k<links.length;++k){
		t=smalls[k].childNodes[0].nodeValue;
		if(t==name){
			url=links[k].href;
			title=links[k].childNodes[0].nodeValue;
			output=output+'			<outline text="'+title+'" title="'+title+'" type="rss" xmlUrl="'+url+'" htmlUrl="'+url+'"/>'+"\n";
		}
	}
	return output;
}
var header='<opml version="1.0">'+"\n"+'	<head>'+"\n"+'		<title>Free Academic Podcasts</title>'+"\n"+'	</head>'+"\n"+'	<body>'+"\n";
var body="";
for(var l=0;l<names.length;++l){
	body=body+'		<outline title="'+names[l]+'" text="'+names[l]+'">'+"\n"+filter(names[l])+'		</outline>'+"\n";
}
body=body.replace(/="\s/g,'="');
body=body.replace(/&/g,'&');
var footer='	</body>'+"\n"+'</opml>';
var opml=header+body+footer;
function popOPML(code){
	var gOPML=window.open('','Free Academic Podcasts','top=300,left=200,height=480,width=640');
	var tmp=gOPML.document;
	tmp.open();
	tmp.write(code);
	tmp.close();
}
popOPML(opml);

/*Bookmarklet:*/
/*javascript:(function(){var%20entry=document.getElementById('entry-14040355');var%20ul=entry.getElementsByTagName('ul')[1];var%20links=ul.getElementsByTagName('a');var%20smalls=entry.getElementsByTagName('small');var%20names=[];var%20cond=false;var%20text=url=title='';for(var%20i=0;i&lt;smalls.length;++i){cond=false;text=smalls[i].childNodes[0].nodeValue;for(var%20j=0;j&lt;names.length;++j){if(text==names[j]){cond=true}}if(!cond){names.push(text)}}function%20filter(name){var%20t=output='';for(var%20k=0;k&lt;links.length;++k){t=smalls[k].childNodes[0].nodeValue;if(t==name){url=links[k].href;title=links[k].childNodes[0].nodeValue;output=output+'			&lt;outline%20text=%22'+title+'%22%20title=%22'+title+'%22%20type=%22rss%22%20xmlUrl=%22'+url+'%22%20htmlUrl=%22'+url+'%22/&gt;'+%22\n%22}}return%20output}var%20header='&lt;opml%20version=%221.0%22&gt;'+%22\n%22+'	&lt;head&gt;'+%22\n%22+'		&lt;title&gt;Free%20Academic%20Podcasts&lt;/title&gt;'+%22\n%22+'	&lt;/head&gt;'+%22\n%22+'	&lt;body&gt;'+%22\n%22;var%20body='';for(var%20l=0;l&lt;names.length;++l){body=body+'		&lt;outline%20title=%22'+names[l]+'%22%20text=%22'+names[l]+'%22&gt;'+%22\n%22+filter(names[l])+'		&lt;/outline&gt;'+%22\n%22}var%20tx='='+'%22';body=body.replace(/=%22\s/g,tx);body=body.replace(/&amp;/g,'&amp;amp;');var%20footer='	&lt;/body&gt;'+%22\n%22+'&lt;/opml&gt;';var%20opml=header+body+footer;function%20popOPML(code){var%20gOPML=window.open('','Free%20Academic%20Podcasts','top=300,left=200,height=480,width=640');var%20tmp=gOPML.document;tmp.open();tmp.write(code);tmp.close()}popOPML(opml);})()*/

Revision: 1849
at November 13, 2006 02:36 by rolandog


Updated Code
var entry=document.getElementById('entry-14040355');
var ul=entry.getElementsByTagName('ul')[1];
var links=ul.getElementsByTagName('a');
var smalls=entry.getElementsByTagName('small');
var names=[];var cond=false;var text=url=title="";
for(var i=0;i<smalls.length;++i){
	cond=false;text=smalls[i].childNodes[0].nodeValue;
	for(var j=0;j<names.length;++j){
		if(text==names[j]){
			cond=true;
		}
	}
	if(!cond){
		names.push(text);
	}
}
//names=["Purdue University","Southwest Tech","Berkeley","College of St. Scholastica","John Hopkins University","UCLA","Western Kentucky University","College of DuPage","NC State University","City University of New York","Ohio State University"];
function filter(name){
	var t=output="";
	for(var k=0;k<links.length;++k){
		t=smalls[k].childNodes[0].nodeValue;
		if(t==name){
			url=links[k].href;
			title=links[k].childNodes[0].nodeValue;
			output=output+'			<outline text="'+title+'" title="'+title+'" type="rss" xmlUrl="'+url+'" htmlUrl="'+url+'"/>'+"\n";
		}
	}
	return output;
}
var header='<opml version="1.0">'+"\n"+'	<head>'+"\n"+'		<title>Free Academic Podcasts</title>'+"\n"+'	</head>'+"\n"+'	<body>'+"\n";
var body="";
for(var l=0;l<names.length;++l){
	body=body+'		<outline title="'+names[l]+'" text="'+names[l]+'">'+"\n"+filter(names[l])+'		</outline>'+"\n";
}
body=body.replace(/="\s/g,'="');
body=body.replace(/&/g,'&');
var footer='	</body>'+"\n"+'</opml>';
var opml=header+body+footer;
function popOPML(code){
	var gOPML=window.open('','Free Academic Podcasts','top=300,left=200,height=480,width=640');
	var tmp=gOPML.document;
	tmp.open();
	tmp.write(code);
	tmp.close();
}
popOPML(opml);

/*Bookmarklet:*/
/*javascript:(function(){var%20entry=document.getElementById('entry-14040355');var%20ul=entry.getElementsByTagName('ul')[1];var%20links=ul.getElementsByTagName('a');var%20smalls=entry.getElementsByTagName('small');var%20names=[];var%20cond=false;var%20text=url=title='';for(var%20i=0;i<smalls.length;++i){cond=false;text=smalls[i].childNodes[0].nodeValue;for(var%20j=0;j<names.length;++j){if(text==names[j]){cond=true}}if(!cond){names.push(text)}}function%20filter(name){var%20t=output='';for(var%20k=0;k<links.length;++k){t=smalls[k].childNodes[0].nodeValue;if(t==name){url=links[k].href;title=links[k].childNodes[0].nodeValue;output=output+'			<outline%20text=%22'+title+'%22%20title=%22'+title+'%22%20type=%22rss%22%20xmlUrl=%22'+url+'%22%20htmlUrl=%22'+url+'%22/>'+%22\n%22}}return%20output}var%20header='<opml%20version=%221.0%22>'+%22\n%22+'	<head>'+%22\n%22+'		<title>Free%20Academic%20Podcasts</title>'+%22\n%22+'	</head>'+%22\n%22+'	<body>'+%22\n%22;var%20body='';for(var%20l=0;l<names.length;++l){body=body+'		<outline%20title=%22'+names[l]+'%22%20text=%22'+names[l]+'%22>'+%22\n%22+filter(names[l])+'		</outline>'+%22\n%22}var%20tx='='+'%22';body=body.replace(/=%22\s/g,tx);body=body.replace(/&/g,'&amp;');var%20footer='	</body>'+%22\n%22+'</opml>';var%20opml=header+body+footer;function%20popOPML(code){var%20gOPML=window.open('','Free%20Academic%20Podcasts','top=300,left=200,height=480,width=640');var%20tmp=gOPML.document;tmp.open();tmp.write(code);tmp.close()}popOPML(opml);})()*/

Revision: 1848
at November 13, 2006 02:33 by rolandog


Updated Code
var entry=document.getElementById('entry-14040355');
var ul=entry.getElementsByTagName('ul')[1];
var links=ul.getElementsByTagName('a');
var smalls=entry.getElementsByTagName('small');
var names=[];var cond=false;var text=url=title="";
for(var i=0;i<smalls.length;++i){
	cond=false;text=smalls[i].childNodes[0].nodeValue;
	for(var j=0;j<names.length;++j){
		if(text==names[j]){
			cond=true;
		}
	}
	if(!cond){
		names.push(text);
	}
}
//names=["Purdue University","Southwest Tech","Berkeley","College of St. Scholastica","John Hopkins University","UCLA","Western Kentucky University","College of DuPage","NC State University","City University of New York","Ohio State University"];
function filter(name){
	var t=output="";
	for(var k=0;k<links.length;++k){
		t=smalls[k].childNodes[0].nodeValue;
		if(t==name){
			url=links[k].href;
			title=links[k].childNodes[0].nodeValue;
			output=output+'			<outline text="'+title+'" title="'+title+'" type="rss" xmlUrl="'+url+'" htmlUrl="'+url+'"/>'+"\n";
		}
	}
	return output;
}
var header='<opml version="1.0">'+"\n"+'	<head>'+"\n"+'		<title>Free Academic Podcasts</title>'+"\n"+'	</head>'+"\n"+'	<body>'+"\n";
var body="";
for(var l=0;l<names.length;++l){
	body=body+'		<outline title="'+names[l]+'" text="'+names[l]+'">'+"\n"+filter(names[l])+'		</outline>'+"\n";
}
body=body.replace(/="\s/g,'="');
body=body.replace(/&/g,'&');
var footer='	</body>'+"\n"+'</opml>';
var opml=header+body+footer;
function popOPML(code){
	var gOPML=window.open('','Free Academic Podcasts','top=300,left=200,height=480,width=640');
	var tmp=gOPML.document;
	tmp.open();
	tmp.write(code);
	tmp.close();
}
popOPML(opml);

/*Bookmarklet:*/
/*javascript:(function(){var%20entry=document.getElementById('entry-14040355');var%20ul=entry.getElementsByTagName('ul')[1];var%20links=ul.getElementsByTagName('a');var%20smalls=entry.getElementsByTagName('small');var%20names=[];var%20cond=false;var%20text=url=title='';for(var%20i=0;i<smalls.length;++i){cond=false;text=smalls[i].childNodes[0].nodeValue;for(var%20j=0;j<names.length;++j){if(text==names[j]){cond=true}}if(!cond){names.push(text)}}function%20filter(name){var%20t=output='';for(var%20k=0;k<links.length;++k){t=smalls[k].childNodes[0].nodeValue;if(t==name){url=links[k].href;title=links[k].childNodes[0].nodeValue;output=output+'			<outline%20text=%22'+title+'%22%20title=%22'+title+'%22%20type=%22rss%22%20xmlUrl=%22'+url+'%22%20htmlUrl=%22'+url+'%22/>'+%22\n%22}}return%20output}var%20header='<opml%20version=%221.0%22>'+%22\n%22+'	<head>'+%22\n%22+'		<title>Free%20Academic%20Podcasts</title>'+%22\n%22+'	</head>'+%22\n%22+'	<body>'+%22\n%22;var%20body='';for(var%20l=0;l<names.length;++l){body=body+'		<outline%20title=%22'+names[l]+'%22%20text=%22'+names[l]+'%22>'+%22\n%22+filter(names[l])+'		</outline>'+%22\n%22}var%20tx='='+'%22';body=body.replace(/=%22\s/g,tx);body=body.replace(/&/g,'&');var%20footer='	</body>'+%22\n%22+'</opml>';var%20opml=header+body+footer;function%20popOPML(code){var%20gOPML=window.open('','Free%20Academic%20Podcasts','top=300,left=200,height=480,width=640');var%20tmp=gOPML.document;tmp.open();tmp.write(code);tmp.close()}popOPML(opml);})()*/

Revision: 1847
at November 13, 2006 02:33 by rolandog


Updated Code
var entry=document.getElementById('entry-14040355');
var ul=entry.getElementsByTagName('ul')[1];
var links=ul.getElementsByTagName('a');
var smalls=entry.getElementsByTagName('small');
var names=[];var cond=false;var text=url=title="";
for(var i=0;i<smalls.length;++i){
	cond=false;text=smalls[i].childNodes[0].nodeValue;
	for(var j=0;j<names.length;++j){
		if(text==names[j]){
			cond=true;
		}
	}
	if(!cond){
		names.push(text);
	}
}
//names=["Purdue University","Southwest Tech","Berkeley","College of St. Scholastica","John Hopkins University","UCLA","Western Kentucky University","College of DuPage","NC State University","City University of New York","Ohio State University"];
function filter(name){
	var t=output="";
	for(var k=0;k<links.length;++k){
		t=smalls[k].childNodes[0].nodeValue;
		if(t==name){
			url=links[k].href;
			title=links[k].childNodes[0].nodeValue;
			output=output+'			<outline text="'+title+'" title="'+title+'" type="rss" xmlUrl="'+url+'" htmlUrl="'+url+'"/>'+"\n";
		}
	}
	return output;
}
var header='<opml version="1.0">'+"\n"+'	<head>'+"\n"+'		<title>Free Academic Podcasts</title>'+"\n"+'	</head>'+"\n"+'	<body>'+"\n";
var body="";
for(var l=0;l<names.length;++l){
	body=body+'		<outline title="'+names[l]+'" text="'+names[l]+'">'+"\n"+filter(names[l])+'		</outline>'+"\n";
}
body=body.replace(/="\s/g,'="');
body=body.replace(/&/g,'&amp;');
var footer='	</body>'+"\n"+'</opml>';
var opml=header+body+footer;
function popOPML(code){
	var gOPML=window.open('','Free Academic Podcasts','top=300,left=200,height=480,width=640');
	var tmp=gOPML.document;
	tmp.open();
	tmp.write(code);
	tmp.close();
}
popOPML(opml);

/*Bookmarklet:*/
/*javascript:(function(){var%20entry=document.getElementById('entry-14040355');var%20ul=entry.getElementsByTagName('ul')[1];var%20links=ul.getElementsByTagName('a');var%20smalls=entry.getElementsByTagName('small');var%20names=[];var%20cond=false;var%20text=url=title='';for(var%20i=0;i<smalls.length;++i){cond=false;text=smalls[i].childNodes[0].nodeValue;for(var%20j=0;j<names.length;++j){if(text==names[j]){cond=true}}if(!cond){names.push(text)}}function%20filter(name){var%20t=output='';for(var%20k=0;k<links.length;++k){t=smalls[k].childNodes[0].nodeValue;if(t==name){url=links[k].href;title=links[k].childNodes[0].nodeValue;output=output+'			<outline%20text=%22'+title+'%22%20title=%22'+title+'%22%20type=%22rss%22%20xmlUrl=%22'+url+'%22%20htmlUrl=%22'+url+'%22/>'+%22\n%22}}return%20output}var%20header='<opml%20version=%221.0%22>'+%22\n%22+'	<head>'+%22\n%22+'		<title>Free%20Academic%20Podcasts</title>'+%22\n%22+'	</head>'+%22\n%22+'	<body>'+%22\n%22;var%20body='';for(var%20l=0;l<names.length;++l){body=body+'		<outline%20title=%22'+names[l]+'%22%20text=%22'+names[l]+'%22>'+%22\n%22+filter(names[l])+'		</outline>'+%22\n%22}var%20tx='='+'%22';body=body.replace(/=%22\s/g,tx);body=body.replace(/&/g,'&');var%20footer='	</body>'+%22\n%22+'</opml>';var%20opml=header+body+footer;function%20popOPML(code){var%20gOPML=window.open('','Free%20Academic%20Podcasts','top=300,left=200,height=480,width=640');var%20tmp=gOPML.document;tmp.open();tmp.write(code);tmp.close()}popOPML(opml);})()*/

Revision: 1846
at November 13, 2006 02:31 by rolandog


Updated Code
var entry=document.getElementById('entry-14040355');
var ul=entry.getElementsByTagName('ul')[1];
var links=ul.getElementsByTagName('a');
var smalls=entry.getElementsByTagName('small');
var names=[];var cond=false;var text=url=title="";
for(var i=0;i<smalls.length;++i){
	cond=false;text=smalls[i].childNodes[0].nodeValue;
	for(var j=0;j<names.length;++j){
		if(text==names[j]){
			cond=true;
		}
	}
	if(!cond){
		names.push(text);
	}
}
//names=["Purdue University","Southwest Tech","Berkeley","College of St. Scholastica","John Hopkins University","UCLA","Western Kentucky University","College of DuPage","NC State University","City University of New York","Ohio State University"];
function filter(name){
	var t=output="";
	for(var k=0;k<links.length;++k){
		t=smalls[k].childNodes[0].nodeValue;
		if(t==name){
			url=links[k].href;
			title=links[k].childNodes[0].nodeValue;
			output=output+'			<outline text="'+title+'" title="'+title+'" type="rss" xmlUrl="'+url+'" htmlUrl="'+url+'"/>'+"\n";
		}
	}
	return output;
}
var header='<opml version="1.0">'+"\n"+'	<head>'+"\n"+'		<title>Free Academic Podcasts</title>'+"\n"+'	</head>'+"\n"+'	<body>'+"\n";
var body="";
for(var l=0;l<names.length;++l){
	body=body+'		<outline title="'+names[l]+'" text="'+names[l]+'">'+"\n"+filter(names[l])+'		</outline>'+"\n";
}
var tx='='+'\"';
body=body.replace(/="\s/g,tx);
body=body.replace(/&/g,'&');
var footer='	</body>'+"\n"+'</opml>';
var opml=header+body+footer;
function popOPML(code){
	var gOPML=window.open('','Free Academic Podcasts','top=300,left=200,height=480,width=640');
	var tmp=gOPML.document;
	tmp.open();
	tmp.write(code);
	tmp.close();
}
popOPML(opml);

/*Bookmarklet:*/
/*javascript:(function(){var%20entry=document.getElementById('entry-14040355');var%20ul=entry.getElementsByTagName('ul')[1];var%20links=ul.getElementsByTagName('a');var%20smalls=entry.getElementsByTagName('small');var%20names=[];var%20cond=false;var%20text=url=title='';for(var%20i=0;i<smalls.length;++i){cond=false;text=smalls[i].childNodes[0].nodeValue;for(var%20j=0;j<names.length;++j){if(text==names[j]){cond=true}}if(!cond){names.push(text)}}function%20filter(name){var%20t=output='';for(var%20k=0;k<links.length;++k){t=smalls[k].childNodes[0].nodeValue;if(t==name){url=links[k].href;title=links[k].childNodes[0].nodeValue;output=output+'			<outline%20text=%22'+title+'%22%20title=%22'+title+'%22%20type=%22rss%22%20xmlUrl=%22'+url+'%22%20htmlUrl=%22'+url+'%22/>'+%22\n%22}}return%20output}var%20header='<opml%20version=%221.0%22>'+%22\n%22+'	<head>'+%22\n%22+'		<title>Free%20Academic%20Podcasts</title>'+%22\n%22+'	</head>'+%22\n%22+'	<body>'+%22\n%22;var%20body='';for(var%20l=0;l<names.length;++l){body=body+'		<outline%20title=%22'+names[l]+'%22%20text=%22'+names[l]+'%22>'+%22\n%22+filter(names[l])+'		</outline>'+%22\n%22}var%20tx='='+'%22';body=body.replace(/=%22\s/g,tx);body=body.replace(/&/g,'&');var%20footer='	</body>'+%22\n%22+'</opml>';var%20opml=header+body+footer;function%20popOPML(code){var%20gOPML=window.open('','Free%20Academic%20Podcasts','top=300,left=200,height=480,width=640');var%20tmp=gOPML.document;tmp.open();tmp.write(code);tmp.close()}popOPML(opml);})()*/

Revision: 1845
at November 13, 2006 02:30 by rolandog


Initial Code
var entry=document.getElementById('entry-14040355');
var ul=entry.getElementsByTagName('ul')[1];
var links=ul.getElementsByTagName('a');
var smalls=entry.getElementsByTagName('small');
var names=[];var cond=false;var text=url=title="";
for(var i=0;i<smalls.length;++i){
	cond=false;text=smalls[i].childNodes[0].nodeValue;
	for(var j=0;j<names.length;++j){
		if(text==names[j]){
			cond=true;
		}
	}
	if(!cond){
		names.push(text);
	}
}
//names=["Purdue University","Southwest Tech","Berkeley","College of St. Scholastica","John Hopkins University","UCLA","Western Kentucky University","College of DuPage","NC State University","City University of New York","Ohio State University"];
function filter(name){
	var t=output="";
	for(var k=0;k<links.length;++k){
		t=smalls[k].childNodes[0].nodeValue;
		if(t==name){
			url=links[k].href;
			title=links[k].childNodes[0].nodeValue;
			output=output+'			<outline text="'+title+'" title="'+title+'" type="rss" xmlUrl="'+url+'" htmlUrl="'+url+'"/>'+"\n";
		}
	}
	return output;
}
var header='<opml version="1.0">'+"\n"+'	<head>'+"\n"+'		<title>Free Academic Podcasts</title>'+"\n"+'	</head>'+"\n"+'	<body>'+"\n";
var body="";
for(var l=0;l<names.length;++l){
	body=body+'		<outline title="'+names[l]+'" text="'+names[l]+'">'+"\n"+filter(names[l])+'		</outline>'+"\n";
}
body=body.replace(/="\s/g,'="');
body=body.replace(/&/g,'&amp;');
var footer='	</body>'+"\n"+'</opml>';
var opml=header+body+footer;
function popOPML(code){
	var gOPML=window.open('','Free Academic Podcasts','top=300,left=200,height=480,width=640');
	var tmp=gOPML.document;
	tmp.open();
	tmp.write(code);
	tmp.close();
}
popOPML(opml);

/*Bookmarklet:*/
/*javascript:(function(){var%20entry=document.getElementById('entry-14040355');var%20ul=entry.getElementsByTagName('ul')[1];var%20links=ul.getElementsByTagName('a');var%20smalls=entry.getElementsByTagName('small');var%20names=[];var%20cond=false;var%20text=url=title='';for(var%20i=0;i&lt;smalls.length;++i){cond=false;text=smalls[i].childNodes[0].nodeValue;for(var%20j=0;j&lt;names.length;++j){if(text==names[j]){cond=true}}if(!cond){names.push(text)}}function%20filter(name){var%20t=output='';for(var%20k=0;k&lt;links.length;++k){t=smalls[k].childNodes[0].nodeValue;if(t==name){url=links[k].href;title=links[k].childNodes[0].nodeValue;output=output+'			&lt;outline%20text=%22'+title+'%22%20title=%22'+title+'%22%20type=%22rss%22%20xmlUrl=%22'+url+'%22%20htmlUrl=%22'+url+'%22/&gt;'+%22\n%22}}return%20output}var%20header='&lt;opml%20version=%221.0%22&gt;'+%22\n%22+'	&lt;head&gt;'+%22\n%22+'		&lt;title&gt;Free%20Academic%20Podcasts&lt;/title&gt;'+%22\n%22+'	&lt;/head&gt;'+%22\n%22+'	&lt;body&gt;'+%22\n%22;var%20body='';for(var%20l=0;l&lt;names.length;++l){body=body+'		&lt;outline%20title=%22'+names[l]+'%22%20text=%22'+names[l]+'%22&gt;'+%22\n%22+filter(names[l])+'		&lt;/outline&gt;'+%22\n%22}var%20tx='='+'%22';body=body.replace(/=%22\s/g,tx);body=body.replace(/&/g,'&amp;');var%20footer='	&lt;/body&gt;'+%22\n%22+'&lt;/opml&gt;';var%20opml=header+body+footer;function%20popOPML(code){var%20gOPML=window.open('','Free%20Academic%20Podcasts','top=300,left=200,height=480,width=640');var%20tmp=gOPML.document;tmp.open();tmp.write(code);tmp.close()}popOPML(opml);})()*/

Initial URL
http://www.productivity501.com/2006/11/free_academic_p.html

Initial Description
This is a website specific script... pops up the source of an OPML file with 145+ podcasts.
http://www.productivity501.com/2006/11/free_academic_p.html

Note: The 'bookmarklet' format is included as a comment at the bottom... (write in a webpage an anchor element with the escaped javascript format in the href attribute).

Initial Title
OPML PopUp to ease Podcast Aggregation

Initial Tags
google

Initial Language
JavaScript