Skip to content

Commit

Permalink
removed solr cursor usage
Browse files Browse the repository at this point in the history
  • Loading branch information
eddotman committed May 18, 2016
1 parent e8e02bd commit 4fc11db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions articledownloader/articledownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ def get_dois_from_search(self, query, rows=500):

else: #Need to split queries
stop_query = False
cursor = '*'
offset = 0

while not stop_query:
search_url = base_url + query + '&rows=' + str(max_rows) + '&cursor=' + cursor
search_url = base_url + query + '&rows=' + str(max_rows) + '&offset=' + str(offset)
response = requests.get(search_url, headers=headers)
try:
j_response = response.json()
cursor = j_response['message']['next-cursor']
if len(j_response["message"]["items"]) < max_rows or len(dois) >= rows: stop_query = True
offset += max_rows
if len(dois) >= rows: stop_query = True
for item in j_response["message"]["items"]: dois.append(item["DOI"])
except Exception, e:
self.__logger.warning(str(e) + str(response.text))
Expand Down
Binary file added dist/articledownloader-4.8.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
setup(
name = 'articledownloader',
packages = ['articledownloader'], # this must be the same as the name above
version = '4.8',
version = '4.9',
description = 'A class for downloading scientific journal articles',
author = 'Edward Kim',
author_email = 'eddotman@gmail.com',
url = 'https://github.com/eddotman/article-downloader', # use the URL to the github repo
download_url = 'https://www.github.com/eddotman/article-downloader/tarball/4.8',
download_url = 'https://www.github.com/eddotman/article-downloader/tarball/4.9',
keywords = ['journal', 'paper', 'article', 'downloader'], # arbitrary keywords
)

0 comments on commit 4fc11db

Please sign in to comment.