web API - order & sort don't work at all

Hi All,

I'm building a template page for my Wordpress website (http://www.geophysique.be/thomas-lecocq/publications/) to show my publications. I want to order them by date and sort them "desc". Here is the api call :

https://api.zotero.org/users/222401/collections/TT2WRPGH/items?order=date&sort=desc&format=ieee&content=bib

The result is not sorted. Am I doing something wrong or is there a bug somewhere ?

Thanks in advance,

Thomas
  • There's no bug. You can't order by the Date field currently—only dateAdded and dateModified. You'll be able to order by the Title field soon, and eventually other fields.
  • Thanks Dan,

    I'll maybe use the ATOM format rather than the preformatted bib then, to order the output array manually...

    Thanks for the quick answer !

    Thom
  • Also, there's no such thing as "format=ieee". You want "style=ieee". But the IEEE style doesn't make sense in content=bib mode, because it's a numeric style and each item would be [1]. If you just want to display a bibliography, you can use format=bib instead of content=bib, and then the bibliography is sorted according to the style specified. But IEEE will still sort numerically. You could create a custom style with date-based sorting, but custom styles are not yet supported via the API.
  • The lack of sorting option is really a big problem for us. We were hoping to use Zotero to create a group library with several subcollections for each researcher that is part of our center. I was then hoping to use the Zotero API to feed publication lists to personal pages of researchers on our website in journal style format. This whole process is useless for us if we cannot sort by publication date.
  • It should be possible to sort the Atom feeds by pretty much any category using fairly simple XSLT or using XML or string manipulation tools on the server side (on your web server).
  • I'd like to give this a bump and just say that this type of feature would be very useful for one thing I'm trying to do: just create a webpage with all my references sorted by author. (and the ability for anyone to search my library on a webpage without needing zotero).
  • Why can't you do the sorting in the, say, PHP code that your page is using? Any approach that requests the feed from the Zotero server on every page load and sends it to the user without the possibility of post-processing on your machine (like using AJAX to present it, pulling right from the Zotero server) will prevent caching and create unnecessary load. Sorting would of course be nice-- but it's easily accomplished by even the most basic post-processing.
  • The main problem with non-server-based sorting is that you have to pull all results before you can sort, which, depending on the library/collection size, may require multiple requests, even if you're not presenting them all to the user at once. This isn't an issue on smaller libraries/collections, though.

    But server-side sorting is still planned for the near future.
Sign In or Register to comment.