ignore .ruby-version
add gem
add image model
[from now] Fri Nov 29 03:02:31 JST 2013

diff --git a/Rakefile b/Rakefile
index 470d12e..d551ce6 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,3 +1,4 @@
 require "bundler/gem_tasks"
 require 'sinatra/activerecord'
 require 'sinatra/activerecord/rake'
+require './db/connection'
diff --git a/app.rb b/app.rb
index b1e1f29..9f4a289 100644
--- a/app.rb
+++ b/app.rb
@@ -1,3 +1,9 @@
+require "./lib/alicesaid"
+
 get '/' do
   'hoge'
 end
+
+crawler = AliceSaid::Crawler.new
+puts crawler.get_uris
+
diff --git a/db/migrate/20131128170208_images.rb b/db/migrate/20131128170208_images.rb
index a000b63..109f2c3 100644
--- a/db/migrate/20131128170208_images.rb
+++ b/db/migrate/20131128170208_images.rb
@@ -1,7 +1,10 @@
 class Images < ActiveRecord::Migration
-  def up
-  end
-
-  def down
+  def self.up
+    create_table :images do |t|
+      t.integer :character_id
+      t.binary  :blob
+      t.integer :width
+      t.integer :height
+    end
   end
 end
diff --git a/lib/alicesaid.rb b/lib/alicesaid.rb
index bd2cb2b..fe571d2 100644
--- a/lib/alicesaid.rb
+++ b/lib/alicesaid.rb
@@ -1,5 +1,6 @@
 require "alicesaid/version"
+require "alicesaid/crawler"
+require "alicesaid/image"

-module Alicesaid
-  # Your code goes here...
-end
+ActiveRecord::Base.configurations = YAML.load_file('database.yml')
+ActiveRecord::Base.establish_connection('development')
diff --git a/lib/alicesaid/image.rb b/lib/alicesaid/image.rb
index 68542de..6833f22 100644
--- a/lib/alicesaid/image.rb
+++ b/lib/alicesaid/image.rb
@@ -10,6 +10,8 @@ module AliceSaid
     def initialize(google_image)
       @uri = google_image.uri
       @title = google_image.title
+      @width = google_image.width
+      @height = google_image.height
     end

     def blob