From: unbewusst.sein@... (=?ISO-8859-1?Q?Une_B=E9v?= =?ISO-8859-1?Q?ue?=) Date: 2008-07-06T18:01:33+09:00 Subject: Re: [ANN] amalgalite 0.2.0 Released Jeremy Hinegardner wrote: > > favicons are stored there as blob. > > Then yup, firefox 3 bookmarks file can be accessed via amalgalite now it look > like. That's very cool. meta info about that : Table: moz_favicons ========================================== Column : expiration |..........default_value : |.....declared_data_type : LONG |collation_sequence_name : BINARY |....not_null_constraint : false |............primary_key : false |.........auto_increment : false Column : url |..........default_value : |.....declared_data_type : LONGVARCHAR |collation_sequence_name : BINARY |....not_null_constraint : false |............primary_key : false |.........auto_increment : false Column : mime_type |..........default_value : |.....declared_data_type : VARCHAR(32) |collation_sequence_name : BINARY |....not_null_constraint : false |............primary_key : false |.........auto_increment : false Column : id |..........default_value : |.....declared_data_type : INTEGER |collation_sequence_name : BINARY |....not_null_constraint : false |............primary_key : true |.........auto_increment : false Column : data |..........default_value : |.....declared_data_type : BLOB |collation_sequence_name : BINARY |....not_null_constraint : false |............primary_key : false |.........auto_increment : false I'll try to extract those icons and build an html page with to learn with. I get the first one, saved to file, using : #! /usr/bin/env ruby require 'rubygems' require 'amalgalite' require 'rexml/document' require 'net/http' require 'uri' db=Amalgalite::Database.new( "places.sqlite" ) all_rows=db.execute( "SELECT url, mime_type, data FROM moz_favicons" ) blob_row = all_rows.first puts blob_row['url'] puts blob_row['mime_type'] uri = URI.parse(blob_row['url']) p "uri.host = #{uri.host}, uri.port = #{uri.port}, uri.scheme = #{uri.scheme}, uri.path = #{uri.path}" puts "#{uri.host}_#{File.basename(uri.path)}" blob_row['data'].write_to_file( "#{uri.host}_#{File.basename(uri.path)}" ) if !blob_row['data'].nil? works great ! now, i need that blob as a string to base64 encode it and make use of : for the time of posting i get no output from #to_string_io.read ? -- Une B�vue