Readernaut in Chyrp

Readernaut is the easiest way to share what you’re reading with friends.

Chyrp’s Readernaut module provides a sample twig:

Twig, a language specifically created for Chyrp, that is put through a compiler to produce PHP.

… that is unnecessarily complicated - it essentially tries to fit both the book title and book cover into a table column. I’d much rather allocate space for the book’s cover than it’s details given the small area to work with.

Ultimately, I modified themes/$theme/content/sidebar.twig to show:

To restrict the book listing to only show books that are currently being read, in modules/readernaut/readernaut.php:

1
2
3
4
5
6
## The actual data
public function books($limit=10) {
$config = Config::current();
$xml = simplexml_load_string(get_remote('http://readernaut.com/api/v1/xml/'.$config->readernaut_user.'/books/reading/?limit='.$limit));
return $xml->reader_book;
}

.. essentially changing the path to the reading list from books/ to books/reading/.