aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xexamples/get_distribution_image.rb17
1 files changed, 17 insertions, 0 deletions
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
+