so books_使用《纽约时报》和Google Books API建立畅销书清单

so books

by Andrew Bales

通过安德鲁·巴尔斯

使用《纽约时报》和Google Books API建立畅销书清单 (Build a Best Sellers List with New York Times and Google Books API)

A single API may not always have all of the data you need. In this article, we’ll walk through the steps to combine two APIs by using unique identifiers from the New York Times API to grab book covers from the Google Books API.

单个API可能并不总是拥有您需要的所有数据。 在本文中,我们将通过使用“纽约时报” API的唯一标识符来获取Google图书API的书籍封面,从而逐步组合两个API。

You can find the full project on GitHub and view a demo on CodePen.

您可以在GitHub上找到完整的项目,并在CodePen 查看演示。

Here are the steps we’ll cover:

以下是我们将介绍的步骤:

  1. Fetch best selling books data from the New York Times API.

    从《纽约时报》 API获取最畅销的图书数据。
  2. Append listings to the DOM.

    将列表追加到DOM。
  3. Query the Google Books API with ISBN numbers to add cover images to the listings.

    使用ISBN号查询Google Books API,以将封面图像添加到清单中。

At the end of the tutorial, you’ll have a best sellers list! Here’s a peek:

在本教程的最后,您将获得畅销书列表! 看一下:

等等,为什么呢? (Wait, but why?)

I first began working on this project a little over a year ago. I was learning about APIs and requesting keys to practice accessing and displaying data.

一年多以前,我第一次开始从事这个项目。 我正在学习API,并请求密钥来练习访问和显示数据。

While exploring the New York Times API, I found that it was possible to get a list of best selling books. For each book on the list, the API provides a current rank and number of weeks on the list. It also offers info like a synopsis and an Amazon link.

在探索《纽约时报》 API时,我发现可以获得一份最畅销书的清单。 对于列表中的每本书,API都会提供列表中的当前排名和星期数。 它还提供简介和亚马逊链接之类的信息。

I was able to populate textual info, but the list lacked the natural visual component of book covers. At the time, I didn’t see a clear road forward, so I put the project on the shelf.

我能够填充文本信息,但该列表缺少书套的自然视觉组件。 当时,我看不到前进的路,所以我将项目搁置了。

This is an instance where having acces

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值