From 6f4670485d20cbe07135c542959d1db1f39522af Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Thu, 21 Apr 2011 15:55:32 +0200 Subject: Simple program to read distribution map from database. --- examples/get_distribution_image.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 examples/get_distribution_image.rb diff --git a/examples/get_distribution_image.rb b/examples/get_distribution_image.rb new file mode 100755 index 0000000..96500a4 --- /dev/null +++ b/examples/get_distribution_image.rb @@ -0,0 +1,17 @@ +#!/usr/bin/ruby +# +# get_distribution_image DB KEY +# + +require 'rubygems' +require 'sqlite3' + +filename = ARGV[0] +key = ARGV[1] + +db = SQLite3::Database.new(filename) + +db.execute("SELECT png FROM key_distributions WHERE key=?", key) do |row| + puts row[0] +end + -- cgit v1.2.3