• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: using applications over the web
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using applications over the web


  • Subject: Re: using applications over the web
  • From: Gary Lists <email@hidden>
  • Date: Fri, 17 Jan 2003 18:19:57 -0500

On or about 1/17/03 11:58 AM, LE STANG Jean-Baptiste wrote:

> on google_Search(in_maxResults, in_start, in_filter, in_q,
> in_restrict, in_safeSearch)
>
> set in_lr to "" -- language restrict
> set in_ie to "latin1" -- input encoding
> set in_oe to "latin1" -- output encoding
> set in_key to googleKey -- my google key (defined as a script
> property)
>
> tell application "http://api.google.com/search/beta2";
> set mn to "doGoogleSearch"
> set sa to "urn:GoogleSearchAction"
> set mns to "urn:GoogleSearch"
> set params to {}
> set params to {oe:in_oe} & params
> set params to {ie:in_ie} & params
> set params to {lr:in_lr} & params
> set params to {|safeSearch|:in_safeSearch} & params
> set params to {restrict:in_restrict} & params
> set params to {filter:in_filter} & params
> set params to {|maxResults|:in_maxResults} & params
> set params to {start:in_start} & params
> set params to {q:in_q} & params
> set params to {|key|:in_key} & params
> return <<event rpc SOAP>> {<<class meth>>:mn, <<class parm>>:params,
> <<class sact>>:sa, <<class mspu>>:mns}
> end tell
> end google_Search

That is an XML-RPC SOAP call to the Google API. Access to Google via this
API is sign-up only (free) and the GoogleKey is assigned by Google to
monitor requests (the beta program limits your daily request/return to some
number...I think fairly substantial...maybe 1000.

You can find more about the Google API at Google.

Also, I think you'll need the XML Tools 2.x for that to work. This is a
scripting addition. (You might also want XML-Library which is a script
library, best stored in the Scripts>Libraries folder, which eases calls to
the XML Tools. [All of that for OS9...I think OSX has some of that built
in. I use OS9, so I don't know...]

I believe that the url referencing used by XML Tools and the XML-Lib is
reliant on URL Access Scripting component being installed also (again, this
is true for me on OS9.)

You shouldn't use the GoogleKey that you have in this script, unless it's
yours.

Also, if you're just wanting to return Google results in normal HTML, then
you don't need all this. This is, again, just for XML-RPC/SOAP requests.

See LateNight Software if you want the XML Tools and the XML-Library.
--
Gary

Incoming replies are auto-deleted.
Please post directly to the list or newsgroup.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: using applications over the web (From: LE STANG Jean-Baptiste <email@hidden>)

  • Prev by Date: Re: Routines for review: Hex <-> String
  • Next by Date: Re: Shell scripts
  • Previous by thread: Re: using applications over the web
  • Next by thread: Re: using applications over the web
  • Index(es):
    • Date
    • Thread