<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/controllers/authorizations_controller.rb</filename>
    </added>
    <added>
      <filename>app/helpers/authorizations_helper.rb</filename>
    </added>
    <added>
      <filename>db/migrate/20090404062822_add_tokens_to_user.rb</filename>
    </added>
    <added>
      <filename>test/functional/authorizations_controller_test.rb</filename>
    </added>
    <added>
      <filename>test/unit/helpers/authorizations_helper_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -3,4 +3,5 @@ tmp/*
 .DS_Store
 doc/*
 config/database.yml
-config/consumer.yml
\ No newline at end of file
+config/consumer.yml
+db/schema.rb
\ No newline at end of file</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 # == Schema Information
-# Schema version: 20090404053409
+# Schema version: 20090404062822
 #
 # Table name: users
 #
@@ -10,8 +10,27 @@
 #  token              :string(128)
 #  token_expires_at   :datetime
 #  email_confirmed    :boolean(1)      not null
+#  atoken             :string(255)
+#  asecret            :string(255)
 #
 
 class User &lt; ActiveRecord::Base
   include Clearance::App::Models::User
+  
+  attr_accessible :atoken, :asecret
+  
+  def authorized?
+    !atoken.blank? &amp;&amp; !asecret.blank?
+  end
+  
+  def oauth
+    @oauth ||= Twitter::OAuth.new(ConsumerConfig['token'], ConsumerConfig['secret'])
+  end
+  
+  def client
+    @client ||= begin
+      oauth.authorize_from_access(atoken, asecret)
+      Twitter::Base.new(oauth)
+    end
+  end
 end</diff>
      <filename>app/models/user.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,9 @@
-&lt;h2&gt;Yo!&lt;/h2&gt;
\ No newline at end of file
+&lt;h2&gt;Yo!&lt;/h2&gt;
+
+&lt;%- if current_user.authorized? -%&gt;
+  &lt;%- for tweet in current_user.client.friends_timeline -%&gt;
+    &lt;%= debug tweet %&gt;&lt;br /&gt;&lt;br /&gt;
+  &lt;%- end -%&gt;
+&lt;%- else -%&gt;
+  &lt;p&gt;We need you to authorize this app. &lt;%= link_to 'Authorize', new_authorization_url %&gt;&lt;/p&gt;
+&lt;%- end -%&gt;
\ No newline at end of file</diff>
      <filename>app/views/home/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -2,5 +2,6 @@ ActionController::Routing::Routes.draw do |map|
   map.root :controller =&gt; 'home'
   map.resources :users, :has_one =&gt; [:password, :confirmation]
   map.resource :session
+  map.resource :authorization
   map.resources :passwords
 end</diff>
      <filename>config/routes.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>db/schema.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>4300fe9a32e4c7daf2a4834905cdc05804634eca</id>
    </parent>
  </parents>
  <author>
    <name>John Nunemaker</name>
    <email>nunemaker@gmail.com</email>
  </author>
  <url>http://github.com/jnunemaker/twitter-app/commit/d4171cdcc5c191ae10cadd50a82007b78d82b45f</url>
  <id>d4171cdcc5c191ae10cadd50a82007b78d82b45f</id>
  <committed-date>2009-04-03T23:45:06-07:00</committed-date>
  <authored-date>2009-04-03T23:45:06-07:00</authored-date>
  <message>Authorization with twitter is functional.</message>
  <tree>654b81b27b3e95037bab7802ac23c039815a785d</tree>
  <committer>
    <name>John Nunemaker</name>
    <email>nunemaker@gmail.com</email>
  </committer>
</commit>
