Esempio n. 1
0
def authors():
    """Returns get_authors() output."""
    spider = phil_spider.PhilSpider()
    response = fake_response_from_file('phil/test_thesis.json')
    jsonrecord = json.loads(response.body_as_unicode())
    response.meta["jsonrecord"] = jsonrecord[0]
    return spider.get_authors(jsonrecord[0]['authors'])
Esempio n. 2
0
def parse_requests():
    """Returns a fake request to the record file.

    With links.
    """
    spider = phil_spider.PhilSpider()
    response = fake_response_from_file('phil/test_thesis.json')
    return spider.parse(response)
Esempio n. 3
0
def journal():
    """Return results generator from the Phil spider.

    Journal specific.
    """
    spider = phil_spider.PhilSpider()
    response = fake_response_from_file('phil/test_journal.json')
    jsonrecord = json.loads(response.body_as_unicode())
    response.meta["jsonrecord"] = jsonrecord[0]
    return spider.build_item(response)
Esempio n. 4
0
def splash():
    """Returns a call to build_item(), and ultimately the HEPrecord"""
    spider = phil_spider.PhilSpider()
    response = fake_response_from_file("phil/fake_splash.html", url="http://philpapers.org/rec/SDFGSDFGDGSDF")

    response.meta["urls"] = [u'http://philpapers.org/rec/SDFGSDFGDGSDF']
    response.meta["jsonrecord"] = {
        u'publisher': u'', u'doi': None, u'links': [u'http://philpapers.org/rec/SDFGSDFGDGSDF'], u'title': u'Bringing Goodness', u'journal': u'', u'type': u'book', u'abstract': u'Now indulgence dissimilar for his thoroughly has terminated. Agreement offending commanded my an. Change wholly say why eldest period. Are projection put celebrated particular unreserved joy unsatiable its. In then dare good am rose bred or. On am in nearer square wanted.', u'ant_publisher': u'', u'year': u'14/12/2015', u'editors': [], u'collection': u'', u'pages': u'', u'volume': u'0', u'pub_type': u'thesis', u'pubInfo': u'Dissertation, The University of Somewhere', u'authors': [u'Jennings, Bob'], u'issue': u'', u'id': u'SDFGSDFGDGSDF', u'categories': [{u'ancestry': [{u'id': u'5680', u'name': u'Philosophy of Physical Science'}, {u'id': u'5719', u'name': u'Philosophy of Cosmology'}, {u'id': u'5731', u'name': u'Design and Observership in Cosmology'}, {u'id': u'5733', u'name': u'Anthropic Principle'}], u'id': u'5733', u'name': u'Anthropic Principle'}, {u'ancestry': [{u'id': u'5856', u'name': u'Philosophy of Probability'}, {u'id': u'5878', u'name': u'Probabilistic Reasoning'}, {u'id': u'5919', u'name': u'Subjective Probability'}, {u'id': u'5927', u'name': u'Imprecise Credences'}], u'id': u'5927', u'name': u'Imprecise Credences'}, {u'ancestry': [{u'id': u'5932', u'name': u'General Philosophy of Science'}, {u'id': u'6100', u'name': u'Theories and Models'}, {u'id': u'6112', u'name': u'Theoretical Virtues'}, {u'id': u'6122', u'name': u'Simplicity and Parsimony'}], u'id': u'6122', u'name': u'Simplicity and Parsimony'}, {u'ancestry': [{u'id': u'5680', u'name': u'Philosophy of Physical Science'}, {u'id': u'5750', u'name': u'Philosophy of Physics, Miscellaneous'}, {u'id': u'5751', u'name': u'Astrophysics'}], u'id': u'5751', u'name': u'Astrophysics'}, {u'ancestry': [{u'id': u'5856', u'name': u'Philosophy of Probability'}, {u'id': u'5878', u'name': u'Probabilistic Reasoning'}, {u'id': u'5879', u'name': u'Bayesian Reasoning'}, {u'id': u'5881', u'name': u'Bayesian Reasoning, Misc'}], u'id': u'5881', u'name': u'Bayesian Reasoning, Misc'}]
        }

    return spider.scrape_for_pdf(response)
Esempio n. 5
0
def record():
    """Return results generator from the Phil spider.

    Thesis specific.
    """
    spider = phil_spider.PhilSpider()
    response = fake_response_from_file('phil/test_thesis.json')
    jsonrecord = json.loads(response.body_as_unicode())
    response.meta["jsonrecord"] = jsonrecord[0]
    response.meta["direct_links"] = [
        "http://philpapers.org/go.pl?id=BROBB&proxyId=none&u=http%3A%2F%2Fanalysis.oxfordjournals.org%2Fcontent%2F66%2F3%2F194.full.pdf%2Bhtml%3Fframe%3Dsidebar",
        "http://philpapers.org/go.pl?id=BROBB&proxyId=none&u=http%3A%2F%2Fbrogaardb.googlepages.com%2Ftensedrelationsoffprint.pdf"
    ]
    return spider.build_item(response)