This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Google search

Help for those learning Tcl or writing their own scripts.
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

afaik i got all packages loaded as well its the API and id im missing
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

manages to create the API key cant seem to create an ID
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Instructions: for Engine ID

1: https://cse.google.com/cse/create/new

2: enter in "Sites to search" *.google.com

3: enter in Name of search engine Google

4: Click "Public URL"

5: Copy the ID from this url

Example

Code: Select all

https://cse.google.com/cse?cx=8bff70e62d3a0f8d7
from cx= is your Engine ID :wink

6: Go to https://cse.google.com/cse/setup/basic?cx=Your-id-here

and make sure "Search the entire web" is turned On

Instruction: for Google Custom Search API Key

1: https://developers.google.com/custom-search/v1/overview (Make Sure you are signed into your Google Account)

2: Click "Get a Key"

3: Copy your API Key
Last edited by ComputerTech on Sat Mar 27, 2021 6:16 pm, edited 1 time in total.
ComputerTech
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

hm i followed all that and yet i keep gettin message about the API key not being proper
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Above instructions are for the Engine ID, i thought you said you got the API? or which do you need currently?
ComputerTech
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

Tcl error [goo:gle]: key "searchInformation" not known in dictionary

i created the API ealier tho and added it
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

did you rehash after placing both Engine ID and API Key? and when creating the Engine ID did you receive the message "Engine Created Successfully" ?


EDIT

what term are you searching btw? from my past tests, searches with the keys [ ] { } ane etc don't yet work
Last edited by ComputerTech on Sat Mar 27, 2021 6:22 pm, edited 2 times in total.
ComputerTech
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

it looks like i didnt create the API key properly
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

You can try test your API and Engine ID wih the following URL

Code: Select all

"https://www.googleapis.com/customsearch/v1?key=YOUR-API-KEY-HERE&cx=YOUR-ENGINE-ID-HERE&q=SEARCH-TERM"

If it results to a page with a error, paste here that whole error and surroundings
ComputerTech
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

it seems to work proper now thanks
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

No Problem simo, glad you got it working
:
ComputerTech
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

tested it some more and it doesnt seem to work with UTF8
18:08:16 <Simo> .tcl encoding system
18:08:16 <Falcon> Tcl: utf-8
utf encoding is present
G
Goga
Halfop
Posts: 84
Joined: Sat Sep 19, 2020 2:12 am

Post by Goga »

Still having Same problem though updated with your given Code.

Code: Select all

[07:33:14] 02G04o08o02g03l04e.tcl v0.3 by ComputerTech Loaded
[07:33:31] Tcl error [goo:gle]: key "searchInformation" not known in dictionary
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Goga, have you grabbed the API key and Engine ID i described above? This is a Requirement, as the error you just gave, shows thst you haven't


http://forum.egghelp.org/viewtopic.php?p=109672#109672 << instructions

Or if you have successfully retrieved a API Key and a Engine ID, try putting this in your browser.

Code: Select all


https://www.googleapis.com/customsearch/v1?key=YOUR-API-KEY-HERE&cx=YOUR-ENGINE-ID-HERE&q=SEARCH-TERM
replace accordingly
ComputerTech
G
Goga
Halfop
Posts: 84
Joined: Sat Sep 19, 2020 2:12 am

Post by Goga »

You were right, I didn't enable the API Key, Now its working sufficiently,
Post Reply