Site for sharing and archiving links. * looks up url titles * adds thumbnails for and jGrowls embedded versions of Flickr, Imageshack, Vimeo and YouTube urls * converts Twitter status urls to their full text and adds user thumbnail * generates Atom and RSS feeds * regex search * embeds Flash mp3 player for mp3 urls * looks good on iPhone * PubSubHubbub notification * plugin interface * rack interface * Gravatar support !http://static.mmb.s3.amazonaws.com/murlsh_screenshot.jpg! !http://static.mmb.s3.amazonaws.com/murlsh_iphone_screenshot.jpg! See "http://urls.matthewm.boedicker.org/":http://urls.matthewm.boedicker.org/ for example. h1. Installation h2. Phusion Passenger DESTINATION_DIRECTORY is the web directory to install the murlsh site to.
gem sources -a http://gemcutter.org/
gem install murlsh
murlsh DESTINATION_DIRECTORY
cd DESTINATION_DIRECTORY
edit config.yaml
rake init
h1. Updating
If you are using the gem and it gets updated to a new version you should run
the murlsh command again from your web directory to update plugins, javascript
and css. It will prompt before overwriting anything in case you have made
modifications.
h1. Plugins
Classes in the plugins directory can be used to change behavior at certain
points. Each class that extends Murlsh::Plugin and sets an instance variable
called @hook will be called for that hook. Each plugin has a run() method that
accepts arguments and returns something. These methods will be called in the
order of their class names sorted lexically. Some hooks pass the output of their
run() method to the next plugin for that hook so that the data can be passed
through a chain of methods that each do something to it.
A lot of the standard behavior is implemented as plugins. See the plugins
directory for examples.
Plugin hooks
|Hook|Description|run() arguments|Returns|
|add_pre|called before a new url is saved|url, config hash|undefined|
|add_post|called after a new url is saved|config hash|undefined|
|hostrec|post process the domain that is shown after links|domain, url, title|text to display|
|html_parse|parse HTML using something like Hpricot or Nokogiri|parseable|parsed HTML, only first plugin is run (cannot be chained)|
|time|convert the time of a post into a string for display|time|time display text|
|via|convert a via url into a string for display|via url|via url display text|
h1. PubSubHubbub
Murlsh can notify "PubSubHubbub":http://code.google.com/p/pubsubhubbub/ hubs
when a new url is added by adding them to config.yaml. The pubsubhubbub_hubs
key is a list of hashes in the following format:
pubsubhubbub_hubs:
- publish_url: http://pubsubhubbub.appspot.com/publish
subscribe_url: http://pubsubhubbub.appspot.com/
publish_url is where the notifications get sent
subscribe_url is what gets put in the feed as link rel="hub"
This will make updates to your feed show up in Google Reader instantly.
h1. Thumbnail Locators
If the url for a thumbnail image can be generated by regex search and replace
on a posted url, a rule can be added to the configuration to automatically
show a thumbnail image for it. The 'thumb_locators' config key is a hash
of Javascript regex to Javascript replacement string (which can include
captured groups). The hash key is wrapped in ^ and $ before compilation so
it must match the entire url. The regex is compiled case-insensitive.
For example:
* Show the GitHub octocat Apple touch icon
(http://github.com/apple-touch-icon.png) as a thumbnail for GitHub links
* Show a friend's Gravatar for the thumbnails of links to his blog
thumb_locators:
(http:\/\/github\.com\/).*: $1apple-touch-icon.png
http:\/\/myfriend\.com\/.*: http://gravatar.com/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
h1. Design Goals
* make site fast and very cacheable, caching wrapper around calls to third party JSON APIs
* low effort required to add a url, get metadata programatically instead of requiring user to specify
* heavy lifting on the client side
* allow customization with config and plugins
* full regex search for finding saved urls
* simple security (no sessions, no cookies)
Questions and comments: "matthewm@boedicker.org":mailto:matthewm@boedicker.org