libZoteroJS icon indicating copy to clipboard operation
libZoteroJS copied to clipboard

Example usage

Open tamielbr opened this issue 9 years ago • 3 comments

Hi! Any chance you could post some info on how this could be used? A simple example would help me quite a lot. Thanks!

tamielbr avatar May 02 '16 20:05 tamielbr

Here's a super simple example:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>title</title>
    <script src="/libzotero.js"></script>
</head>
<body>
    <script>
        var userId = 123456789; //your user id
        Zotero.config.apiKey = '<PUT YOUR API KEY HERE>'; // you can create one here: https://www.zotero.org/settings/keys
        Zotero.config.useConfigKey = true;
        Zotero.init();

        lib = new Zotero.Library('user', userId, null, Zotero.config.apiKey);
        lib.loadItems().then(function() {
            console.info(lib.items.objectArray);
        }).catch(function(err) {
            console.warn(err);
        });
    </script>
</body>
</html>

tnajdek avatar May 25 '16 14:05 tnajdek

Thanks!

tamielbr avatar May 30 '16 16:05 tamielbr

Hi, Thank's for that Actually it only gather what seems to be the 25 last entries I added to my library. why not all of them and how to do so ? I actually face the same issue when using the api directly Thank's

jbonlinea avatar Oct 15 '18 11:10 jbonlinea