Google Books API not returning the result as Google Book Search - google-books

I am wondering how to get the authors' name of the book by book title.
My idea is, to use Google Book APIs to search the book by title then parse the authors' name of the ruturn data.
However, the data returned from APIs somethings missing the target book.
For example, I am looking for the book A Summer in Europe by Marilyn Brant.
The request url is:https://www.googleapis.com/books/v1/volumes?q=a%20summer%20in%20europe , but the returned json seems not containing the book.
By searching on Google Books: I can find the target book correctly.
The correct rusult Image
My question is, why this missing happens and how to get the target book?

Related

Find Place requests Returns Only One Result

I'm using the Google Places API endpoint "findplacefromtext" and tried a search similar to the example.
https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=mongolian%20grill&inputtype=textquery&fields=photos,formatted_address,name,opening_hours,rating&locationbias=circle:2000#47.6918452,-122.2226413&key=YOUR_API_KEY
However, when you use this it only ever returns one result. There is a cafe near me that's called "Cream" but when you pass that as the "input" parameter it returns shops that have a category of "Ice Cream". I thought it should only search the name of the business.... If I can't find the place by name does it search the category type as a fall back? When I execute the same search in Google Maps it returns the same data but I get multiple results and I can see the place I am trying to retrieve 3rd on the search result list.
Is it possible to make it return more than one result? The documentation doesn't mention anything about this.
I believe what you need is the Text Search request. The Find Place request is meant for exact addresses.
The Google Places API Text Search Service is a web service that
returns information about a set of places based on a string — for
example "pizza in New York" or "shoe stores near Ottawa" or "123 Main
Street". The service responds with a list of places matching the text
string and any location bias that has been set.
The service is especially useful for making ambiguous address queries
in an automated system, and non-address components of the string may
match businesses as well as addresses. Examples of ambiguous address
queries are incomplete addresses, poorly formatted addresses, or a
request that includes non-address components such as business names.
Taken from https://developers.google.com/maps/documentation/places/web-service/search#TextSearchRequests

Google Classroom: Find userId from the google doc

How can I find the userId of the student to which a CourseWorkSubmission has been submitted?
Steps:
Student is assigned coursework using Google Classrooms.
Teacher views coursework (docs.google.com URL).
I click Add On, to try and pull out student info, but can't find the context for the student (e.g. userId, actorId) or even the submissionId in order to make a call to the API to get the information.
Any help or pointers gratefully received :)
References:
Have checked out the Google Classroom API:
https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/get
And the Google Drive API:
https://developers.google.com/drive/v3/web/about-sdk
When you do your get of the studentSubmission here https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/get the response will contain a userId. That userID is the Students google ID you're looking for.
Go ahead and run the Try this API functionality on the https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/get page and you should see what I"m talking about.
The full response information is listed here https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions
If you're having a problem finding the relevant courseWork ID, then use the list capability here https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/list (Put a - in for the courseWorkId)

Google Places API: More specific types?

When I Google "Justine's" I can see that it's listed as a "French Restaurant". (See screenshot)
When I use the Google Places API to get details about the same spot I only see a list of "types" that includes high-level terms like "restaurant" and "bar", but I see no specific types like "French Restaurant".
Does anyone know if it's possible to get this data?
Thanks!
I think you would probably have to check with the text search method on the api..
https://developers.google.com/places/documentation/search#TextSearchRequests
So your request would end up looking something like the below, restricted down to a specific area
https://maps.googleapis.com/maps/api/place/textsearch/json?query=French +Restaurant&sensor=true&location=yourLocationHere&radius=20&key=yourKeyHere
However this will return all other French restaurants in the area, so if you just want to return the one result I would use the Place Details request instead

Can I obtain the country name with Google Places API?

On the request for current place I receive a list of places. Every place has an address but that address is a string so I can't get only the country name.
Could someone help me on this matter?
Country is only explicitly available when using the Place Details API, not the Places API. (https://developers.google.com/maps/documentation/places/web-service/details)
You first need to look up a place_id for the specific place you're looking for. You then use your place_id to pull details from the Details API, which includes information like:
Fully formatted address, including country
Address components
Sample reviews
Phone # and website
Operating hours
If you have read the Google Places Autocomplete doc,you must know about API properties.you can use the type as '(region)' and will return you many results (plus country).And if you look inside address_components field (it's array with dynamic length),you will see,that the last item of array is what you need.Here is a great page to read a correct doc and try examples yourself.
http://www.w3docs.com/learn-javascript/places-autocomplete.html

Codeigniter Make Download URL inaccessible in address bar

I am creating an application where members as well non members can download books depending upon the category of book available for both users.
I linked the books to BASE_URL/downloadPDF/11 for prompt download, passing the Id of the book, so that the file location is invisible to user.
Now what I want is no one can get the book downloaded directly pasting the book url(BASE_URL/downloadPDF/11) in browser address bar.
I tried making function private but It did not work for me.
you can encode your book url. so no one can get the book downloaded directly.
Let’s say we want to encode the following string with base64:
after conversion your book url look like below string
RW5jb2RpbmcgYW5kIERlY29kaW5nIEVuY3J5cHRlZCBQSFAgQ29kZQ==
so its difficult for end user to interpret this url.
you can also decode url using base64_decode

Resources