Beispiel #1
0
def fetch_bibtex(id):
    url = url_format % id

    f = urllib.urlopen(url)
    html = f.read()
    f.close()

    # instantiate the parser and fed it some HTML
    try:
        parser = MyHTMLParser()
        parser.feed(html)
    except:
        return None

    data = {
        'arxiv':   id,
        'title':   parser.title,
        'authors': parser.author,
        'year':    parser.year,
        'eprint':  id,
        'url':     url_format % id,
        }

    bibentry = data2bib(data, 'arxiv:%s' % id)
    return bibentry.as_string()
Beispiel #2
0
def fetch_bibtex(id):
    xml = dccRetrieveXML(id)

    try:
        title, authors, year, abstract = dccXMLExtract(xml)
    except:
        print >>sys.stderr, xml
        raise

    data = {
        'institution': 'LIGO Laboratory',
        'number': id,
        'dcc': id,
        'url': url_format % id
        }

    if title:
        data['title'] = title
    if authors:
        data['authors'] = authors
    if abstract:
        data['abstract'] = abstract
    if year:
        data['year'] = year

    key = 'dcc:%s' % id

    btype = '@techreport'
    bibentry = data2bib(data, key, type=btype)

    return bibentry.as_string()
Beispiel #3
0
def fetch_bibtex(id):
    xml = dccRetrieveXML(id)

    try:
        title, authors, year, abstract = dccXMLExtract(xml)
    except:
        print >> sys.stderr, xml
        raise

    data = {
        'institution': 'LIGO Laboratory',
        'number': id,
        'dcc': id,
        'url': url_format % id
    }

    if title:
        data['title'] = title
    if authors:
        data['authors'] = authors
    if abstract:
        data['abstract'] = abstract
    if year:
        data['year'] = year

    key = 'dcc:%s' % id

    btype = '@techreport'
    return data2bib(data, key, type=btype)
Beispiel #4
0
def fetch_bibtex(id):
    url = url_format % id

    f = urllib.urlopen(url)
    html = f.read()
    f.close()

    parser = MyHTMLParser()
    parser.feed(html)

    data = {
        'arxiv':   id,
        'title':   parser.title,
        'authors': parser.author,
        'year':    parser.year,
        'eprint':  id,
        'url':     url_format % id,
        }

    return data2bib(data, 'arxiv:%s' % id)
Beispiel #5
0
def fetch_bibtex(id):
    xml = dccRetrieveXML(id)

    try:
        title, authors, year, abstract = dccXMLExtract(xml)
    except:
        print >>sys.stderr, xml
        raise

    data = {"institution": "LIGO Laboratory", "number": id, "dcc": id, "url": url_format % id}

    if title:
        data["title"] = title
    if authors:
        data["authors"] = authors
    if abstract:
        data["abstract"] = abstract
    if year:
        data["year"] = year

    key = "dcc:%s" % id

    btype = "@techreport"
    return data2bib(data, key, type=btype)
Beispiel #6
0
 def get_bibtex(self):
     data = self.get_data()
     bibentry = data2bib(data, self.get_sid())
     return bibentry.as_string()
Beispiel #7
0
 def get_bibtex(self):
     data = self.get_data()
     key = self.get_sid()
     btype = '@techreport'
     bibentry = data2bib(data, key, type=btype)
     return bibentry.as_string()