NYT Bestsellers are now displayed in a sortable table with isbn, author, title and description of each book
This commit is contained in:
@ -171,6 +171,7 @@ exports.getNewYorkTimes = function(req, res) {
|
|||||||
var url = 'http://api.nytimes.com/svc/books/v2/lists?' + query;
|
var url = 'http://api.nytimes.com/svc/books/v2/lists?' + query;
|
||||||
request.get(url, function(error, request, body) {
|
request.get(url, function(error, request, body) {
|
||||||
var bestSellers = JSON.parse(body);
|
var bestSellers = JSON.parse(body);
|
||||||
|
console.log(bestSellers.results[0].book_details);
|
||||||
res.render('api/nyt', {
|
res.render('api/nyt', {
|
||||||
title: 'New York Times API',
|
title: 'New York Times API',
|
||||||
books: bestSellers.results
|
books: bestSellers.results
|
||||||
|
@ -33,6 +33,7 @@ block content
|
|||||||
h3.text-primary Venue Detail
|
h3.text-primary Venue Detail
|
||||||
p
|
p
|
||||||
img(src='#{venueDetail.venue.photos.groups[0].items[0].prefix}150x150#{venueDetail.venue.photos.groups[0].items[0].suffix}')
|
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-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-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
|
.label.label-warning #{venueDetail.venue.likes.count} likes, #{venueDetail.venue.rating} rating
|
||||||
|
@ -3,7 +3,7 @@ extends ../layout
|
|||||||
block content
|
block content
|
||||||
.page-header
|
.page-header
|
||||||
h1
|
h1
|
||||||
i.fa.fa-music
|
i.fa.fa-building-o
|
||||||
| New York Times API
|
| New York Times API
|
||||||
.btn-group.btn-group-justified
|
.btn-group.btn-group-justified
|
||||||
a.btn.btn-lg.btn-primary(href='http://developer.github.com/guides/getting-started/', target='_blank')
|
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
|
i.fa.fa-file-text-o
|
||||||
| Documentation
|
| 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
|
Reference in New Issue
Block a user