Git Product home page Git Product logo

shortestsearch's Introduction

To run shortest_search.py you need an API key for Google's Custom Search JSON/Atom API which you can get here. If you don't want to do that you can just play around in the sandbox version. It doesn't search, but does generate search suggestions.

ShortestSearch

Program to find the shortest phrase to Google to ensure a given URL is the first result*

Motivation

Standard URLs are hard to remember and take too long to type; URL-shorteners give links that are quicker to type but even harder to remember; and when instructing someone to Google something we often give them too much information.

This aims to perfect the art of "It should be the first result if you Google 'x y z' ".

Examples

Input: "https://www.ted.com/talks/david_eagleman_can_we_create_new_senses_for_humans"

Output: "TED VEST"

Input: "http://www.paulgraham.com/writing44.html"

Output: "WRITING BRIEFLY"


Note: Google's search results are location and user dependent, therefore:

  • For a given URL, the shortest phrase will not necessarily be the same for everyone.
  • A given phrase may not return the intended URL as the first search result for everyone.

*Some URLs may have no such phrase

shortestsearch's People

Contributors

oisinmoran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.