議論 » 開発

bypass SOP - Wolfram|Alpha results in Google

§
投稿日: 2016/08/04

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!

§
投稿日: 2016/08/04

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
§
投稿日: 2016/08/04
§
投稿日: 2016/08/04

Thanks allot.

woxxomMod
§
投稿日: 2016/08/04

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.

返信を投稿

返信を投稿するにはログインしてください

长期地址
遇到问题?请前往 GitHub 提 Issues。