ReadBag.com Link Parser

Update (2009-03-19): ReadBag.com has started charging for it’s ervice, so I’m now marking this script as unmaintained. Feel free to continue using this script as long as it works with ReadBag.com. If it fails in the future I will not be updating the script, but you are free to make any changes you wish without questioning me.

Status: Unmaintained

Open the ReadBag.com Link Parser

Description: ReadBag.com Link Parser is a simple and short html+javascript file that I wrote to parse links for the “Interesting Feeds” that I post in my bbPress forum.

Using it requires a little manual work, but this tool cuts the majority of the work out. Once you have a stash of links saved at ReadBag.com, you can copy and paste the source code from each page into this tool and click parse. Parsing will throw the title and link out into the second text box.

The format that is expelled is as follows:

Title 1
Link 1
Title 2
Link 2

I then use this output by posting it in my bbPress forum to archive and keep a public list of all of the news feeds that I subscribe to, read and found interesting. I also do this for archival purposes such as finding an article later. ;)

Code:

<html>
<head>
<title>ReadBag Link Parser</title>
<script type=”text/javascript”>
function parse() {
var source=document.getElementById(‘source’).value;
var output=””;
var count=0;

while (source.indexOf(“SHARETHIS.addEntry({title:’”) > -1) {
output+=source.substr(source.indexOf(“SHARETHIS.addEntry({title:’”)+27,source.indexOf(“‘,url:’”)-(source.indexOf(“SHARETHIS.addEntry({title:’”)+27))+”\n”;
source=source.substr(source.indexOf(“‘,url:’”)+7);
output+=source.substr(0,source.indexOf(“‘}, {button:”))+”\n”;
source=source.substr(source.indexOf(“‘}, {button:”));
count++;
}

document.getElementById(‘count’).innerHTML=”Links Parsed: “+count;
document.getElementById(‘output’).value=output;
}
</script>
</head>
<body>
<textarea id=”source” cols=”150″ rows=”20″></textarea><br />
<textarea id=”output” cols=”150″ rows=”20″></textarea><br />
<input type=”button” value=”Parse” onclick=”parse();”><br />
<div id=”count”>Links Parsed:</div>
</body>
</html>

0 Responses to “ReadBag.com Link Parser”


  • No Comments

Leave a Reply