+feedly
by
aetos382
2015-01-16 [2015/01/16 18:55:16]
現在見ているサイトのフィードを feedly cloud に登録するページを開く
@@ -4,6 +4,7 @@
* @include http://*
* @license MS-PL
* @require jQuery
+ * @private
*/
var h;
@@ -11,13 +12,13 @@
$('link[rel="alternate"]').each(function() {
var type = $(this).attr('type');
- if (type.search(/(application|text)\/((atom|rds|rss)\+)?xml/i) != -1) {
+ if (t.search(/application\/((atom|rds|rss)\+)?xml/i) == -1 && t.indexOf('text/xml') == -1) {
h = $(this).attr('href');
if (h) {
- var s = $('span');
- s[0].insertAdjacentHTML('AfterBegin','<a href="' + h + '"/>');
- h = s[0].firstChild.href;
+ var p = $('p');
+ p[0].insertAdjacentHTML('AfterBegin','<a href="' + h + '"/>');
+ h = p[0].firstChild.href;
return false;
}
@@ -29,5 +30,6 @@
}
else {
var u = 'http://cloud.feedly.com/#subscription' + encodeURIComponent('/feed/') + encodeURIComponent(h);
- window.open(u);
-}
+ // $('<div><p><span>' + document.title + '</span><a href="' + u + '" style=" display: block; color: white; background-color: #2bb24c; font-size: 12px; border-radius: 3px; padding: 7px; 23px; font-family: sans-serif;"/></p></div>').prependTo('body');
+ $('<div>x</div>').prependTo('body');
+}
/*
* @title +feedly
* @description 現在見ているサイトのフィードを feedly cloud に登録するページを開く
* @include http://*
* @license MS-PL
* @require jQuery
* @private
*/
var h;
$('link[rel="alternate"]').each(function() {
var type = $(this).attr('type');
if (t.search(/application\/((atom|rds|rss)\+)?xml/i) == -1 && t.indexOf('text/xml') == -1) {
h = $(this).attr('href');
if (h) {
var p = $('p');
p[0].insertAdjacentHTML('AfterBegin','<a href="' + h + '"/>');
h = p[0].firstChild.href;
return false;
}
}
});
if (!h) {
window.alert('Could not find feed');
}
else {
var u = 'http://cloud.feedly.com/#subscription' + encodeURIComponent('/feed/') + encodeURIComponent(h);
// $('<div><p><span>' + document.title + '</span><a href="' + u + '" style=" display: block; color: white; background-color: #2bb24c; font-size: 12px; border-radius: 3px; padding: 7px; 23px; font-family: sans-serif;"/></p></div>').prependTo('body');
$('<div>x</div>').prependTo('body');
}
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。