pubs/papers/commands/websearch_cmd.py
Fabien Benureau acab1b8044 major restructuring of code. many oliver remarks implemented. no new features.
divided code into multiple files
paperpile style argparse
setup.py with script option
2012-10-07 19:27:20 +02:00

11 lines
426 B
Python

import webbrowser
import urllib
def parser(subparsers, config):
parser = subparsers.add_parser('websearch', help="launch a search on Google Scholar")
parser.add_argument("search_string", help="the search query (anything googly is possible)")
return parser
def command(config, search_string):
url = 'https://scholar.google.fr/scholar?q={}&lr='.format(urllib.quote_plus(search_string))
webbrowser.open(url)