Tasty Safari

Tasty Safari v1.5
Copy­right © 2004, Brian Enigma <brian @ net­ninja . com>

Down­load Tasty Safari v1.5, binary and source code, 8MB
Down­load just the source code, includ­ing depen­dent libraries, mul­ti­me­dia, and build files, (4MB)

Fea­tures

  • Down­load your sub­scribed links on del.icio.us into Safari
  • Backs up pre­vi­ous 9 ver­sions of your book­marks in case of disaster
  • Tested with Safari 1.2 (v125) and OS X Panther

Fixed/Added in v1.5

  • Added pre­view of book­mark bar
  • Check­marks to enable/disable Deli­cious home, your Deli­cious page, and your Deli­cious inbox

Process & Backups

Safari stores your book­marks in a folder in your home direc­tory, specif­i­cally ~/Libray/Safari/Bookmarks.plist. This is an XML file con­form­ing to the stan­dard Apple Prop­er­ties List (plist), which basi­cally means it can store nested asso­cia­tive arrays. It stores dic­tio­nar­ies (book­marks and their asso­ci­ated meta­data) and fold­ers (arrays).

Tasty Safari loads a copy of this file into mem­ory. It then processes the copy by adding your del.icio.us book­marks. Assum­ing every­thing hap­pens cor­rectly, a backup is made and the new book­mark plist file is written.

The backup process saves the last nine ver­sions of your book­marks as files named Bookmarks.plist.#, where # is a num­ber between 1 and 9. The fol­low­ing steps are performed:

  • If Bookmarks.plist.9 exists, it is removed
  • If Bookmarks.plist.8 exists, it is renamed to Bookmarks.plist.9
  • If Bookmarks.plist.1 exists, it is renamed to Bookmarks.plist.2
  • Bookmarks.plist is renamed to Bookmarks.plist.1
  • The newly formed book­mark data sit­ting in mem­ory is writ­ten as Bookmarks.plist

Every step of the down­load, import, and save process is accom­pa­nied by sev­eral “san­ity checks.” These ensure that all of the data is in a state that the pro­gram expects and can deal with. If some­thing does not look right, Tasty Safari will abort and dis­play infor­ma­tion about an “Unex­pect­edXm­lEx­cep­tion.” While this is not nor­mal behav­ior (please send me any details if you get an error like this), it is behav­ior put in place to ensure your book­marks never get trashed.

To-Do List

  • Enable the Can­cel button
  • Cur­rently defaults to putting del.icio.us folder at the far right of the book­mark bar; should be configurable
  • Incre­men­tal updates–download only what is new since the last time you downloaded
  • Rewrite to bet­ter sep­a­rate GUI and back-end code, enabling run­ning from the com­mand line (e.g. cron job)

Screen­shots


Screen­shot 1: Appli­ca­tion startup


Screen­shot 2: Appli­ca­tion running


Screen­shot 3: Appli­ca­tion run complete


Screen­shot 4: Safari bookmarks

Pre­vi­ous Versions

Leave a Comment