Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

142 lines (109 sloc) 4.504 kb
<html itemscope itemtype="http://schema.org/Product">
<meta itemprop="name" content="HackerNews mobile bookmarklet">
<meta itemprop="description" content="Open a HN page in HN mobile app">
<head>
<meta name="viewport" content="width=640">
<title>Read with HNMobile</title>
<style type="text/css">
body { font:normal 13px/1.5em "Helvetica Neue", Helvetica, sans-serif;color:#585858; }
header h1 { font:bold 28px/1.2em "Helvetica Neue", Helvetica, sans-serif;color:#252525; }
p { font:normal 15px/1.5em "Helvetica Neue", Helvetica, sans-serif;color:#585858; }
h1, h2, h3, h4, h5, h6 { color:#585858; font-family: "Helvetica Neue", Helvetica, sans-serif, arial, sans-serif; }
h2 { font:bold 24px/1em "Helvetica Neue", Helvetica, sans-serif; }
h3 { font:bold 20px/1em "Helvetica Neue", Helvetica, sans-serif; }
a { color: #CC1600; }
a:hover { color: #46B1E1; }
body {
/*font: 14px/16px 'Helvetica Neue', Helvetica, Arial, sans-serif;*/
width: 640px;
margin: 0 auto;
padding: 2em 1em;
}
header {
margin: 32px 0;
}
.bookmarklet {
font: 11px/14px 'Helvetica Neue', Helvetica, Arial, sans-serif;
text-decoration: none;
background: #dadada;
padding: 3px 7px;
border-radius: 5px;
color: black !important;
}
.code {
font: 11px/14px 'Helvetica Neue', Helvetica, Arial, sans-serif;
width: 100%;
padding: 0.5em;
height: 4em;
border: 1px solid #B3B3B3;
border-radius: 5px;
background: #FEFEFE;
box-shadow: inset 1px 1px 4px #DADADA;
outline: none;
}
hr {
margin: 2em 0;
}
.buttons > div {
display: inline-block;
margin-right: 1em;
width: 80px;
vertical-align: text-top;
}
</style>
</head>
<body>
<!-- social media scripts -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=175966249095051";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<!-- google +1 -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
<header>
<h1>HNMobile Bookmarklet</h1>
</header>
<p><a href="https://github.com/cheeaun">Lim Chee Aun</a> built a great app to view <a href="http://news.ycombinator.com">HackerNews</a> on mobile devices. But sometimes you find a link to HN on some blog and there where no easy way to open that page in HNMobile until now :) Meet HNMobile Bookmarklet. This bookmarklet opens current HN page in HNMobile.</p>
<h3>The Bookemarklet:</h3>
<a class="bookmarklet" href="javascript:(function(){ var id = /\?id=(\d+)/.exec(window.location+'')[1]; window.location = 'http://cheeaun.github.io/hackerweb/#/item/'+id; }())">Read with HNMobile</a>
<h2>Installing on iOS devices:</h2>
<ol>
<li>
<p>Create a new bookmark: Tap the "share" button and choose "Add Bookmark".</p>
</li>
<li>
<p>Copy the javascript code below.</p>
</li>
<li>
<p>Edit the new bookmark (to turn it into a bookmarklet): Open your bookmarks, scroll to the one you've just created, tap the "Edit" button and select it. Delete the URL contents and paste the code (which you copied in Step 2). Hit
"Done" when finished.</p>
</li>
</ol>
<h2>Bookmarklet code</h2>
<textarea class="code">javascript:(function(){ var id = /\?id=(\d+)/.exec(window.location+'')[1]; window.location = 'http://cheeaun.github.com/hackerweb/#/item/'+id; }())</textarea>
<hr>
<div class="buttons">
<div>
<div class="fb-like" data-href="http://neocoder.github.com/hnmbookmarklet/" data-send="false" data-layout="button_count" data-width="80" data-show-faces="true"></div>
</div>
<div>
<g:plusone size="medium"></g:plusone>
</div>
<div>
<a href="https://twitter.com/share" class="twitter-share-button" data-text="HackerNews mobile bookmarklet" data-via="neocoder">Tweet</a>
</div>
</div>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.