CINXE.COM

Charlie Harvey REST Content API Documentation -- Charlie Harvey

<!DOCTYPE html> <html lang="en-GB"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- ; RIP Seymour Papert pc 2 pd repeat 180[fd 1 rt 2] --> <meta name="description" content="Documentation for the charlieharvey.org.uk REST Content API, with some sample code and a few examples." /> <meta name="keywords" content="charlie harvey, charlie, harvey, perl, html, punk, punk rock, cider, ciderpunx, direct action, boozeulator, daily mail generator, code, floss, gnu/linux, hacker, geekery" /> <meta name="news_keywords" content="charlie harvey, ciderpunx" /> <meta name="author" content="Charlie Harvey" /> <meta name="generator" content="Dancer 1.3500: Minimalist perl web framework. Vim: text editor." /> <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Libre+Baskerville:400,400italic,700%7CCabin:400,700%7CInconsolata:400" type="text/css" /> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" media="screen"/> <link rel="stylesheet" href="//static.charlieharvey.org.uk/css/style.css" media="screen" /> <link rel="alternate" type="application/rss+xml" title="RSS: Blog Posts" href="/page/feed/rss" /> <link rel="alternate" type="application/rss+xml" title="RSS: Comments" href="/comment/feed/rss" /> <link rel="alternate" type="application/rss+xml" title="RSS: Files" href="/file/feed/rss" /> <link rel="alternate" type="application/rss+xml" title="RSS: Flickr images" href="http://flickr.com/services/feeds/photos_public.gne?id=8361414@N05&amp;lang=en-us&amp;format=rss_200"> <link rel="license copyright" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" /> <link rel="shortcut icon" href="//static.charlieharvey.org.uk/favicon.ico" /> <link rel="canonical" href="/about/api " /> <!-- TODO: These shouldn't show for example on the rss aggregator page--> <meta property="og:title" content="Charlie Harvey REST Content API Documentation" /> <meta property="og:locale" content="en_GB" /> <meta property="og:type" content="article" /> <meta property="og:url" content="/about/api" /> <meta property="og:site_name" content="charlieharvey.org.uk" /> <meta property="og:description" content="Documentation for the charlieharvey.org.uk REST Content API, with some sample code and a few examples." /> <meta property="twitter:card" content="summary_large_image" /> <meta property="twitter:title" content="Charlie Harvey REST Content API Documentation" /> <meta property="twitter:domain" content="charlieharvey.org.uk" /> <meta property="twitter:description" content="Documentation for the charlieharvey.org.uk REST Content API, with some sample code and a few examples." /> <meta property="twitter:creator" content="@ciderpunx" /> <meta property="twitter:site" content="@ciderpunx" /> <meta property="dc.title" content="Charlie Harvey REST Content API Documentation" /> <meta property="dc.creator" content="Charlie Harvey" /> <meta property="dc.subject" content="Charlie Harvey REST Content API Documentation" /> <meta property="dc.description" content="Documentation for the charlieharvey.org.uk REST Content API, with some sample code and a few examples." /> <meta property="dc.publisher" content="charlieharvey.org.uk" /> <meta property="dc.contributor" content="Charlie Harvey" /> <meta property="dc.language" content="en-GB" /> <!--[if lt IE 9]><script src="//static.charlieharvey.org.uk/js/vendor/respond.min.js"></script><script src="//static.charlieharvey.org.uk/js/vendor/html5shiv-printshiv.js"></script><script src="//cdn.jsdelivr.net/jquery/1.10.2/jquery-1.10.2.min.js"></script><![endif]--> <!--[if gte IE 9]><!--><script src="//static.charlieharvey.org.uk/js/zepto.min.js"></script><!--<![endif]--> <title>Charlie Harvey REST Content API Documentation -- Charlie Harvey</title> </head> <body> <!--t:header--> <p class="hidden"><a id="top" href="#content">Skip navigation</a></p> <header class="titlebar"> <h1><a rel="me home" class="fn url no_under" href="/">Charlie Harvey</a></h1> </header> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">Menu</button> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li ><a class="tag me" href="/" >Home</a></li> <li class="dropdown "> <a class="dropdown-toggle" href="#" data-toggle="dropdown">Blog<strong class="caret"></strong></a> <ul class="dropdown-menu" role="menu"> <li><a class="nav tag me" href="/page/index" accesskey="B">Blog home</a></li> <li class="divider"></li> <li><a class="nav tag me" href="/page/geekery">Geekery</a></li> <li><a class="nav tag me" href="/page/cider">Cider reviews</a></li> <li><a class="nav tag me" href="/page/projects">Projects</a></li> <li><a class="nav tag me" href="/page/activism">Activism</a></li> <li><a class="nav tag me" href="/page/reading_lists">Reading</a></li> <li><a class="nav tag me" href="/page/design">Design &amp; photography</a></li> <li><a class="nav tag me" href="/page/musings_rants_oped">Musings</a></li> <li><a class="nav tag me" href="/page/vegan_recipes">Vegan recipes</a></li> <li><a class="nav tag me" href="/page/fun_and_games">Fun and games</a></li> </ul> </li> <li ><a class="nav tag me" href="/file/archive/1" accesskey="W">Files</a></li> <li ><a class="nav tag me" href="/flick/list/1" accesskey="I">Images</a></li> <li class="dropdown active"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">About<strong class="caret"></strong></a> <ul class="dropdown-menu" role="menu"> <li><a class="nav tag" href="/about" accesskey="?">About</a></li> <li><a class="nav tag me" href="/cv.pl" accesskey="R">CV</a></li> <li><a class="nav tag" href="/popular/week">Popular this week</a></li> <li><a class="nav tag" href="/about/feeds">RSS and Atom feeds</a></li> <li><a class="nav tag" href="/about/api">Content API</a></li> <li><a class="nav tag" href="/page/privacy">Privacy statement</a></li> <li><a class="nav tag me" href="/contact_charlie" accesskey="@">Contact</a></li> </ul> </li> </ul> <div class="searchbox right nav navbar-right pull-right"> <form method="get" id="search" class="navbar-form" role="search" action="/ddg"> <div class="input-group" id="search-input-group"> <label class="search-label hidden" for="st-search-input">Search:</label> <input type="text" name="q" maxlength="255" tabindex="1" placeholder="Search" id="st-search-input" /> <div class="input-group-btn"> <button type="submit" tabindex="2" name="go" value="" id="go" class="btn btn-default"> <span class="glyphicon glyphicon-search"></span> </button> </div> <label for="go" class="hidden">Go</label> </div> </form> </div> </div><!--/.nav-collapse --> </div> </nav> <!--/header--> <div id="page" class="container"> <!--t:about-api--> <div class="hidden-md hidden-sm hidden-xs"> <!--t:social_block--> <div class="social-block-div"> <ul class="no-decoration" id="social-block"> <li><a href="https://twitter.com/intent/tweet?via=ciderpunx&amp;related=ciderpunx&amp;url=http://charlieharvey.org.uk/about/api&amp;text=I&#8217;m%20reading%20Charlie%20Harvey%20REST%20Content%20API%20Documentation%20&mdash;%20" class="sprite twitter">Share on Twitter</a></li> <li><a href="http://www.facebook.com/share.php?u=http://charlieharvey.org.uk/about/api&amp;t=I&#8217;m%20reading%20Charlie%20Harvey%20REST%20Content%20API%20Documentation" class="sprite facebook">Share on Facebook</a></li> <li><a href="https://plus.google.com/share?url=http://charlieharvey.org.uk/about/api" class="sprite gplus">Share on Google+</a></li> <li><a href="http://news.ycombinator.com/submitlink?u=http://charlieharvey.org.uk/about/api&amp;t=Charlie%20Harvey%20REST%20Content%20API%20Documentation" class="sprite hackernews">Share on Hacker News</a></li> </ul> <a href="javascript:void(0)" id="social-block-toggle" class="visible-lg">&#8599;</a> </div> <!--/social_block--> </div> <article id="about-api" class="entry-content drop-cap"> <h1>Charlie Harvey REST Content API Documentation</h1> <p>There is an <abbr title="Application Programming Interface">API</abbr> of sorts for my site content. It uses <abbr title="REpresentational State Transfer">REST</abbr> to provide read access to the site content, which is all fine to use under <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons BY-NC-SA</a>. Open data and all that. You don&#8217;t need a key to use it or any of that bullshit. But I would <em>love</em> to <a href="/contact">hear what you do</a> with it if you do.</p> <p>For people who don&#8217;t need no stinking API I also provide <a href="/about/feeds">RSS and Atom feeds</a> of much of the site content.</p> <h2>Usage</h2> <p>The API is a standard REST-type of a setup, but in a different namespace to the normal site HTML.</p> <p>The data are returned as <a href="http://json.org/">JSON</a> by default, but you can modify the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">Accept header</a> to receive <a href="http://www.w3.org/TR/REC-xml/">XML</a> or <a href="http://yaml.org/">YAML</a> if that&#8217;s your bag. No other formats are supported.</p> <p>The following code examples illustrate how the API is used. The responses are truncated for brevity</p> <h3>Code examples</h3> <ul class="no-decoration"> <li>Recent pages as JSON (default) <code class="bash">$ curl http://charlieharvey.org.uk/page/api/recent { "pages" : [ { "link" : "http://beta.charlieharvey.org.uk:3000/page/2013_reading_roundup", "author" : "Charlie Harvey", "parent_id" : "257", "created_at" : "2013-12-23", "summary" : "Last year I did a rundown of the books I read in 2012, mostly as I wanted to play with infogr.am. But also, let&#8217;s face it, because my propensity to navel-gaze craves occasional indulgence. This year I repeat the experiment in a yearly roundup of my reading habits&hellip; Reading stat", "slug" : "2013_reading_roundup", "id" : "316", "title" : "2013: My favourite books and reading stats" }, &hellip;</code> </li> <li>Recent pages as XML <code class="bash">$ curl -H"Accept:text/xml" http://charlieharvey.org.uk/page/api/recent &lt;data&gt; &lt;pages id="316" author="Charlie Harvey" created_at="2013-12-23" link=&hellip;</code> </li> <li>Recent pages as YAML <code class="bash">$ curl -H"Accept:text/x-yaml" http://charlieharvey.org.uk/page/api/recent --- pages: - author: Charlie Harvey created_at: 2013-12-23 id: 316 link: &hellip;</code> </li> <li>Using jQuery to pull recent pages into an html page <code class="html">&lt;html&gt; &lt;head&gt; &lt;title&gt;Blog example&lt;/title&gt; &lt;script src="//code.jquery.com/jquery-1.8.1.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Blogs from charlieharveyr.org.uk&lt;/h1&gt; &lt;div id="blogs"&gt; &lt;/div&gt; &lt;script&gt; (function() { var blogsAPI = "/page/api/recent"; var the_things = []; $.getJSON( blogsAPI, {}) .done(function( data ) { $.each( data.pages, function( i, page ) { the_things.push( "&lt;li&gt;&lt;h4&gt;&lt;a href='" + page.link + "'&gt;"+ page.title +"&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;" + page.summary + "&lt;/p&gt;&lt;/li&gt;" ); }); $( "&lt;ul/&gt;", { "class": "no-decoration tinytext", html: the_things.join( "" ) }).appendTo( "#blogs" ); }); })(); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;</code> </li> </ul> <h2>API endpoints</h2> <p> In the following documentation, parameters to API calls are shown in square brackets like this: [id] </p> <h3>Pages</h3> <p><em>The content under the blog section of the website is referred to as pages by the API</em></p> <dl> <dt><h4>Recent pages</h4></dt> <dd>Retrieve the 10 most recently published pages <code class="bash">$ curl http://charlieharvey.org.uk/page/api/recent</code> Resulting in JSON like this <code class="json">{ "pages" : [ { "link" : "http://beta.charlieharvey.org.uk:3000/page/2013_reading_roundup", "author" : "Charlie Harvey", "parent_id" : "257", "created_at" : "2013-12-23", "summary" : "Last year I did a rundown of the books I read in 2012, mostly as I wanted to play with infogr.am. But also, let&#8217;s face it, because my propensity to navel-gaze craves occasional indulgence. This year I repeat the experiment in a yearly roundup of my reading habits&hellip; Reading stat", "slug" : "2013_reading_roundup", "id" : "316", "title" : "2013: My favourite books and reading stats" }, &hellip; ] }</code> </dd> <dt><h4>Single page by [id]</h4></dt> <dd>Retrieve the page with id [id] <code class="bash">$ curl http://charlieharvey.org.uk/page/api/1</code> Resulting in JSON like this <code class="json">{ "page" : { "link" : "http://beta.charlieharvey.org.uk:3000/page/index", "author" : "Charlie Harvey", "parent_id" : "0", "created_at" : "2005-11-09", "summary" : "These pages contain bits of html, perl, sysadminning, activism, politics and that for your perusal&hellip;", "slug" : "index", "id" : "1", "title" : "Blog" } }</code> </dd> </dl> <h3>Social</h3> <dl> <dt><h4>All social</h4></dt> <dd>Return two lists &mdash; one of my 10 most recent tweets and one of my 10 most recent scrobbles <code class="bash">$ curl http://charlieharvey.org.uk/social/api/all</code> Resulting in JSON like this <code class="json">{ "tweets" : [ { "link" : "https://twitter.com/ciderpunx/status/417563169138044928", "title" : "&lt;a href=\"http://search.twitter.com/search?q=%23security\"&gt;#security&lt;/a&gt; New Fund to Support Snowden-like Whistleblowers: HAMBURG &ndash; A new foundation to support wh... &lt;a href=\"http://wrd.cm/19wQVkG\"&gt;http://wrd.cm/19wQVkG&lt;/a&gt;&nbsp; &#x267A; &lt;a href=\"http://twitter.com/wired\"&gt;@wired&lt;/a&gt;" }, { "link" : "https://twitter.com/ciderpunx/status/417450940824694784", "title" : "&lt;a href=\"http://search.twitter.com/search?q=%23security\"&gt;#security&lt;/a&gt; WikiLeaks&rsquo; Assange: Sysadmins of the World, Unite!: HAMBURG &ndash; Faced with increasing encro... &lt;a href=\"http://wrd.cm/19z3kYz\"&gt;http://wrd.cm/19z3kYz&lt;/a&gt;&nbsp; &#x267A; &lt;a href=\"http://twitter.com/wired\"&gt;@wired&lt;/a&gt;" }, &hellip; ], "scrobbles" : [ { "link" : "http://www.last.fm/music/Johann+Sebastian+Bach/_/Orchestral+Suite+No.1+in+C,BWV", "title" : "Johann Sebastian Bach &ndash; Orchestral Suite No.1 in C,BWV" }, { "link" : "http://www.last.fm/music/Johann+Sebastian+Bach/_/Orchestral+Suite+No.1+in+C,BWV", "title" : "Johann Sebastian Bach &ndash; Orchestral Suite No.1 in C,BWV" }, &hellip; ] }</code> </dd> <dt><h4>Scrobbles</h4></dt> <dd>Return a list of my 10 most recent scrobbles <code class="bash">$ curl http://charlieharvey.org.uk/social/api/scrobbles</code> Resulting in JSON like this <code class="json">{ "scrobbles" : [ { "link" : "http://www.last.fm/music/Johann+Sebastian+Bach/_/Orchestral+Suite+No.1+in+C,BWV", "title" : "Johann Sebastian Bach &ndash; Orchestral Suite No.1 in C,BWV" }, { "link" : "http://www.last.fm/music/Johann+Sebastian+Bach/_/Orchestral+Suite+No.1+in+C,BWV", "title" : "Johann Sebastian Bach &ndash; Orchestral Suite No.1 in C,BWV" }, &hellip; ] }</code> </dd> <dt><h4>Tweets</h4></dt> <dd>Return a list of my 10 most recent tweets <code class="bash">$ curl http://charlieharvey.org.uk/social/api/tweets</code> Resulting in JSON like this <code class="json">{ "tweets" : [ { "link" : "https://twitter.com/ciderpunx/status/417563169138044928", "title" : "&lt;a href=\"http://search.twitter.com/search?q=%23security\"&gt;#security&lt;/a&gt; New Fund to Support Snowden-like Whistleblowers: HAMBURG &ndash; A new foundation to support wh... &lt;a href=\"http://wrd.cm/19wQVkG\"&gt;http://wrd.cm/19wQVkG&lt;/a&gt;&nbsp; &#x267A; &lt;a href=\"http://twitter.com/wired\"&gt;@wired&lt;/a&gt;" }, { "link" : "https://twitter.com/ciderpunx/status/417450940824694784", "title" : "&lt;a href=\"http://search.twitter.com/search?q=%23security\"&gt;#security&lt;/a&gt; WikiLeaks&rsquo; Assange: Sysadmins of the World, Unite!: HAMBURG &ndash; Faced with increasing encro... &lt;a href=\"http://wrd.cm/19z3kYz\"&gt;http://wrd.cm/19z3kYz&lt;/a&gt;&nbsp; &#x267A; &lt;a href=\"http://twitter.com/wired\"&gt;@wired&lt;/a&gt;" }, &hellip; ] }</code> </dd> </dl> <h3>Files</h3> <dl> <dt><h4>Recent files</h4></dt> <dd>Return a list of my 10 most recent files <code class="bash">$ curl http://charlieharvey.org.uk/file/api/recent</code> Resulting in JSON like this <code class="json">{ "files" : [ { "body" : "&lt;p&gt;Twitter recently got rid of the ability to get search results as an RSS as part of their API update of 11 June 2013.&lt;/p&gt; &lt;p&gt;I found those feeds rather useful, so I made a little screen scraper that reimplements the functionality without needing to auth against their API (it just pulls the results out of the web search page). I guess this will be good for a while longer, like enough time to switch to &lt;a href=\"http://status.net/\"&gt;statusnet&lt;/a&gt;, identica, or whatever.&lt;/p&gt;&lt;p&gt;It might be of use to some others in the monastry and illustrates the power of &lt;a href=\"http://search.cpan.org/~mirod/HTML-TreeBuilder-XPath-0.14/lib/HTML/TreeBuilder/XPath.pm\"&gt;HTML::TreeBuilder::XPath&lt;/a&gt;.&lt;/p&gt;", "link" : "http://beta.charlieharvey.org.uk:3000/file/uid/111", "created_at" : "2013-06-17", "author" : "Charlie Harvey", "category" : "culture", "id" : "111", "title" : "tweetsearch_to_rss.pl: Get twitter searches as an RSS feed with perl" }, &hellip; ] }</code> </dd> <dt><h4>Recent files in [category]</h4></dt> <dd>Return a list of the 10 most recent files in a category <code class="bash">$ curl http://charlieharvey.org.uk/file/api/culture/recent</code> Resulting in JSON like this <code class="json">{ "files" : [ { "body" : "&lt;p&gt;Twitter recently got rid of the ability to get search results as an RSS as part of their API update of 11 June 2013.&lt;/p&gt; \r\n\r\n&lt;p&gt;I found those feeds rather useful, so I made a little screen scraper that reimplements the functionality without needing to auth against their API (it just pulls the results out of the web search page). I guess this will be good for a while longer, like enough time to switch to &lt;a href=\"http://status.net/\"&gt;statusnet&lt;/a&gt;, identica, or whatever.&lt;/p&gt;\r\n\r\n&lt;p&gt;It might be of use to some others in the monastry and illustrates the power of &lt;a href=\"http://search.cpan.org/~mirod/HTML-TreeBuilder-XPath-0.14/lib/HTML/TreeBuilder/XPath.pm\"&gt;HTML::TreeBuilder::XPath&lt;/a&gt;.&lt;/p&gt;", "link" : "http://beta.charlieharvey.org.uk:3000/file/uid/111", "created_at" : "2013-06-17", "author" : "Charlie Harvey", "category" : "culture", "id" : "111", "title" : "tweetsearch_to_rss.pl: Get twitter searches as an RSS feed with perl" }, &hellip; ] }</code> </dd> <dt><h4>Details of file by [id]</h4></dt> <dd>Return the details of file id [id] <code class="bash">$ curl http://charlieharvey.org.uk/file/api/[id]</code> Resulting in JSON like this <code class="json">{ "file" : { "body" : "&lt;p&gt;Twitter recently got rid of the ability to get search results as an RSS as part of their API update of 11 June 2013.&lt;/p&gt; &lt;p&gt;I found those feeds rather useful, so I made a little screen scraper that reimplements the functionality without needing to auth against their API (it just pulls the results out of the web search page). I guess this will be good for a while longer, like enough time to switch to &lt;a href=\"http://status.net/\"&gt;statusnet&lt;/a&gt;, identica, or whatever.&lt;/p&gt;&lt;p&gt;It might be of use to some others in the monastry and illustrates the power of &lt;a href=\"http://search.cpan.org/~mirod/HTML-TreeBuilder-XPath-0.14/lib/HTML/TreeBuilder/XPath.pm\"&gt;HTML::TreeBuilder::XPath&lt;/a&gt;.&lt;/p&gt;", "link" : "http://beta.charlieharvey.org.uk:3000/file/uid/111", "created_at" : "2013-06-17", "author" : "Charlie Harvey", "category" : "culture", "id" : "111", "title" : "tweetsearch_to_rss.pl: Get twitter searches as an RSS feed with perl" } }</code> </dd> </dl> <h3>Comments</h3> <dl> <dt><h4></h4></dt> <dd>Return a list of the 10 most recently published comments <code class="bash">$ curl http://charlieharvey.org.uk/comment/api/recent</code> Resulting in JSON like this <code class="json">{ "comments" : [ { "body" : "Ey Charlie, nice story you did a pretty good job.\r\nthanks for sharing it : )", "link" : "http://beta.charlieharvey.org.uk:3000/comment/317", "created_at" : "2013-12-19", "url" : null, "nick" : null, "id" : "317", "title" : null }, &hellip; ] }</code> </dd> <dt><h4>Comment by [id]</h4></dt> <dd>Return the details of comment id [id] <code class="bash">$ curl http://charlieharvey.org.uk/comment/api/111</code> Resulting in JSON like this <code class="json">{ "comment" : { "link" : "http://beta.charlieharvey.org.uk:3000/comment/111", "body" : "Props to Grumpy Git for liveblogging a cider tasting in the comments thread ;-) Glad you had some cidery fun and hope you didn&#39;t get into a fight!", "created_at" : "2011-09-01", "url" : "http://charlieharvey.org.uk/page/index/", "title" : "Liveblogging", "nick" : "Charlie", "id" : "111" } }</code> </dd> </dl> <h3>Tags</h3> <dl> <dt><h4>All tags</h4></dt> <dd>Return a list of <em>all</em> tags <code class="bash">$ curl http://charlieharvey.org.uk/tag/api</code> Resulting in JSON like this <code class="json">{ "tags" : [ { "link" : "http://beta.charlieharvey.org.uk:3000/tag/1in12", "id" : "400", "title" : "1in12" }, { "link" : "http://beta.charlieharvey.org.uk:3000/tag/2012", "id" : "477", "title" : "2012" }, &hellip; }</code> </dd> <dt><h4></h4></dt> <dd>Return a list of content tagged with the tag that has id [id] <code class="bash">$ curl http://charlieharvey.org.uk/tag/api/477</code> Resulting in JSON like this <code class="json">{ "tag" : { "link" : "http://beta.charlieharvey.org.uk:3000/tag/2012", "writings" : [], "id" : "477", "title" : "2012", "pages" : [ { "link" : "http://beta.charlieharvey.org.uk:3000/page/self_indulgent_navel_gazing_about_books_i_read_in_2012", "summary" : "It is traditional &mdash; and who am I to dispute traditions? &mdash; to publish navel-gazing lists and yearly \"roundups\" at or about New Year. So, I have had a self-indulgent look back at 2012 through the lens of the books that I read and articles that I wrote this year. Gimme some stats", "updated_at" : "2012-12-30", "author" : "Charlie Harvey", "id" : "255", "title" : "2012 Reading Highlights" } ] } }</code> </dd> </dl> <h3>Popular</h3> <dl> <dt><h4>Popular for [week|month|year|all-time]</h4></dt> <dd>Return a list of the most popular content for the last [week|month|year] or for [all-time] <code class="bash">$ curl http://charlieharvey.org.uk/popular/week/api</code> Resulting in JSON like this. Note that an array of pages in order of populartiy and an associative array of page names to details are returned. The associative array may not be in order. <code class="json">{ "page_titles_ordered" : [ "127.0.0.1", "Pages : Motherboard details from the GNU/Linux commandline", "Pages : Rooting the Coby Kyros MID9742 Android tablet", "Pages : Tool: Twitter RSS Feed Getter", "Pages : Ettercap remote_browser Plugin Fun", "Pages : Split multi-page PDFs into single page PDFs on GNU/Linux with pdftk", "Pages : Tip: Latest Chromium Browser on Debian Squeeze", "Daily Mail Story Generator", "About", "Pages : Gnome 3 Nautilus Tip &mdash; Make the Delete Key Delete Files" ], "pages" : { "Pages : Split multi-page PDFs into single page PDFs on GNU/Linux with pdftk" : { "hits" : "36", "unique_visits" : "34", "url" : "charlieharvey.org.uk/page/howto_breaking_pdfs_up_into_mutiple_pages", "title" : "Pages : Split multi-page PDFs into single page PDFs on GNU/Linux with pdftk" }, "Pages : Ettercap remote_browser Plugin Fun" : { "hits" : "46", "unique_visits" : "37", "url" : "charlieharvey.org.uk/page/ettercap_remote_browser_fun", "title" : "Pages : Ettercap remote_browser Plugin Fun" } &hellip; } }</code> </dd> </dl> <h3>ROT-13</h3> <dl> <dt><a name="rot13"></a><h4>ROT-13 [string_to_ROT13]</h4></dt> <dd>Return the <a href="/rot-13">ROT-13ed</a> string of [string_to_ROT13]. Strings ought to be URL encoded. Note that ROT-13ing a string twice un-ROT-13s it. <code class="bash">$ curl http://charlieharvey.org.uk/rot13/api/rot-13+roolz</code> Resulting in JSON like this <code class="json">{ "msg" : "ebg-13+ebbym" }</code> </dd> </dl> </article> <!--/api--> </div> <!--t:footer--> <footer id="footer" class="footer"> <div id="footwrap" class="container"> <ul class="row"> <li class="col-sm-3"> <section> <h3>Onsite links</h3> <!--t:onsite_link_ul--> <ul class="xoxo"> <li><a href="/daily_mail.pl">Daily Mail story generator</a></li> <li><a href="/newsfeed">Newsfeeds</a></li> <li><a href="/page/space_invaders">Space Invaders</a></li> <li><a href="/mills_boon.pl">Statistically probable Mills and Boon stories</a></li> <li><a href="/html_static/real_ultimate_perlgeeks.html">Real Ultimate Perl Geeks</a></li> <li><a href="/rot13">ROT13 Tool</a></li> <li><a href="/about/api">Content API</a></li> <li><a href="/contact_charlie">Contact</a></li> </ul> <!--/onsite_link_ul--> </section> </li> <li class="col-sm-3"> <section> <h3>External links</h3> <!--t:external_link_ul--> <ul class="xoxo"> <li><a href="http://charlie.ox4.org" rel="me">Charlie's Drupal Life Aggregator</a></li> <li><a href="http://perlmonks.org/?node_id=373188" rel="me">Perlmonks page</a></li> <li><a href="http://slashdot.org/~ciderpunk" rel="me">Slashdot page</a></li> <li><a href="https://github.com/ciderpunx">Charlie&#8217;s repositories on github</a></li> </ul> <!--/external_link_ul--> </section> </li> <li class="col-sm-3"> <section> <h3>Friends</h3> <!--t:friend_site_ul--> <ul class="xoxo"> <li><a href="http://ox4.org/" rel="friend co-worker met">OX4: Webhosting for Oxford Activism</a></li> <li><a href="http://newint.org" rel="friend co-worker met">New Internationalist</a></li> <li><a href="http://hacktivista.net/" rel="friend co-worker met">Hacktionlab</a></li> <li><a href="http://eleanorg.org" rel="friend sweetheart date met muse">Nor&#8217;s Page</a></li> <li><a href="http://artfulrobot.com/" rel="friend met">Rich&#8217;s page</a></li> <li><a href="http://oxguin.net" rel="friend met">Graham&#8217;s page</a></li> <li><a href="http://theoarc.org.uk/" rel="friend co-worker met">Oxford Action Resource Centre</a></li> </ul> <!--/friend_site_ul--> </section> </li> <li class="col-sm-3"> <section> <h3>Follow me</h3> <!--t:social_media_ul--> <ul class="xoxo"> <li><a href="http://twitter.com/ciderpunx" rel="me"><div class="sprite32 twitter pull-left"> </div><div class="pull-left"> &nbsp; @ciderpunx</div></a><div class="clear"></div></li> <li><a href="http://flickr.com/photos/charlie_harvey" rel="me"><div class="sprite32 flickr pull-left"></div><div class="pull-left"> &nbsp; flickr</div></a><div class="clear"></div></li> <li><a href="http://uk.linkedin.com/in/charlieharvey"><div class="sprite32 linkedin pull-left"></div><div class="pull-left"> &nbsp; LinkedIn</div></a><div class="clear"></div></li> <li><a href="http://last.fm/user/ciderpunx" rel="me"><div class="sprite32 lastfm pull-left"></div><div class="pull-left"> &nbsp; last.fm</div></a><div class="clear"></div></li> <li><a href="/page/feed/rss" rel="me"><div class="sprite32 rss pull-left"></div><div class="pull-left"> &nbsp; RSS</div></a><div class="clear"></div></li> </ul> <!--/social_media_ul--> </section> </li> </ul> <p id="copyright" class="centre">&copy; Charlie Harvey 2003-2024. You can use the content under the <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">BY-NC-SA</a>. The code is under the <a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU Affero licence</a> and is on <a href="https://github.com/ciderpunx/charlieharvey.org.uk">Github</a>.</p> </div> </footer> <script src="//static.charlieharvey.org.uk/js/min-new.js"></script> <script>// <![CDATA[ $(document).ready(function() { $('code').each(function(i, e) {hljs.highlightBlock(e)}); }); $( "#social-block-toggle" ).click(function() { $( "#social-block" ).slideToggle( "slow", function() { if ($('#social-block-toggle').html()==$('<div/>').html('&#8599').html()) { $('#social-block-toggle').html("&#8601;"); } else{ $('#social-block-toggle').html("&#8599;"); } }); }); $( "#sidebar-toggle" ).click(function() { $( "#sidebar" ).slideToggle( "slow", function() { if ($('#sidebar-toggle').html()==$('<div/>').html('&#8599').html()) { $('#sidebar-toggle').html("&#8601;"); } else{ $('#sidebar-toggle').html("&#8599;"); } }); }); // ]]></script> <script>// <![CDATA[ var _paq = _paq || []; _paq.push(["setCookieDomain", "*.charlieharvey.org.uk"]); _paq.push(["trackPageView"]); _paq.push(["enableLinkTracking"]); (function() { var u=(("https:" == document.location.protocol) ? "https" : "http") + "://piwik.charlieharvey.org.uk/"; _paq.push(["setTrackerUrl", u+"piwik.php"]); _paq.push(["setSiteId", "1"]); var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s); })(); // ]]> </script> <!--/footer--> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10