» tagged pages
» logout
priv.at
Return to priv.at

How priv.at works

(or Cancel)

(Editing anonymously: to be credited for your changes, login or register a new account)

other page actions:

Tags Applied to this Topic

1 person has tagged this page:

priv.at works in two stages. (source code at the bottom of this page)

Generating a bookmarklet

priv.at requires that you enter your username, and then a piece of javascript creates a bookmark for you dynamically.

This bookmarklet is essentially your username and the url + title (which is taken from the html title) of the page you are looking at.

Posting bookmarks to del.icio.us

It’s possible to tag something for:userName and have that bookmark sent to the userName. So priv.at simply uses the del.icio.us API to post a bookmark.

The tricky part is what if two people bookmark the same url? Then the bookmark can’t be added, it has to be modified to include the new person.

In order to do this, priv.at keeps a record of every bookmark and every bookmarker, and joins them in a many to many relationship.

When bookmarks are privately posted, priv.at looks to see if the bookmark has been saved privately already, and if it has, then it appends the username/bookmark pair to the list and reconstructs the bookmark and posts it to del.icio.us.

This is why it’s important that the local database and del.icio.us never get out of sync.

Source Code

Database schema:


-- Database: `bookmarks`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `pmarks`
-- 

CREATE TABLE `pmarks` (
  `id` int(11) NOT NULL auto_increment,
  `hash` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `hash` (`hash`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4604 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `pusers`
-- 

CREATE TABLE `pusers` (
  `pmarks_id` int(11) NOT NULL default '0',
  `username` varchar(255) NOT NULL default '',
  KEY `pmarks_id` (`pmarks_id`,`username`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Username:
Password:
(or Cancel)