If it won't be simple, it simply won't be. [source code] by Miki Tebeka, CEO, 353Solutions

Wednesday, October 31, 2007

Quick Web Searches

A little script to search the documents in Journal of Machine Learning.

import webbrowser
from urllib import urlencode

def jmlr(words):
query = "site:http://jmlr.csail.mit.edu filetype:pdf " + " ".join(words)
url = "http://www.google.com/search?" + urlencode([("q", query)])

webbrowser.open(url)

if __name__ == "__main__":
from optparse import OptionParser

parser = OptionParser("usage: %prog WORD1 [WORD2 ...]")

opts, args = parser.parse_args()
if not args:
parser.error("wrong number of arguments") # Will exit

jmlr(args)

I have many more is these for Google search, Wikipedia search, Acronym Search ...
The trick is to do a search using the web interface and then look at the URL of the results page.
Post a Comment

Blog Archive