Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moving labs API iiif catalog to prod service #67

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mekarpeles
Copy link
Member

This PR has been hacked together as a proof of concept and not tested but should be useful in closing:

}, allow_redirects=True, timeout=None)
def getids(q, limit=1000, cursor='', page=1):
q = request.args.get('q', '')
query = "(mediatype:(texts) OR mediatype:(image))" + \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about AV items?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The currently deployed version of labs uses this exact code -- we could expand it to include AV though this may be useful as a followup PR

@glenrobson
Copy link
Collaborator

The two times we use the getids method is:

@app.route('/iiif/')
def index():
    """Lists all available book and image items on Archive.org"""
    cursor = request.args.get('cursor', '')
    q = request.args.get('q', '')
    return jsonify(getids(q, cursor=cursor))

@app.route('/iiif/collection.json')
def catalog():
    cursor = request.args.get('cursor', '')
    q = request.args.get('q', '')
    domain = purify_domain(request.args.get('domain', request.url_root))
    return ldjsonify(collection(domain, getids(q, limit, cursor)['ids']))

@glenrobson
Copy link
Collaborator

@glenrobson
Copy link
Collaborator

@glenrobson
Copy link
Collaborator

Need to point this to the spring-2024 branch and get the fix deployed for testing.

@mekarpeles
Copy link
Member Author

https://iiif.archive.org/iiif/ and https://iiif.archivelab.org/iiif/ both work for me, this may have been an ephemeral issue.

https://iiif.archivelab.org/iiif/collection.json definitely seems broken and needs investigation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants