Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Custom Search refinement redirect

So I'm using Google Custom Search (Google CSE) and I'm trying to use the refinement functionality to redirect search queries to Google Scholar.

Basically I'm following exactly the documentation found here. However it turns out that, despite there being documentation, this functionality doesn't exist, and it doesn't appear that Google has any plans to implement it in the near future (see the StackOverflow post here).

My question is, does anyone have a hack/workaround for this problem, so that I could use Google CSE to search Google Scholar?

like image 266
Thoth Avatar asked Feb 06 '17 01:02

Thoth


People also ask

What does refining a search mean?

Refining a query means changing or adding to the set of search terms to do a better job of returning the pages you're seeking. Successful researchers frequently enter several queries to find what they're seeking.


Video Answer


1 Answers

Server Side

You can use something like https://github.com/ckreibich/scholar.py to parse the results from google scholar yourself and expose it as an API that you could consume and render any way you liked.

It would use scholar search under the hood. However, since this isn't an official API this might break at any time, it also requires you to have server side resources to service the requests, but would let you have the nicest interface that you have full control over.

IFrame

You can open an iframe at the particular URL, and this can be embedded inside your page. It looks a bit clunkier, but it means you don't have to link externally and you can embed it locally

<iframe src='http://scholar.google.com/scholar?q={query}'></iframe>

See documentation here. It might be specifically what renders well for you.

External Link

Alternatively, you can just open a new tab/window with:

<a href='http://scholar.google.com/scholar?q={query}' target='_blank'> My Link </a>
like image 125
Luke Exton Avatar answered Oct 27 '22 19:10

Luke Exton