Skip to content

Commit

Permalink
Merge branch 'master' of github.com:eddotman/article-downloader
Browse files Browse the repository at this point in the history
  • Loading branch information
eddotman committed Jun 3, 2015
2 parents 3b00fed + 3daeca6 commit c9a1e6b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can find DOIs using a CSV where the first column corresponds to search queri
###Downloading a single article
from articledownloader.articledownloader import ArticleDownloader
downloader = ArticleDownloader('your_API_key')
my_file = open('my_path/something.pdf')
my_file = open('my_path/something.pdf', 'r')

downloader.get_pdf_from_doi('target_doi', my_file, 'crossref')
downloader.get_pdf_from_doi('target_doi', my_file, 'elsevier')
Expand All @@ -41,13 +41,11 @@ Python:
downloader = ArticleDownloader('your_API_key')

#grab up to 5 articles per search
queries = downloader.load_queries_from_csv('path_to_csv_file')
queries = downloader.load_queries_from_csv(open('path_to_csv_file', 'r'))

piis = []
dois = []
for query in queries:
piis.append(downloader.get_dois_from_search(query))

dois = set(dois) #Get rid of duplicates
dois.append(downloader.get_dois_from_search(query))

for i, doi in enumerate(dois):
file = open(str(i) + '.pdf')
Expand Down

0 comments on commit c9a1e6b

Please sign in to comment.