Class VidList Public Property Items() As List(Of VidItem)End ClassClass VidItem Public Property Id() As String Public Property Snippet() As VidSnippetEnd ClassClass VidSnippet Public Property Title() As String Public Property Description() As String Public Property tags() As StringEnd ClassFor Each [item] In playList.Items Response.Write(item.Snippet.tags)next
Module Module1 Const json = "{" _& """items"": [" _& "{""id"" : ""tyGHrfDGTR"", " _& """snippet"": {""title"": ""This is the title"", " _& """tags"": [""one"", ""two"", ""three"", ""four"", ""five""]}}]}" Sub Main() Dim videoList = Newtonsoft.Json.JsonConvert.DeserializeObject(Of VideoList)(json) Console.WriteLine("Items: ") For Each videoItem In videoList.Items Console.WriteLine(vbTab & "ID: " & videoItem.ID) Console.WriteLine(vbTab & "Snippet:") Console.WriteLine(vbTab & vbTab & "Title: " & videoItem.Snippet.Title) Console.WriteLine(vbTab & vbTab & "Description: " & videoItem.Snippet.Description) Console.WriteLine(vbTab & vbTab & "Tags:") For Each tag In videoItem.Snippet.Tags Console.WriteLine(vbTab & vbTab & vbTab & tag) Next Next Console.ReadLine() End SubEnd ModuleClass VideoList Public Property Items() As List(Of VideoItem)End ClassClass VideoItem Public Property ID() As String Public Property Snippet() As VideoSnippetEnd ClassClass VideoSnippet Public Property Title() As String Public Property Description() As String Public Property Tags() As List(Of String)End Class
Hey, -saige-
Hum, that is going to be difficult to add to a database.
Unless I insert everything into the table and then come back and make another request and then update the database, add in these tags.
Unless you can think of a better way.
Also.
I found out that we are limited to 1 million requests per day.
Would this "Loop" count for 1 request, or 5 requests in this example?
Just an off hand question. In general, most db inserts insert separate records into separate rows rather than trying to insert everything at once. You can always use transactions if you want to ensure that the entire record set gets added but trying to jam everything here into a single row (your original playlist included) just muddy's up the water.
-saige-
Wayne Barron
ASKER
OK.
I have 3 tables.
Users
List
Videos
The Tags
They are inserted into the Videos [Tags] Column.
Wayne Barron
ASKER
Thanks again, -saige-
I am slowly but surely learning how to use this the way I need it.
Open in new window
Proof of concept -Open in new window
Produces the following output --saige-