<?php require_once "couchdb.php"; $db = new CouchDB('hn'); $result = $db->get_item('_design/entries/_view/latest?limit=30&descending=true'); $rows = $result->getBody(true)->rows; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="css/screen.css" type="text/css" media="screen, projection" /> <link rel="stylesheet" href="css/print.css" type="text/css" media="print" /> <!--[if IE]><link rel="stylesheet" href="css/ie.css" type="text/css" media="screen, projection" /><![endif]--> <link rel="stylesheet" href="css/main.css" type="text/css" media="screen, projection" /> <script type="text/javascript" src="js/jquery.js"></script> <title>Hacker News (local)</title> </head> <body> <div class="container"> <div id="header"> <h2 class="site_id"><a href=".">news.ycombinator.local</a></h2> </div> <div id="stuff" class="main_content"> <div class="pad_28"> <ol> <?php foreach ($rows as $r) { echo "<li>";
<?php $type = $_GET['type']; $tag = $_GET['tag']; require_once "couchdb.php"; $db = new CouchDB('taskbin'); $result = $db->get_item('_design/tasks/_view/' . $type); $total_rows = $result->getBody(true)->total_rows; $rows = $result->getBody(true)->rows; $rows = array_reverse($rows); switch ($type) { case 'inbox': $ref = 'a'; break; case 'next': $ref = 'b'; break; case 'someday': $ref = 'c'; break; default: $ref = ''; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="css/screen.css" type="text/css" media="screen, projection" />
function getTasks($_type) { $db = new CouchDB('taskbin'); $tasks = $db->get_item('_design/tagged_tasks/_view/type?key=["' . urlencode($_type) . '","' . urlencode($_GET['id']) . '"]'); return $tasks->getBody(true)->rows; }
<?php require_once "couchdb.php"; $db = new CouchDB('taskbin'); $result = $db->get_item('_design/tag_counts/_view/all?group=true'); $rows = $result->getBody(true)->rows; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="css/screen.css" type="text/css" media="screen, projection" /> <link rel="stylesheet" href="css/print.css" type="text/css" media="print" /> <!--[if IE]><link rel="stylesheet" href="css/ie.css" type="text/css" media="screen, projection" /><![endif]--> <link rel="stylesheet" href="css/main.css" type="text/css" media="screen, projection" /> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> </script> <title>Tags | taskbin</title> <style> #tags li { margin-bottom: 8px; } </style> </head> <body> <div class="container"> <?php include "header.php"; ?> <div id="tags" class="span-18 push-3 last main_content">
<?php $id = $_GET['id']; $ref = $_GET['ref']; require_once "couchdb.php"; $db = new CouchDB('taskbin'); $result = $db->get_item($id); $task = $result->getBody(true)->task; $type = $result->getBody(true)->type; $tags = $result->getBody(true)->tags; function move($_id, $_type, $_ref) { $url = "move.php?id=" . $_id . "&type=" . $_type . "&ref=" . $_ref; if (isset($_GET['tag'])) { $url .= "&tag=" . urlencode($_GET['tag']); } echo $url; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="css/screen.css" type="text/css" media="screen, projection" /> <link rel="stylesheet" href="css/print.css" type="text/css" media="print" /> <!--[if IE]><link rel="stylesheet" href="css/ie.css" type="text/css" media="screen, projection" /><![endif]--> <title>Details | taskbin</title> <link rel="stylesheet" href="css/main.css" type="text/css" media="screen" /> <style>