{"id":1423,"date":"2011-08-02T20:13:46","date_gmt":"2011-08-02T18:13:46","guid":{"rendered":"http:\/\/planetozh.com\/blog\/?p=1423"},"modified":"2011-08-02T20:17:14","modified_gmt":"2011-08-02T18:17:14","slug":"mutwual-twitter-bookmarklet-quickly-check-if-someone-follows-you","status":"publish","type":"post","link":"https:\/\/planetozh.com\/blog\/2011\/08\/mutwual-twitter-bookmarklet-quickly-check-if-someone-follows-you\/","title":{"rendered":"Mutwual, A Twitter Bookmarklet To Quickly Check If Someone Follows You"},"content":{"rendered":"<p>Often when viewing a Twitter profile, the same comment pops into my mind: &quot;Does this person follow me?&quot;. That&#39;s a basic information Twitter profiles still fail to clearly show.<\/p>\n<p>There&#39;s a neat site you may know already, <a href=\"http:\/\/doesfollow.com\/\">doesfollow.com<\/a>, which lets you know if <tt>user1<\/tt> follows <tt>user2<\/tt> in a very simple way: check <tt>http:\/\/doesfollow.com\/user1\/user2<\/tt> (<a href=\"http:\/\/doesfollow.com\/ozh\/britneyspears\">example<\/a>). Simple, but this lacks automation and geek fun. Let&#39;s make a cute bookmarklet out of this.<br \/>\n<!--more--><\/p>\n<p>The javascript is fairly simple: get Twitter username, create a new page with a frameset and in each frame launch two instances of doesfollow.com to check for mutual followitude. <\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">javascript<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"javascript\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">(function () {<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; var me = 'ozh',<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; &nbsp; &nbsp; df = 'http:\/\/doesfollow.com\/',<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; &nbsp; &nbsp; d = document,<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; &nbsp; &nbsp; t = d.location.toString().replace(\/.*twitter.com\\\/#!\\\/\/, '').replace(\/\\\/\/, ''),<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; &nbsp; &nbsp; nw = window.open(),<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; &nbsp; &nbsp; f = '&lt;frame frameborder=0&gt;',<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; &nbsp; &nbsp; nd = nw.document;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; nd.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;Mutwual - bookmarklet by @ozh&lt;\/title&gt;&lt;\/head&gt;&lt;frameset cols=50%,50%,0%&gt;'+f+f+'&lt;frame src=http:\/\/bit.ly\/fmutwual frameborder=0&gt;&lt;\/frameset&gt;&lt;\/html&gt;');<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; nd.body.childNodes[0].src = df + '\/' + me + '\/' + t;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; nd.body.childNodes[1].src = df + '\/' + t + '\/' + me;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; nd.close();<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">})();<\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>This bookmarklet has my name (<tt>'ozh'<\/tt>) hardcoded in it, so don&#39;t forget to edit it with your own Twitter username.<\/p>\n<p>The bookmarklet also loads in a hidden frame this very page with a few Google Analytics variable set: I figured it would be fun to add some cheap anonymous analytics and monitor bookmarklet usage. If that somehow hurts your privacy concerns, feel free to remove that third frame of course.<\/p>\n<p>Handy bookmarklet link: <a href=\"javascript:(function%20(){var%20me='ozh',df='http:\/\/doesfollow.com\/',d=document,t=d.location.toString().replace(\/.*twitter.com\\\/#!\\\/\/,'').replace(\/\\\/\/,''),nw=window.open(),f='&lt;frame%20frameborder=0&gt;',nd=nw.document;nd.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;Mutwual%20-%20bookmarklet%20by%20@ozh&lt;\/title&gt;&lt;\/head&gt;&lt;frameset%20cols=50%,50%,0%&gt;'+f+f+'&lt;frame%20src=http:\/\/bit.ly\/fmutwual%20frameborder=0&gt;&lt;\/frameset&gt;&lt;\/html&gt;');nd.body.childNodes[0].src=df+'\/'+me+'\/'+t;nd.body.childNodes[1].src=df+'\/'+t+'\/'+me;nd.close();})();\">Mutwual<\/a> (drag this link to your toolbar or bookmark it &#8212; remember, edit it so it works with your name)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often when viewing a Twitter profile, the same comment pops into my mind: &quot;Does this person follow me?&quot;. That&#39;s a basic information Twitter profiles still fail to clearly show. There&#39;s a neat site you may know already, doesfollow.com, which lets you know if user1 follows user2 in a very simple way: check http:\/\/doesfollow.com\/user1\/user2 (example). Simple, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[293,2,7,292],"class_list":["post-1423","post","type-post","status-publish","format-standard","hentry","category-published","tag-bookmarklet","tag-code","tag-javascript","tag-twitter"],"_links":{"self":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/1423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/comments?post=1423"}],"version-history":[{"count":0,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/1423\/revisions"}],"wp:attachment":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/media?parent=1423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/categories?post=1423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/tags?post=1423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}