aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2011-04-21 15:55:32 +0200
committerJochen Topf <jochen@topf.org>2011-04-21 15:55:32 +0200
commit6f4670485d20cbe07135c542959d1db1f39522af (patch)
tree65a7b8ef25a2293fda5a36f8dbabe08b8d5d4c7e /examples
parent3b5fae193bdba7fb15413eff3ab13b128fd40c93 (diff)
downloadtaginfo-6f4670485d20cbe07135c542959d1db1f39522af.tar
taginfo-6f4670485d20cbe07135c542959d1db1f39522af.tar.gz
Simple program to read distribution map from database.
Diffstat (limited to 'examples')
-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
+