#NEWLINE# def _crossref_doi_extract( self ) : #NEWLINE# #INDENT# def crRequest( doi ) : #NEWLINE# #INDENT# import urllib as U #NEWLINE# data = { #NEWLINE# #INDENT# 'q' : doi , #NEWLINE# #UNINDENT# } #NEWLINE# data_encoded = U . urlencode ( data ) #NEWLINE# return _json_request ( ( 'http://search.labs.crossref.org/dois?%s' % data_encoded ) ) #NEWLINE# #UNINDENT# doi = self . _fields [ 'doi' ] #NEWLINE# if ( doi [ : 4 ] == 'http' ) : #NEWLINE# #INDENT# doi = _doi_uri_to_doi ( doi ) #NEWLINE# #UNINDENT# r = crRequest ( doi ) #NEWLINE# if ( len ( r ) > 0 ) : #NEWLINE# #INDENT# extra_data = r [ 0 ] [ 'coins' ] . split ( '&amp;' ) #NEWLINE# fields = ( x . split ( '=' ) for x in extra_data ) #NEWLINE# fields = [ [ y . replace ( '+' , ' ' ) . strip ( ) for y in x ] for x in fields ] #NEWLINE# authors = [ x [ 1 ] for x in fields if ( x [ 0 ] == 'rft.au' ) ] #NEWLINE# for a in authors : #NEWLINE# #INDENT# self . author ( a ) #NEWLINE# #UNINDENT# if ( len ( r ) > 0 ) : #NEWLINE# #INDENT# r = r [ 0 ] #NEWLINE# if ( 'title' in r ) : #NEWLINE# #INDENT# self . title ( r [ 'title' ] ) #NEWLINE# #UNINDENT# if ( 'year' in r ) : #NEWLINE# #INDENT# self . year ( authors [ 'year' ] )