NYT Bestsellers are now displayed in a sortable table with isbn, author, title and description of each book

This commit is contained in:
Sahat Yalkabov
2013-12-10 01:27:58 -05:00
parent 3bd21d9244
commit bb577d43ea
3 changed files with 20 additions and 2 deletions

View File

@ -171,6 +171,7 @@ exports.getNewYorkTimes = function(req, res) {
var url = 'http://api.nytimes.com/svc/books/v2/lists?' + query;
request.get(url, function(error, request, body) {
var bestSellers = JSON.parse(body);
console.log(bestSellers.results[0].book_details);
res.render('api/nyt', {
title: 'New York Times API',
books: bestSellers.results

View File

@ -33,6 +33,7 @@ block content
h3.text-primary Venue Detail
p
img(src='#{venueDetail.venue.photos.groups[0].items[0].prefix}150x150#{venueDetail.venue.photos.groups[0].items[0].suffix}')
.label.label-primary #{venueDetail.venue.name} (#{venueDetail.venue.categories[0].shortName})
.label.label-success #{venueDetail.venue.location.address}, #{venueDetail.venue.location.city}, #{venueDetail.venue.location.state}
.label.label-warning #{venueDetail.venue.likes.count} likes, #{venueDetail.venue.rating} rating

View File

@ -3,7 +3,7 @@ extends ../layout
block content
.page-header
h1
i.fa.fa-music
i.fa.fa-building-o
| New York Times API
.btn-group.btn-group-justified
a.btn.btn-lg.btn-primary(href='http://developer.github.com/guides/getting-started/', target='_blank')
@ -16,4 +16,20 @@ block content
i.fa.fa-file-text-o
| Documentation
p nyt api
h3 Young Adult Best Sellers
table.dataTable.table.table-striped.table-bordered
thead
tr
th Rank
th Title
th.hidden-xs Description
th Author
th.hidden-xs ISBN-13
tbody
for book in books
tr
td= book.rank
td= book.book_details[0].title
td.hidden-xs= book.book_details[0].description
td= book.book_details[0].author
td.hidden-xs= book.book_details[0].primary_isbn13