Zotero URI vs. select item
Hello,
the following two are the same item:
http://zotero.org/groups/2339240/items/9FNQ8D8G
zotero://select/items/5568133_9FNQ8D8G
Would somebody be able to remind me how the library ids (2339240, 5568133) are related?
I would like to make a bookmarklet that uses http://zotero.org/groups/2339240/items/9FNQ8D8G
to open zotero://select/items/5568133_9FNQ8D8G.
However, if the numbers aren't related (or the latter is a local number), then it won't work.
Many thanks!
Bjoern
the following two are the same item:
http://zotero.org/groups/2339240/items/9FNQ8D8G
zotero://select/items/5568133_9FNQ8D8G
Would somebody be able to remind me how the library ids (2339240, 5568133) are related?
I would like to make a bookmarklet that uses http://zotero.org/groups/2339240/items/9FNQ8D8G
to open zotero://select/items/5568133_9FNQ8D8G.
However, if the numbers aren't related (or the latter is a local number), then it won't work.
Many thanks!
Bjoern
Many thanks for the help!
Bjoern
javascript:(function(){
var href = window.location.href;
var url = href.replace(/https?\:\/\/(www\.)?zotero\.org\//,"zotero://select/");
url = url.replace(/\/[^\/]+\/items\/(collection|item)Key/,"/$1s");
window.location.href = url;
})();
When on a zotero web-library page, it opens the corresponding item in Zotero. Works on items and collections. Not very robust - e.g. ought to display warning when not on a zotero page.
https://github.com/bjohas/zoteroSelectItem/blob/master/bookmarklet.js
(Zotero could theoretically allow zotero://select/users/12345/items/ABCD2345 to work if you've synced, but that doesn't happen now — instead if just uses a default path for My Library regardless of whether you've synced.)