# -*- coding: utf-8 -*- # License: Public domain # www.coding.com.br import sys, simplejson, urllib url="http://query.yahooapis.com/v1/public/yql?q=use%20%22http%3A%2F%2Fgithub.com%2Fpvalente%2Fpdfyql%2Fraw%2Fmaster%2Fpdf.xml%22%20as%20pdf%3B%20select%20*%20from%20pdf%20where%20url%3D%22http%3A%2F%2Fwww.unifei.edu.br%2Ffiles%2Farquivos%2Fdiplomas%2Fdiplomas.pdf%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" result = simplejson.load(urllib.urlopen(url))['query']['results']['page'] for i in result: str = i['content'].encode('utf-8') if str.find(sys.argv[1]) != -1: print "Pode passar no DRA ;-)"