#!/usr/bin/env ruby # coding: utf-8 require 'sqlite3' require 'cgi' cgi = CGI.new(:accept_charset => "UTF-8") print "Content-type: text/html; charset=UTF-8\n\n" mode = cgi['mode'] db=SQLite3::Database.new("/tmp/viewer.sq3") db.execute("CREATE TABLE IF NOT EXISTS " + "mapdate( name text primary key, period text, address text, season text, viewer text, latlng text, type text)") thiscgi = "./"+File.basename($0) if mode == ""#htmlに表示するやつを書く print <<__EOM__ <h1>データベースから抽出andデータ作成</h1> <form method="POST" action="#{thiscgi}" enctype="multipart/form-data"> </form> __EOM__ else # ok push後こっちにくる。この辺でgeojsonを作る end