Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
142 lines (109 sloc) 4.4 KB
<html itemscope itemtype="">
<meta itemprop="name" content="HackerNews mobile bookmarklet">
<meta itemprop="description" content="Open a HN page in HN mobile app">
<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;
<!-- 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); = id;
js.src = "//";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
<!-- google +1 -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = '';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
<h1>HNMobile Bookmarklet</h1>
<p><a href="">Lim Chee Aun</a> built a great app to view <a href="">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 = ''+id; }())">Read with HNMobile</a>
<h2>Installing on iOS devices:</h2>
<p>Create a new bookmark: Tap the "share" button and choose "Add Bookmark".</p>
<p>Copy the javascript code below.</p>
<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>
<h2>Bookmarklet code</h2>
<textarea class="code">javascript:(function(){ var id = /\?id=(\d+)/.exec(window.location+'')[1]; window.location = ''+id; }())</textarea>
<div class="buttons">
<div class="fb-like" data-href="" data-send="false" data-layout="button_count" data-width="80" data-show-faces="true"></div>
<g:plusone size="medium"></g:plusone>
<a href="" class="twitter-share-button" data-text="HackerNews mobile bookmarklet" data-via="neocoder">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);;js.src="//";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>