Skip to content

Instantly share code, notes, and snippets.

@S64
Last active December 14, 2015 10:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save S64/5075375 to your computer and use it in GitHub Desktop.
b.twitter.greader: Twitter プロフィールページで使うと Google Reader のフィード購読ページに飛べるブックマークレット
(function(){
var url = location.href;
var user = url.replace(/^https?:\/\/(mobile\.)?twitter\.com\/(#!\/)?(\w*)\/?.*$/,'$3');
var rss = 'https://api.twitter.com/1/statuses/user_timeline.rss?screen_name='+user;
var reader;
var ua = navigator.userAgent;
if( ua.search(/(Android|iPhone|iPad|iPod)/) != -1 )
reader = 'https://www.google.com/reader/i/#stream/feed/';
else
reader = 'https://www.google.com/reader/view/feed/';
window.open(reader+encodeURIComponent(rss));
})();
javascript:(function(){var url=location.href;var user=url.replace(/^https?:\/\/(mobile\.)?twitter\.com\/(#!\/)?(\w*)\/?.*$/,'$3');var rss='https://api.twitter.com/1/statuses/user_timeline.rss?screen_name='+user;var reader;var ua=navigator.userAgent;if(ua.search(/(Android|iPhone|iPad|iPod)/)!=-1)reader='https://www.google.com/reader/i/#stream/feed/';else reader='https://www.google.com/reader/view/feed/';window.open(reader+encodeURIComponent(rss));})();
@S64
Copy link
Author

S64 commented Mar 3, 2013

Android 4.x の Stock Browser にて、アドレスバーから取ってこようとすると動きません。
Android 4.x の Chrome にて、「ブックマーク」から取ってこようとすると動きません。

どちらもブラウザの仕様によるものなので、対応は難しいですね。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment