You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.1 KiB

4 years ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>jquery.rss zotero example</title>
  5. <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
  6. <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
  7. <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
  8. <script src="../dist/jquery.rss.min.js"></script>
  9. <script>
  10. var readTokenFromResponse = function(response, attr) {
  11. return $(response).find('tr th:contains(' + attr + ')').parent().find('td').text()
  12. }
  13. jQuery(function($) {
  14. $("#rss-feeds").rss("https://api.zotero.org/groups/9097/items/top?start=0&limit=55&format=atom", {
  15. entryTemplate: "<ul><li>Title: {title}</li><li>Author: {author}</li><li>Year: {year}</li></ul><br>",
  16. tokens: {
  17. year: function(entry, tokens) {
  18. return new Date(entry.publishedDate).getFullYear()
  19. }
  20. }
  21. })
  22. })
  23. </script>
  24. </head>
  25. <body>
  26. <div>
  27. <h1>jquery.rss zotero example</h1>
  28. <div id="rss-feeds"></div>
  29. </div>
  30. </body>
  31. </html>