Skip to content

Commit 046ecbe

Browse files
authored
Merge pull request internetarchive#766 from internetarchive/765/hotfix/remove-lending-stats
765/hotfix/remove lending stats
2 parents f1f7e01 + c2f85e1 commit 046ecbe

File tree

5 files changed

+12
-358
lines changed

5 files changed

+12
-358
lines changed

openlibrary/core/lending.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def compose_ia_url(limit=None, page=1, subject=None, query=None, work_id=None,
167167
def get_random_available_ia_edition():
168168
"""uses archive advancedsearch to raise a random book"""
169169
try:
170-
url="http://%s/advancedsearch.php?q=_exists_:openlibrary_work+AND+loans__status__status:AVAILABLE&fl=identifier,openlibrary_edition,loans__status__status&output=json&rows=1&sort[]=random" % (config_bookreader_host)
170+
url="https://%s/advancedsearch.php?q=_exists_:openlibrary_work+AND+loans__status__status:AVAILABLE&fl=identifier,openlibrary_edition,loans__status__status&output=json&rows=1&sort[]=random" % (config_bookreader_host)
171171
content = urllib2.urlopen(url=url, timeout=config_http_request_timeout).read()
172172
items = simplejson.loads(content).get('response', {}).get('docs', [])
173173
return items[0]["openlibrary_edition"]

openlibrary/plugins/openlibrary/home.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121

2222
logger = logging.getLogger("openlibrary.home")
2323

24+
CAROUSELS_PRESETS = {
25+
'preset:thrillers': '(creator:"Clancy, Tom" OR creator:"King, Stephen" OR creator:"Clive Cussler" OR creator:("Cussler, Clive") OR creator:("Dean Koontz") OR creator:("Koontz, Dean") OR creator:("Higgins, Jack")) AND !publisher:"Pleasantville, N.Y. : Reader\'s Digest Association" AND languageSorter:"English"',
26+
'preset:children': '(creator:("parish, Peggy") OR creator:("avi") OR title:("goosebumps") OR creator:("Dahl, Roald") OR creator:("ahlberg, allan") OR creator:("Seuss, Dr") OR creator:("Carle, Eric") OR creator:("Pilkey, Dav"))',
27+
'preset:comics': '(subject:"comics" OR creator:("Gary Larson") OR creator:("Larson, Gary") OR creator:("Charles M Schulz") OR creator:("Schulz, Charles M") OR creator:("Jim Davis") OR creator:("Davis, Jim") OR creator:("Bill Watterson") OR creator:("Watterson, Bill") OR creator:("Lee, Stan"))'
28+
}
29+
2430
class home(delegate.page):
2531
path = "/"
2632

@@ -44,7 +50,7 @@ def GET(self):
4450
page.v2 = True
4551
return page
4652

47-
class random(delegate.page):
53+
class random_book(delegate.page):
4854
path = "/random"
4955

5056
def GET(self):
@@ -54,12 +60,6 @@ def GET(self):
5460
raise web.seeother("/")
5561

5662

57-
CAROUSELS_PRESETS = {
58-
'preset:thrillers': '(creator:"Clancy, Tom" OR creator:"King, Stephen" OR creator:"Clive Cussler" OR creator:("Cussler, Clive") OR creator:("Dean Koontz") OR creator:("Koontz, Dean") OR creator:("Higgins, Jack")) AND !publisher:"Pleasantville, N.Y. : Reader\'s Digest Association" AND languageSorter:"English"',
59-
'preset:children': '(creator:("parish, Peggy") OR creator:("avi") OR title:("goosebumps") OR creator:("Dahl, Roald") OR creator:("ahlberg, allan") OR creator:("Seuss, Dr") OR creator:("Carle, Eric") OR creator:("Pilkey, Dav"))',
60-
'preset:comics': '(subject:"comics" OR creator:("Gary Larson") OR creator:("Larson, Gary") OR creator:("Charles M Schulz") OR creator:("Schulz, Charles M") OR creator:("Jim Davis") OR creator:("Davis, Jim") OR creator:("Bill Watterson") OR creator:("Watterson, Bill") OR creator:("Lee, Stan"))'
61-
}
62-
6363
def get_ia_carousel_books(query=None, subject=None, work_id=None, sorts=None,
6464
_type=None, limit=None):
6565
if 'env' not in web.ctx:

openlibrary/templates/stats/lending.html

Lines changed: 0 additions & 250 deletions
This file was deleted.

openlibrary/templates/stats/waitinglists.html

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)