Web Page Design and Hosting

December 31, 2006

Cache RequestsAnother method supported by the Google API

Filed under: professional development with web apis — webmaster @ 3:09 pm

Cache RequestsAnother method supported by the Google API is the doGetCachedPagemethod. This method allowsyou to retrieve the cached version of a URLfrom the Google cache. The doGetCachedPagemethodreturns a byte array and has the following syntax: bytPage() = Search.doGetCachedPage(Key, URL) .Keyis the developer key you were provided by Google. .URLis the URLof the site you wish to retrieve from the Google cache. Spelling RequestsAthird method supported by the Google API is the doSpellingSuggestionmethod. This methodallows you to retrieve a spelling suggestion/correction for a particular search phrase. ThedoSpellingSuggestionmethod returns a string and has the following syntax: strSuggestedSpelling = Search.doSpellingSuggestion(Key, Phrase) .Keyis the developer key you were provided by Google. .Phraseis the text phrase for which you would like to receive a spelling suggestion. The details of how to call each of these three methods are explained later in this chapter. Now that the basic idea of the types of queries that can be executed using the Google API, let s look at anexample of how to execute a search request. Executing a QueryIn this section, I walk you through examples that illustrate how to execute a Google API query usingVisual Studio .NET as well as directly from the .NET Framework. Executing a Query Using Visual Studio .NET1.Open Visual Studio .NET and select File.New.Project. 2.Select Visual Basic Project as the Project Type, and select Console Application as the Template. For the project name, specify GoogleSearchConsoleor another suitable name. For the pathspecify the location where you want the project to be created. Click OK to create the new project. 3.Add a reference to the Google API by selecting Project.Add Web Reference. For the URLfield, specify http://api.google.com/GoogleSearch.wsdl. You may recall from Chapter the WSDLfile of a Web service explains the features that are available in the service. Clickthe GO button so that Visual Studio can locate the Google service. Ascreen similar to thatshown in Figure 2-7 is displayed.

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Adult Web Hosting services

1 Comment

  1. Website Design…

    Affiliate Summit is in need of a fantastic new website design to replace the existing one located at AffiliateSummit. com. With that in mind, we are calling on all graphic and web designers to submit their best website design creations to the 2008 So Y…

    Trackback by Website Design — June 6, 2010 @ 1:46 am

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Java Web Hosting