Source language: Translate to:

Image Internet

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Image Internet

Postby Alex » Sat Feb 17, 2007 11:31 am

Hi,

When I go of Google Image and write my Word, for example KITT, the link is : http://images.google.com/images?hl=fr&q=[WORD]&btnG=Recherche+Google&ie=UTF-8&oe=UTF-8&sa=N&tab=wi

How can I do When I write KITT [Word] I can see one picture of them in Picture in Neobook ?

And when there is space in my word, it have to insere a "+" (Knight+Rider)


Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Sam Cox » Sat Feb 17, 2007 11:52 am

Hello Alex,

The following site explains the Google search string in some detail:

http://code.google.com/enterprise/docum ... rence.html

The plus sign means "and" so if you have the search string "alex+sam", the search engine will look for topics matching both "alex" and "sam".

If you want to find a file/image with a space in the name, you have to do a little more work. By experimentation, I Google'd these strings and found that google used these search strings:
Code: Select all
"google search"    ->   %22google+search%22
"google  search"   ->   %22google++search%22

It appears that Google's idea of a quote character is "%22" and when more than one space character is quoted, a plus sign is used for each space.

Hope this helps,
-- Sam
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA

Postby Alex » Sat Feb 17, 2007 1:01 pm

Thanks Sam,

So what have I to do with Neobook Action, for the "+" it's a String Action :
StrReplace "[Word]" " " "+" "[Result]"

But what must I do ?

When I write KITT, it load the first *.jpg picture in Picture Box.

According to me, maybe I need the Source Code page.



Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Sam Cox » Sat Feb 17, 2007 1:15 pm

I'm not much of an expert with Neobook's Web Browser objects or, for that matter, with Google, but I experimented a little and found that given your original search string, it's pretty easy to tell Google to find what you want.

1) create a web browser object
2) set the internet address to http://images.google.com/images?hl=fr&q=[WORD]&btnG=Recherche+Google&ie=UTF-8&oe=UTF-8&sa=N&tab=wi

Note: I copied this address from your first post.

3) create a push button object with this code:
Code: Select all
SetVar "[Word]" "KITT"

4) create a push button object with this code:
Code: Select all
SetVar "[Word]" "George Washington"

5) press F9 to run the pub
6) you should see the Google search page for images
7) click the "KITT" pushbutton
8) you should immediately see several "KITT" pictures
9) click the "George" button
10) you should immediately see several pictures of George Washington

Notice that I did not replace any spaces with "+" or add any "%22" quote characters when changing the value of the [Word] variable.

I am impressed (with Google) how easy it was.

-- Sam
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA

Postby Alex » Sat Feb 17, 2007 1:47 pm

Thanks,

But I see a lot of picture of KITT, but if I want to load just one of picture in a Neobook Picture Box in JPG only, how can I do ?


Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Alex » Sat Feb 17, 2007 1:48 pm

SetVar "[Word]" "George Washington"
StrReplace "[Word]" " " "+" "[Word]"
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest