Skip to content

Instantly share code, notes, and snippets.

@tototoshi
Created December 6, 2010 12:30
Show Gist options
  • Save tototoshi/730222 to your computer and use it in GitHub Desktop.
Save tototoshi/730222 to your computer and use it in GitHub Desktop.
フィードを開く
key.setViewKey('f', function() {
function collectFeedsURL() {
var doc = window._content.document;
var links = doc.getElementsByTagName('link');
var urls = new Array();
for (var i = 0; i < links.length; ++i) {
var type = links[i].getAttribute('type');
if (type == "application/rss+xml" || type == "application/atom+xml") {
urls.push(links[i].href);
}
}
return urls;
}
var urls = collectFeedsURL();
if (urls.length != 0) {
prompt.selector (
{
message : "Feeds",
collection: urls,
actions : [
[function(i) {
window.open(urls[i]);
}, "Open Feeds"]
]
});
}
}, 'Feed購読');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment