source: bookmarks/trunk/index.cgi @ 12

Last change on this file since 12 was 9, checked in by peter, 12 years ago
  • use SQL::Interp to generate the SQL for Bookmarks::get_resources()
  • Bookmarks::get_resources() accepts a limit parameter to add a limit to the SQL query
  • added a feed run mode that returns an Atom feed of the most recent 12 bookmarks; can have an optional ?tag parameter that only looks for bookmarks with that tag
  • added an explicit "list" dispatch target that calls the `list run mode
  • Property svn:executable set to *
File size: 703 bytes
Line 
1#!/usr/bin/perl -w
2use strict;
3
4# bookmarklet to add a bookmark via the browser
5# javascript:(function(){window.open("http://grim.ath.cx/~peter/bookmarks?uri="+document.location+"&title="+document.title,"edit_bookmark","width=800,height=250")})()
6
7use CGI::Application::Dispatch;
8CGI::Application::Dispatch->dispatch(
9    table => [
10        '[get]'              => { app => 'BookmarkApp', rm => 'list' },
11        'list[get]'          => { app => 'BookmarkApp', rm => 'list' },
12        'feed[get]'          => { app => 'BookmarkApp', rm => 'feed' },
13        ':id/:field?[get]'   => { app => 'BookmarkApp', rm => 'view' },
14        ':id?[post]'         => { app => 'BookmarkApp', rm => 'edit' },
15    ],
16);
Note: See TracBrowser for help on using the repository browser.