开发者

google image search shell api

I'm looking for something like API for google-image search using in bash shell.

I want to gel list of links and resolution-info for some query string.

The ideal w开发者_C百科ill be curling or wgeting any page and than parsing results.

But I cannot find any parseble page variant.

I'm trying $> curl "http://images.google.com/images?q=apple" and get nothing.

Any ideas?


There are APIs for Google's searches; http://code.google.com/apis/imagesearch although I don't know how you would meed the referrer/branding licensing requirements.


It seems that Google Images does not like curl (403 error code). To avoid the 403 error, you need to fake the user agent, like this:

wget -qO- "http://images.google.com/images?q=apple" -U "Firefox on Ubuntu Gutsy: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/20080418 Ubuntu/7.10 (gutsy) Firefox/2.0.0.14"

Still, I guess this is not enough since you get a load of javascript code, that needs to be executed somehow.

My 2 cents.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜