rupl / chrisruppel.com

My personal website
https://chrisruppel.com
Other
4 stars 1 forks source link

Provide search via external service #10

Open rupl opened 8 years ago

rupl commented 8 years ago

I saw on tantek.com that a few hidden inputs is all that is needed to do nice, focused Google searches on a website. The results are even rich snippets! Here's a sample URL that it would redirect a visitor to, provided they entered laos as the search term:

https://www.google.com/search?as_sitesearch=chrisruppel.com&tbs=sbd%3A1%2Ccdr%3A1%2Ccd_min%3A1%2F1%2F1970&q=laos&gws_rd=ssl)

The search box could be progressively enhanced with my travel.json file, providing auto-complete results below the box and letting them skip the Google page entirely if something compelling appears.

rupl commented 8 years ago

Here's the sample markup from tantek.com:

<form class="search" action="https://www.google.com/search" method="get">
  <input type="hidden" name="as_sitesearch" value="chrisruppel.com">
  <input type="hidden" name="tbs" value="sbd:1,cdr:1,cd_min:1/1/1970">
  <input type="search" name="q">
  <button type="submit">Search</button>
</form>
rupl commented 6 years ago

Upon revisiting I'd much prefer to do this with DuckDuckGo, which provides most of the same features and doesn't track users by default.

Sample URL: https://duckduckgo.com/html/?type=list&q=site%3Achrisruppel.com+laos