def fetch_old_ris(hostname, doi):
	""" Fetch the older style RIS record """
	index_url = "http://%s/perlserv/?request=cite-builder&doi=%s" % (hostname, urllib.quote(doi))
	index_page = urlopen(index_url).read()
	m = re.search(r'<a href="([^"]+)">Reference Manager Format</a>', index_page)

	if not m:
		bail("Failed to fetch RIS download in %s" % index_url)

	ris_url = "http://%s/perlserv/%s" % (hostname, decode_entities(m.group(1)))
	ris = unicode(urlopen(ris_url).read().strip(), "utf8")
	return ("ris", decode_entities(ris.replace("10.1371%2F", "10.1371/")))
Ejemplo n.º 2
0
def fetch_old_ris(hostname, doi):
    """ Fetch the older style RIS record """
    index_url = "http://%s/perlserv/?request=cite-builder&doi=%s" % (
        hostname, urllib.quote(doi))
    index_page = urlopen(index_url).read()
    m = re.search(r'<a href="([^"]+)">Reference Manager Format</a>',
                  index_page)

    if not m:
        bail("Failed to fetch RIS download in %s" % index_url)

    ris_url = "http://%s/perlserv/%s" % (hostname, decode_entities(m.group(1)))
    ris = unicode(urlopen(ris_url).read().strip(), "utf8")
    return ("ris", decode_entities(ris.replace("10.1371%2F", "10.1371/")))
Ejemplo n.º 3
0
def fetch_new_ris(hostname, doi):
	url = "http://%s/article/getRisCitation.action?articleURI=info:doi/%s" % (hostname, urllib.quote(doi))

	record = unicode(urlopen(url).read().strip(), "utf8")

	record = record.replace("10.1371%2F", "10.1371/")
	record = decode_entities(record)
	return ("ris", record)
Ejemplo n.º 4
0
def fetch_new_ris(hostname, doi):

    url = "http://%s/article/getRisCitation.action?articleURI=info:doi/%s" % (
        hostname, urllib.quote(doi))

    record = unicode(urlopen(url).read().strip(), "utf8")

    record = record.replace("10.1371%2F", "10.1371/")
    record = decode_entities(record)
    return ("ris", record)