+feedly
by
aetos382
2015-01-16 [2015/01/16 18:55:16]
現在見ているサイトのフィードを feedly cloud に登録するページを開く
@@ -7,27 +7,27 @@
* @private
*/
-var h,p;
+var h;
$('link[rel="alternate"]').each(function() {
- var t=$(this).attr('type');
+ 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){
- window.alert('2');
- h='/rss.xml';
- p=$('p');
- p[0].insertAdjacentHTML('AfterBegin','<a href="'+h+'"/>');
- h=p[0].firstChild.href;
- window.alert(h);
+ 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){
+
+if (!h) {
window.alert('Could not find feed');
-}else{
- var u='http://cloud.feedly.com/#subscription'+encodeURIComponent('/feed/')+encodeURIComponent(h);window.open(u);
}
-*/
+else {
+ var u = 'http://cloud.feedly.com/#subscription' + encodeURIComponent('/feed/') + encodeURIComponent(h);
+ window.open(u);
+}
/*
* @title +feedly
* @description my bookmarklet
* @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);
window.open(u);
}
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。