Created
April 25, 2010 14:58
-
-
Save hpiwowar/378456 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import datasources | |
from datasources import pubmed | |
from datasources import urlopener | |
def test_get_pmids_from_gist_query(): | |
gist_url = "http://gist.github.com/raw/377863/fba998429b36d07c304a28a07c4dfde592b0c4f7/sensorimotor_fmri_pubmed_query.txt" | |
response = get_pmids_from_gist_query(gist_url) | |
assert_equals(response[0:5], ['20092581', '20055536', '20053105', '20053076', '20037218']) | |
assert_equals(len(response), 2851) | |
def get_pmids_from_gist_query(query_text_url): | |
query_text = urllib2.urlopen(query_text_url).read() | |
all_pmids = pubmed.search(query_text) | |
return(all_pmids) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment