Jump to content

Upload a photo to google search by image


Guest
 Share

Recommended Posts

This has nothing to do with AutoIT.

The images in Google search are scraped by Google's own spiders and they determine what shows up when a user does a search. In other words, you don't upload a picture to Google search nor can force it to show. Its under their criteria.

To be given the *possibility* of Google including your picture into their search results, you must own a website and have pages with the images in it. However, that does not guarantee that your images will show up in Google search.

Edited by StringingLong
Link to comment
Share on other sites

Hi,

You mean dropping an image and then make a search for it?

Br, FireFox.

yes..

and then get the results page.

like what he did here:

but i need it for Google

Edited by Guest
Link to comment
Share on other sites

@gil900

OK, I have not the time right now, so I will keep you in touch.

Br, FireFox.

This is also a welcome response.

I tried without a break and at the end I realized that's the problem:

Variable must be of type "Object"

stop me..

I found this topic:

# entry804215

And then I realized something was wrong ..

I am also very grateful to this response .. At least I know now that someone will help me.

Link to comment
Share on other sites

This is what I have :

#include "WinHttp.au3"
;~ #include <INet.au3>

Global $hOpen = _WinHttpOpen()
Global $sAddress = "http://www.google.fr/searchbyimage/upload"

;~ ConsoleWrite(_INetGetSource("http://www.google.fr/imghp?sbi=1") & @CRLF)

Local $sLocalForm = _
        '<form method="POST" enctype="multipart/form-data" action="' & $sAddress & '">' & _
            '<input name="image_url">' & _
            '<input type="file" name="encoded_image">' & _
            '<input type="hidden" name="image_content">' & _
            '<input type="hidden" name="filename">' & _
            '<input type="hidden" name="num">' & _
            '<input type="hidden" name="hl">' & _
            '<input type="hidden" name="bih">' & _
            '<input type="hidden" name="biw">' & _
        '</form>'

Local $sRead = _WinHttpSimpleFormFill($sLocalForm, $hOpen, Default, _
        "encoded_image", @ScriptDir & "myimg.jpg", _
        "num", 10, _
        "h1", "fr", _
        "bih", 573, _
        "biw", 1193)
_WinHttpCloseHandle($hOpen)

ConsoleWrite($sRead & @CRLF)

But I'm not able to make it work... the page is totally made in javascript and I can't retreive the form data because I think that the datas "bih" and "biw" must be right to succeed.

Edit : typo.

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

This is what I have :

#include "WinHttp.au3"
;~ #include <INet.au3>

Global $hOpen = _WinHttpOpen()
Global $sAddress = "http://www.google.fr/searchbyimage/upload"

;~ ConsoleWrite(_INetGetSource("http://www.google.fr/imghp?sbi=1") & @CRLF)

Local $sLocalForm = _
'<form method="POST" enctype="multipart/form-data" action="' & $sAddress & '">' & _
'<input name="image_url">' & _
'<input type="file" name="encoded_image">' & _
'<input type="hidden" name="image_content">' & _
'<input type="hidden" name="filename">' & _
'<input type="hidden" name="num">' & _
'<input type="hidden" name="hl">' & _
'<input type="hidden" name="bih">' & _
'<input type="hidden" name="biw">' & _
'</form>'

Local $sRead = _WinHttpSimpleFormFill($sLocalForm, $hOpen, Default, _
"encoded_image", @ScriptDir & "myimg.jpg", _
"num", 10, _
"h1", "fr", _
"bih", 573, _
"biw", 1193)
_WinHttpCloseHandle($hOpen)

ConsoleWrite($sRead & @CRLF)

But I'm not able to make it work... the page is totally made in javascript and I can't retreive the form data because I think that the datas "bih" and "biw" must be right to succeed.

Edit : typo.

Br, FireFox.

This is what I have :

#include "WinHttp.au3"
;~ #include <INet.au3>

Global $hOpen = _WinHttpOpen()
Global $sAddress = "http://www.google.fr/searchbyimage/upload"

;~ ConsoleWrite(_INetGetSource("http://www.google.fr/imghp?sbi=1") & @CRLF)

Local $sLocalForm = _
'<form method="POST" enctype="multipart/form-data" action="' & $sAddress & '">' & _
'<input name="image_url">' & _
'<input type="file" name="encoded_image">' & _
'<input type="hidden" name="image_content">' & _
'<input type="hidden" name="filename">' & _
'<input type="hidden" name="num">' & _
'<input type="hidden" name="hl">' & _
'<input type="hidden" name="bih">' & _
'<input type="hidden" name="biw">' & _
'</form>'

Local $sRead = _WinHttpSimpleFormFill($sLocalForm, $hOpen, Default, _
"encoded_image", @ScriptDir & "myimg.jpg", _
"num", 10, _
"h1", "fr", _
"bih", 573, _
"biw", 1193)
_WinHttpCloseHandle($hOpen)

ConsoleWrite($sRead & @CRLF)

But I'm not able to make it work... the page is totally made in javascript and I can't retreive the form data because I think that the datas "bih" and "biw" must be right to succeed.

Edit : typo.

Br, FireFox.

Link www.google.com/searchbyimage/upload

also good ..

Have you heard about the plugin "http headers" to the browser - Firefox?

This plugin shows the command you send to the site.

For example, when I sent that message in this post i send some command.

So that base idea. If you can send a request this way so you do not depend on the javacript ..

If this is not what you did, then maybe to try it.

I'm just giving an idea.

Edited by Guest
Link to comment
Share on other sites

I reveal the Google sending command:

-----------------------------41184676334rn
Content-Disposition: form-data; name="image_url"rn
rn
rn
-----------------------------41184676334rn
Content-Disposition: form-data; name="encoded_image"; filename="1.png"rn
Content-Type: image/pngrn
rn
x89PNGrn
x1an
This command is to:

http://www.google.com/searchbyimage/upload

image:

Posted Image

i hope it is help...

Link to comment
Share on other sites

I also have a code of iMacros for Firefox.

This is the code:

TAB T=1
URL GOTO=http://www.google.com/imghp?hl=en&tab=wi
WAIT SECONDS=2
TAG POS=1 TYPE=SPAN ATTR=ID:qbi
TAG POS=1 TYPE=A ATTR=TXT:Upload<SP>an<SP>image
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:/searchbyimage ATTR=ID:qbfile CONTENT=D:1.jpg

Maybe possible to convert the code to AutoIt3 language.

Please help me ...

Edited by Guest
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...