Ask a question about JSON
Posted: Wednesday 29th July 2020 12:00am
As shown in the figure, how can I get this mame value?
Hope to give someone a
Private Sub GetSearchResults()
Dim JSonData As New Collection
Dim TmpInt As Integer = 0
Dim TmpJson As Collection
Dim RowNo As Integer = 0
Dim TmpStr As String
Dim TmpAuthor As String[]
JSonData = JSON.Decode(WebView1.Text, True)
If IsNull(JSonData) Then
Message("Your search [" & AG.APISearchText & "] returned no data")
Else
For Each JSonData["items"]
Grd_Results.Rows.Count = RowNo + 1
TmpJson = JSonData["items"][RowNo]["volumeInfo"]
Grd_Results[RowNo, 0].Text = Str(RowNo + 1)
Grd_Results[RowNo, 1].Text = JSonData["items"][RowNo]["volumeInfo"]["title"]
TmpAuthor = JSonData["items"][RowNo]["volumeInfo"]["authors"]
For Each TmpStr In TmpAuthor
Grd_Results[RowNo, 2].Text = TmpStr & " "
Next
Grd_Results[RowNo, 3].Text = JSonData["items"][RowNo]["volumeInfo"]["publishedDate"]
Grd_Results[RowNo, 4].Text = JSonData["items"][RowNo]["volumeInfo"]["publisher"]
Inc RowNo
Next
Endif
End
Note# Quincunxian wrote: ↑Wednesday 29th July 2020 1:34am Here is an partial example of the search results for a book called Gullivers Travels
{
"kind": "books#volumes",
"totalItems": 41,
"items": [
{
"kind": "books#volume",
"id": "9XBtCwAAQBAJ",
"etag": "EHIKp6yCh4E",
"selfLink": "https://www.googleapis.com/books/v1/vol ... AAAAAAAAAA",
"volumeInfo": {
"title": "Gullivers Travels",
"subtitle": "Class Ix",
"authors": [
"Jonathan Swift"
],
"publisher": "Prabhat Prakashan",
"publishedDate": "1938-01-01",
"description": "Jonathan Swift’s satirical novel was first published in 1726, yet it is still valid today. Gulliver’s Travels describes the four fantastic voyages of Lemuel Gulliver, a kindly ship’s surgeon. Swift portrays him as an observer, a reporter, and a victim of circumstance. His travels take him to Lilliput where he is a giant observing tiny people. In Brobdingnag, the tables are reversed and he is the tiny person in a land of giants where he is exhibited as a curiosity at markets and fairs. The flying island of Laputa is the scene of his next voyage. The people plan and plot as their country lies in ruins. It is a world of illusion and distorted values. The fourth and final voyage takes him to the home of the Houyhnhnms, gentle horses who rule the land.",
"industryIdentifiers": [
{
"type": "ISBN_13",
"identifier": "9789351864127"
},
{
"type": "ISBN_10",
"identifier": "935186412X"
}
],
"readingModes": {
"text": true,
"image": true
},
"pageCount": 312,
"printType": "BOOK",
"categories": [
"Comics & Graphic Novels"
],
"maturityRating": "NOT_MATURE",
"allowAnonLogging": false,
"contentVersion": "0.2.2.0.preview.3",
"panelizationSummary": {
"containsEpubBubbles": false,
"containsImageBubbles": false
},
"imageLinks": {
"smallThumbnail": "http://books.google.com/books/content?i ... ce=gbs_api",
"thumbnail": "http://books.google.com/books/content?i ... ce=gbs_api"
},
"language": "en",
"previewLink": "http://books.google.com.au/books?id=9XB ... ce=gbs_api",
"infoLink": "https://play.google.com/store/books/det ... ce=gbs_api",
"canonicalVolumeLink": "https://play.google.com/store/books/det ... BtCwAAQBAJ"
},
.....