Greasy Fork is available in English.

Discussies » Ontwikkeling

bypass SOP - Wolfram|Alpha results in Google

§
Geplaatst: 04-08-2016

bypass SOP - Wolfram|Alpha results in Google

Hi I'm trying to get some of Wolfram|Alpha's results to the Google page. But using ajax doesn't work due to the same origin policy. Any idea how to get the results into google?
I have created an appid to query the w|a API. Example queries are working by opening this address http://api.wolframalpha.com/v2/query?input=pi&appid=XXXX (with valid appid)

Any help appreciated. Thanks!

§
Geplaatst: 04-08-2016

Ok I have an idea but cannot Test it at the moment... The problem is that the requested resource is located an other domain than google.com.
Would it be possible to request the cached eqivaltet of the page via Google's Cache System? So I would send an Ajax request to www.google.com/search?q=cache:api.wolframalpha.com/v2/query?input=pi&appid=XXXX
Do you think this will work? This URL is redirecting to http://webcache.googleusercontent.com/search?q=cache:api.wolframalpha.com .
Thanks for any Input. I will report when I tested it...

woxxomMod
§
Geplaatst: 04-08-2016
§
Geplaatst: 04-08-2016

Thanks allot.

woxxomMod
§
Geplaatst: 04-08-2016

The doc page doesn't mention it, but you should also list it in the metablock as // @grant GM_xmlhttpRequest because modern Greasemonkey/Tampermonkey will block it otherwise.

Reactie plaatsen

Log in om antwoord te geven.