Sub SearchEbay() This procedure searches eBay for the
items.Item.ListingDetails.ViewItemURL &
strOutput = strOutput & Listing Duration: & _ items.Item.ListingDuration & vbCrLfstrOutput = strOutput & Time Left: & items.Item.TimeLeft & _
NextResponse.Write(strOutput) End Sub6.Add the WritePageContentsToBrowserprocedure to the code section: Sub WritePageContentsToBrowser(ByVal strURL As String) retrieve the page at the specified URL into a response streamDim wrq As WebRequest = WebRequest.Create(strURL) Dim wrp As WebResponse = wrq.GetResponse() Dim sr As StreamReader = New StreamReader(wrp.GetResponseStream()) read the entire stream containing the specified page and display it in the browserResponse.Write(sr.ReadToEnd) write some blank lines to the browserResponse.Write(
) End SubNice work you are now finished writing the code for the dashboard application. Make sure to saveyour changes to the project and to compile and resolve any compiler errors. At the time of this book s writing, there is a problem with the Amazon.com WSDLfile that requiresmanual correction. If you receive an error message stating that CustomerReviews1 cannot be reflectedor a similar error regarding CustomerReviews1, then please consult Chapter 4 for a detailed descriptionof how to resolve the error. Touring the Completed ApplicationAs you tour the dashboard application, you can see for yourself that it really is a simple example thatcould be enhanced in many ways. I purposely kept the example simple to illustrate how much you cando with third-party APIs and just a little code. Go ahead and run the program by pressing F5. Youshould see an opening screen similar to the one shown in Figure 12-10. Enter some search criteria for some electronic equipment of interest and click the Search button. Thecode currently filters the Amazon.com results by the electronic category, but you can revise the categoryto books or something else by changing the property in the code section. Suppose that you specified criteria for ipod, to search for reviews and availability of Apple iPod devices. When you click the Search button, you should see a screen similar to the one shown in Figure 12-11.276Chapter
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Adult Web Hosting services