def search_author(name,finitial,lname,search_initial=True): """ Return all the publications for a specific author name. """ # # format the query for the URL # name = name.replace(' ','+author%3A') # print name # # run the query # ##cn-need to fix so it still works for the below... search_initial... determine by? from authorstats.py line 7 --use_initials. # url = AUTHOR_SEARCH_TEMPLATE % name #urllib2.quote(name) # print url # if search_initial is True: # #url = AUTHOR_SEARCH_TEMPLATE % ('%s %s' % (finitial,lname)).replace(' ','+') #name #urllib2.quote(name) # #below also from cn 7/4 # url = AUTHOR_SEARCH_TEMPLATE % ('%s %s' % (finitial,lname)).replace(' ','+author%3A') #name #urllib2.quote(name) # #updated below: cn 7/4 # #url = AUTHOR_SEARCH_TEMPLATE % (finitial,lname) search_name=name if search_initial is True: search_name= '%s %s' % (finitial,lname) #AUTHOR_SEARCH_TEMPLATE % url #content = query_google(url) #cn using other scholar search module 825 import scholar817 content, gspro_nfound, gspro_names, gspro_links, n_results = scholar817.import_pubs(search_name) return gather_publications(content,finitial.lower(),lname.lower()), gspro_nfound, gspro_names, gspro_links
def search_all(name,finitial,lname): """ Return all the publications for a specific author name. """ # # format the query for the URL # name = name.replace(' ','+') # # run the query # url = ALL_SEARCH_TEMPLATE % name # #print url # #AUTHOR_SEARCH_TEMPLATE % url # content = query_google(url) # #cn using other scholar search module 825 import scholar817 content, gspro_nfound, gspro_names, gspro_links, n_results = scholar817.import_pubs(name) return gather_publications(content,finitial.lower(),lname.lower()), gspro_nfound, gspro_names, gspro_links
def kwsearch(name,finitial,lname,keywords): print "cn_gscholar.kwsearch" content, gspro_nfound, gspro_names, gspro_links, n_results = scholar817.import_pubs(name, keywords) return gather_publications(content,finitial.lower(),lname.lower()), gspro_nfound, gspro_names, gspro_links, n_results