def bidref(self,bid): '''Get reference information from bing ID''' requestsSession = requests.Session() requestsSession.mount('http://', requests.adapters.HTTPAdapter(max_retries=5)) try: params={"type":"endnote"} r=requestsSession.get("http://mylib.chinacloudsites.cn/Paper/Citation/"+str(bid),params=params,headers=self.hdr,timeout=20) print "get ref time:",r.elapsed sys.stdout.flush() if (r.status_code is 200): j=Jrecord() return j.parseenw(r.text) return Jrecord() except requests.exceptions.ConnectionError: print "ConnectionError: Fail to find ref info for bid: "+bid return Jrecord()
def reset(self): Jrecord.reset(self) del self.journals[:] del self.issns[:]
def __init__(self): Jrecord.__init__(self) # new for crossref multi-value self.journals = [] self.issns = []
def __init__(self): Jrecord.__init__(self) #new for crossref multi-value self.journals = [] self.issns = []