{ "metadata": { "name": "Europe PMC Test" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Testing Europe PMC API" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Find the git repository of this at [https://github.com/waltherg/article-recommender](https://github.com/waltherg/article-recommender).\n", "\n", "Fetch and fingerprint some article and look for articles on PubMed that are similar to this one.\n", "\n", "For simplicity, let's look for articles that were written by the same authors.\n", "\n", "Let's also assume that articles are more relevant for us if they were co-authored by a greater subset of authors of the original paper." ] }, { "cell_type": "code", "collapsed": false, "input": [ "import urllib2\n", "import urllib\n", "from BeautifulSoup import BeautifulSoup" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "article_url = 'http://www.pnas.org/content/101/7/1822'\n", "response = urllib2.urlopen(article_url)\n", "html_response = response.read()\n", "data = BeautifulSoup(html_response)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "title = data.findAll('title')\n", "title" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "pyout", "prompt_number": 3, "text": [ "[