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

Develop the list extension to present details from Zotero #7

Open
jpadfield opened this issue Aug 2, 2021 · 0 comments
Open

Develop the list extension to present details from Zotero #7

jpadfield opened this issue Aug 2, 2021 · 0 comments

Comments

@jpadfield
Copy link
Owner

Zotero's API allows the details of public collections to be extracted and re-used.

It could be useful for these details to be pull, formatted and presented as part of a simple-site page.

Public collection URLs are in the form: https://www.zotero.org/USERNAME/collections/COLLECTIONCODE

API calls are in the form: https://api.zotero.org/users/USERID/collections/COLLECTIONCODE/items

The USERID is not easy to get from the USERNAME via the API but it can be scraped from any public URL is a section of javascript:

		<script type="application/json" id="zotero-web-library-config">
			{
    "apiConfig": {
        "apiAuthorityPart": "api.zotero.org"
    },
    "streamingApiUrl": "wss:\/\/stream.zotero.org",
    "translateUrl": "https:\/\/t0guvf0w17.execute-api.us-east-1.amazonaws.com\/Prod\/",
    "libraries": {
        "include": [
            {
                "key": "uUSERID",
                "isGroupLibrary": false,
                "name": "USER DISPLAY NAME's Library",
                "slug": "USERNAME"
            }
        ],
        "includeMyLibrary": false,
        "includeUserGroups": false
    }
}		</script>

So given a public URL an extension would need to:

  1. Scrape the USERID
  2. Create the API URL
  3. Pull in the JSON details
  4. Extract what is needed
  5. Format an html based list

Some thought swill need to be given to exactly what data is used and how it should be displayed

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

No branches or pull requests

1 participant