File: GoogleSearchServiceClient.rb

package info (click to toggle)
soap4r 1.4.8-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,472 kB
  • ctags: 2,206
  • sloc: ruby: 19,295; makefile: 58; sh: 41; perl: 10
file content (68 lines) | stat: -rwxr-xr-x 1,983 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env ruby
require 'GoogleSearchDriver.rb'

endpointUrl = ARGV.shift || GoogleSearchPort::DefaultEndpointUrl
proxyUrl = ENV[ 'http_proxy' ] || ENV[ 'HTTP_PROXY' ]
obj = GoogleSearchPort.new( endpointUrl, proxyUrl )

# Uncomment the below line to see SOAP wiredumps.
# obj.setWireDumpDev( STDERR )


# SYNOPSIS
#   doGetCachedPage( key, url )
#
# ARGS
#   key		String - {http://www.w3.org/2001/XMLSchema}string
#   url		String - {http://www.w3.org/2001/XMLSchema}string
#
# RETURNS
#   return		String - {http://www.w3.org/2001/XMLSchema}base64Binary
#
# RAISES
#    N/A
#
key = url = nil
puts obj.doGetCachedPage( key, url )

# SYNOPSIS
#   doSpellingSuggestion( key, phrase )
#
# ARGS
#   key		String - {http://www.w3.org/2001/XMLSchema}string
#   phrase		String - {http://www.w3.org/2001/XMLSchema}string
#
# RETURNS
#   return		String - {http://www.w3.org/2001/XMLSchema}string
#
# RAISES
#    N/A
#
key = phrase = nil
puts obj.doSpellingSuggestion( key, phrase )

# SYNOPSIS
#   doGoogleSearch( key, q, start, maxResults, filter, restrict, safeSearch, lr, ie, oe )
#
# ARGS
#   key		String - {http://www.w3.org/2001/XMLSchema}string
#   q		String - {http://www.w3.org/2001/XMLSchema}string
#   start		Integer - {http://www.w3.org/2001/XMLSchema}int
#   maxResults		Integer - {http://www.w3.org/2001/XMLSchema}int
#   filter		TrueClass - {http://www.w3.org/2001/XMLSchema}boolean
#   restrict		String - {http://www.w3.org/2001/XMLSchema}string
#   safeSearch		TrueClass - {http://www.w3.org/2001/XMLSchema}boolean
#   lr		String - {http://www.w3.org/2001/XMLSchema}string
#   ie		String - {http://www.w3.org/2001/XMLSchema}string
#   oe		String - {http://www.w3.org/2001/XMLSchema}string
#
# RETURNS
#   return		GoogleSearchResult - {urn:GoogleSearch}GoogleSearchResult
#
# RAISES
#    N/A
#
key = q = start = maxResults = filter = restrict = safeSearch = lr = ie = oe = nil
puts obj.doGoogleSearch( key, q, start, maxResults, filter, restrict, safeSearch, lr, ie, oe )