Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>urls recently annotated with hypothesis</title>
- <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.2.min.js"></script>
- <style>
- body { margin-left: .5in; margin-top:.25in; font-family:verdana; word-break:break-word; font-size:11pt }
- a { color: gray }
- #widget { width: 50%; padding:8px; border-width:thin; border-style:solid }
- </style>
- </head>
- <body>
- <div id="widget">
- <h1>urls recently annotated with hypothesis</h1>
- </div>
- <script>
- function load() {
- $.get( "https://hypothes.is/api/search", function( data )
- { process(data['rows']);});
- }
- function process(rows) {
- var o = new Object();
- for ( i=0; i < rows.length; i++ ) {
- row = rows[i];
- uri = row['uri'];
- if ( uri in o )
- o[uri] += 1;
- else
- o[uri] = 1;
- }
- for (key in o) {
- $('#widget').append('<p><a href="https://via.hypothes.is/' + key + '">' + key + '</a> (' + o[key] + ')</p>');
- }
- }
- load();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement