Searching book using Google Data API
I'm developing an application in which user can search for a specific book and read it and purchase it. I want to use GData book search API for that. Can 开发者_JS百科anyone tell me in which format I will get response as well as how to send request for book search? I have seen GData documentation, but not getting much ideas. Please help me.
You are going to have to send an HTTP GET
request as seen here. That will return some xml that you will have to parse. Each book is an <entry>
with lots of items and <link>
s to things such as a thumbnail of the book's cover, like this:
All the information that you really care about though, will be sent after that, and will be in an item that has a dc
prefix on it, such as <dc:title>Pride and Prejudice</dc:title>
You really should just be reading the documentation though, because it will be more thorough than anyone on here will care to be.
You have to use feed parser for this . Hit this URL in your IE and see the response. It will return feed. You just need feed parser to parse this and show in your application.
Google Books Feeds
If you are using Java than you should use official Google APIs Client Library for Java.
Here are detailed docs hot to use it with Google Books.
NOTE 1: Google Books API provides book search, but does not provide access to content. For this you must use Embedded Viewer API. This is a Javascript only API so it must be used inside a browser. If you plan to use it with Android you will most probably need to use the embedded WebView which can show HTML and Javascript.
NOTE 2: Commercial books can be searched with Google Books, but they must be purchased before they are available in users library. AFAIK there is no API to purchase books.
精彩评论