How can I get Google search results from inside a program? I need to get an array of search results for a specified string.
C++ requires a little more work then other languages. You will need to connect to Google's REST Search API and then use a JSON parser to parse out the search results. Json.org has a collection of JSON parsers in various languages.
Use their javascript search API http://code.google.com/apis/ajaxsearch/
They no longer support their SOAP search api unfortunately
So... nine years later, you can no longer do that. You do get JSON, but it's quite short and just says "The Google Web Search API is no longer available. Please migrate to the Google Custom Search API (https://developers.google.com/custom-search/)"
Google Custom Search can search the entire web using the 'Thing' schema.org topic. https://support.google.com/customsearch/answer/4513886?visit_id=636769478248533420-865620074&rd=1
Google offers Ajax API for JavaScript programmers and a poor documentation for Python, PHP and Flash.By the way, If you are able to connect to remote http server with any other c++ library, you can do it. just change the url you are using and point it to: http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q={My_CPP_Query}
You will get JSON data stream, that you will be able to work with.
i remember i saw youtube tutorial on doing that, not sure about the library name but its something like _NT_SEARCH_GH:etcetcetcetcetcetc;
Related
I found online that I can use this URL to take a free translation from Google Translate
https://translate.googleapis.com/translate_a/single?client=gtx&sl={0}&tl={1}&dt=t&q={2}
Where {0} is the origin language, {1} is the target language and {2} is the text I want to be translated and I'm using this inside my C++ project.
With System::Net::WebClient DownloadString() method I download the file that that URL provides me.
I'd like to know if there's some kind of limitation in using this.
Can I use this URL in my code to take a translation from Google? Is there something wrong about this?
Thanks
It's an unsupported API endpoint used by the Google Translate extension for Chrome. It may disappear, stop working, or block your requests at any time and without notice.
The only supported API Google offers for their machine translation services is the Google Translate API.
As #一二三 say it`s not official supported public API same as get_video_id from YouTube.
So You have few ways for solving this problem:
Use this or other crutches like this one. And always check if it`s works today or not.
Using official PAID gTranslateAPI
Use some free API like: Yandex API Bing Translator
I am trying to create a RESTful service in Node.js using express like the Google places API which should be in the following format.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=%1,%2&radius=%3&name=%4&key=AIzaSyAh4t-qlMYrxnk0XF0Yiu9ZXVFDNfPTCFs
Its very unlike the standard way of passing params to an express app which expects in the following format /google/nearbysearch/place/:location=%1,%2/radius/:radius=%3 and etc..
The challenge here is how to use express and decrypt the response to easily parsing the params to a call. I did extensive research but could not find any links on google or stackOverflow. Thanks for the help.
I hear and have checked out restify (http://mcavage.me/node-restify/) where it allows to pass regex strings to the request url. How do they achieve such in Node.js (solutions without using express will also be helpful).
Thanks
Anurag
You can use Connect.js and Express.js middlware to parse the incoming query string and body conveniently. You can go to the official website http://expressjs.com or look at my examples http://expressjsguide.com and http://webapplog.com.
It's possible to parse without them, but you'll have to write more code (look at the core modules at http://nodejs.org/api).
I am a SOAP/WebServices newbie, and have been given a WSDL file that has a bunch of web services that I can connect to.
What is the easiest way to parse this and show me what services are offered, and what the input and output parameters are that are required? I really don't want anything more than this, but for whatever reason I can't seem to google an answer.
The closest I've gotten is using wsdl2java from Apache Axis, however it creates a whole bunch of Java objects. What I really want is very basic, which is give me a list of all of the services available, and the input/output parameters.
Does such a thing exist or do I need to build this myself?
Without installing anything I suppose this link would work but it requires that your WSDL be web accessible...
http://www.validwsdl.com/
Other online parsers may be better. Personally I'd recommend installing Eclipse with the web services plugin or the demo version of SOAPSonar, but if you only need to peek at what a WSDL offers without having to dig through the XML, then the above link might be an acceptable option.
this is only loosely programming related.
I wrote myself a shellscript, that extracts all acronyms from a text and writes them to a file. Now I would like to process that file to add the definitions.
My first google hit suggested using curl and the dict:// url scheme. However I am behind a proxy, which does not seem to allow that.
Does any of you know a service that is similar to the dict:// but is provided via HTTP?
Ideally it would be restful since messing around with SOAP seems somewhat bloated for this task.
There are plenty of Dictionary API services listed on http://www.programmableweb.com
I'd like to build an application using smartgwt and web2py.
I am new to both.
Ultimately what I would like to do is display objects obtained from a web2py backend in a smartgwt TileGrid.
Can anyone enumerate the broad strokes of what needs to be done? Or point me to any useful resources?
Any information that would apply more to django is also welcome.
download smartgwt (excellent framework by the way) and look into this example:
file://localhost/Users/massimodipierro/Desktop/smartgwt-1.0b1/samples/Showcase/www/com.smartgwt.sample.showcase.Showcase/index.html#tiling_load_on_deamnd
which displays images in a tilegrid. The images are received from Yahoo via an http request. The response is in JSON. Look into the source code. To see the json response from Yahoo try the following URL:
http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&output=json&query=snowboard
To make this work with web2py you need to replace that URL with the URL of a web2py action that returns a similar JSON response.
I do not know much about smartgwt but I am sure on the web2py google groups there are people willing to help.
Have a look at this tutorial on using web2py with Pajamas, which is another library built on GWT.