+Subscribe Twitter RSS
@@ -1,13 +1,24 @@
/*
* @title +Subscribe Twitter RSS
- * @description Twitter RSS Subscribe to Google Reader (Forked)
- * @see http://let.hatelabo.jp/m4i/let/gYC-yZKMjtONHg (Original-Let: Atom ver.)
- * @see http://let.hatelabo.jp/noromanba/let/gYC-yZ-91I7yEg (Permalink)
+ * @description Twitter RSS Subscribe to Feed Reader (Forked)
+ * @contributor m4i http://let.hatelabo.jp/m4i/let/gYC-yZKMjtONHg (Fork of)
* @include http://twitter.com/*
* @include https://twitter.com/*
- * @license MIT License http://noromanba.mit-license.org/2012+
+ * @license MIT License http://nrm.mit-license.org/2012
*/
-var reader = 'http://www.google.com/reader/view/feed/';
-var feed = encodeURIComponent('http://twitter.com/statuses/user_timeline/' + twttr.profileUser.id + '.rss');
-location.href = reader + feed;
+(function () {
+ // TODO refactor: smart data-* handling
+ // http://www.w3.org/TR/html5/global-attributes.html#embedding-custom-non-visible-data-with-the-data-attributes
+ var id;
+ if (location.hostname !== 'twitter.com' ||
+ !(id = document.querySelector('div[data-user-id]')) ||
+ !(id = id.dataset.userId)) // or id.getAttribute('data-user-id') {
+ return;
+ }
+
+ var reader = 'https://www.google.com/reader/view/feed/';
+ // lifetime: 2013-03-05
+ var feed = encodeURIComponent('https://api.twitter.com/1/statuses/user_timeline/' + id + '.rss');
+ location.href = reader + feed;
+})();
/*
* @title +Subscribe Twitter RSS
* @description Twitter RSS Subscribe to Feed Reader (Forked)
* @contributor m4i http://let.hatelabo.jp/m4i/let/gYC-yZKMjtONHg (Fork of)
* @include http://twitter.com/*
* @include https://twitter.com/*
* @license MIT License http://nrm.mit-license.org/2012
*/
(function () {
// TODO refactor: smart data-* handling
// http://www.w3.org/TR/html5/global-attributes.html#embedding-custom-non-visible-data-with-the-data-attributes
var id;
if (location.hostname !== 'twitter.com' ||
!(id = document.querySelector('div[data-user-id]')) ||
!(id = id.dataset.userId)) // or id.getAttribute('data-user-id') {
return;
}
var reader = 'https://www.google.com/reader/view/feed/';
// lifetime: 2013-03-05
var feed = encodeURIComponent('https://api.twitter.com/1/statuses/user_timeline/' + id + '.rss');
location.href = reader + feed;
})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。