Files
ROC/library/gcse/test/application.e
jvelilla 0e63c14613 Added Module Custom Search
Added Google custom search library
Added HTTP client extension libaray
Updated demo example to use the Module Custom Search
2015-10-13 10:23:30 -03:00

81 lines
1.9 KiB
Plaintext

note
description : "test application root class"
date : "$Date: 2015-10-08 07:51:29 -0300 (ju., 08 oct. 2015) $"
revision : "$Revision: 97966 $"
class
APPLICATION
inherit
ARGUMENTS
create
make
feature {NONE} -- Initialization
make
-- Run application.
local
gcse: GCSE_API
l_parameters: GCSE_QUERY_PARAMETERS
do
create l_parameters.make (key, cx, "scoop")
create gcse.make (l_parameters)
gcse.search
if attached {GCSE_RESPONSE} gcse.last_result as l_result then
if attached l_result.current_page as l_page then
print ("Current Page%N")
print (l_page.to_string)
end
if attached l_result.next_page as l_page then
print ("Next Page%N")
print (l_page.to_string)
end
if attached l_result.previous_page as l_page then
print ("Previous Page%N")
print (l_page.to_string)
end
if attached l_result.items as l_items then
print ("Number of items:" + l_items.count.out)
across l_items as ic loop print (ic.item.to_string) end
end
if attached l_result.next_page as l_page then
l_parameters.set_start (l_page.start_index.out)
gcse.search
end
end
if attached {GCSE_RESPONSE} gcse.last_result as l_result then
if attached l_result.current_page as l_page then
print ("Current Page%N")
print (l_page.to_string)
end
if attached l_result.next_page as l_page then
print ("Next Page%N")
print (l_page.to_string)
end
if attached l_result.previous_page as l_page then
print ("Previous Page%N")
print (l_page.to_string)
end
if attached l_result.items as l_items then
print ("Number of items:" + l_items.count.out)
across l_items as ic loop print (ic.item.to_string) end
end
end
end
feature {NONE} -- Implementation
Key: STRING = "AIzaSyBKAXNofo-RqZb6kUmpbiCwPEy7n7-E51k"
cx : STRING = "015017565055626880074:9gdgp1fvt-g"
end