document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <html>
  2. <head>
  3. <title>urls recently annotated with hypothesis</title>  
  4. <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.2.min.js"></script>
  5. <style>
  6. body { margin-left: .5in; margin-top:.25in; font-family:verdana; word-break:break-word; font-size:11pt }
  7. a { color: gray }
  8. #widget { width: 50%; padding:8px; border-width:thin; border-style:solid }
  9. </style>  
  10. </head>
  11. <body>
  12.  
  13. <div id="widget">
  14. <h1>urls recently annotated with hypothesis</h1>  
  15. </div>   
  16.  
  17. <script>
  18. function load() {
  19. $.get( "https://hypothes.is/api/search", function( data )
  20.   {  process(data[\'rows\']);});  
  21. }
  22.  
  23.  
  24. function process(rows) {
  25.     var o = new Object();
  26.     for ( i=0; i < rows.length; i++ ) {
  27.         row = rows[i];
  28.         uri = row[\'uri\'];
  29.     if ( uri in o )
  30.         o[uri] += 1;
  31.     else
  32.         o[uri] = 1;
  33.     }
  34.  
  35.     for (key in o) {
  36.         $(\'#widget\').append(\'<p><a href="https://via.hypothes.is/\' + key + \'">\' + key + \'</a> (\' + o[key] + \')</p>\');
  37.     }
  38. }
  39.  
  40. load();
  41. </script>
  42.  
  43. </body>
  44. </html>
');