<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/controllers/iframe_controller.rb</filename>
    </added>
    <added>
      <filename>app/controllers/story_controller.rb</filename>
    </added>
    <added>
      <filename>app/controllers/zack_controller.rb</filename>
    </added>
    <added>
      <filename>app/views/layouts/iframe.haml</filename>
    </added>
    <added>
      <filename>app/views/layouts/story.haml</filename>
    </added>
    <added>
      <filename>app/views/layouts/zack.haml</filename>
    </added>
    <added>
      <filename>app/views/story/complete.haml</filename>
    </added>
    <added>
      <filename>app/views/story/feed_form.haml</filename>
    </added>
    <added>
      <filename>app/views/story/feed_form2.haml</filename>
    </added>
    <added>
      <filename>app/views/story/index.haml</filename>
    </added>
    <added>
      <filename>app/views/zack/_footer.haml</filename>
    </added>
    <added>
      <filename>app/views/zack/_js_constants.haml</filename>
    </added>
    <added>
      <filename>app/views/zack/_roles.haml</filename>
    </added>
    <added>
      <filename>app/views/zack/action_success.haml</filename>
    </added>
    <added>
      <filename>app/views/zack/choose_role.haml</filename>
    </added>
    <added>
      <filename>app/views/zack/iframe_page.haml</filename>
    </added>
    <added>
      <filename>app/views/zack/index.haml</filename>
    </added>
    <added>
      <filename>config/deploy.rb</filename>
    </added>
    <added>
      <filename>public/zack/connect/xd_receiver.htm</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -28,4 +28,19 @@ class ApplicationController &lt; ActionController::Base
     RAILS_ENV != 'production'
   end
   
+  def require_facebook_user
+    begin
+      @facebook_session = session[:facebook_session]
+      @user = @facebook_session.user
+    rescue StandardError=&gt;exc
+      @user = nil
+      flash[:error] = &quot;Please sign in to facebook (#{exc.to_s})&quot;
+      redirect_to &quot;/&quot;
+    rescue Exception =&gt; exc2
+      @user = nil
+      flash[:error] = &quot;Error: #{exc2.to_s}&quot;
+      redirect_to &quot;/&quot;
+    end
+  end
+  
 end</diff>
      <filename>app/controllers/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,28 +1,5 @@
 class ZackPublisher &lt; Facebooker::Rails::Publisher
   include ActorRole
-  #File: lib/facebooker_publisher.rb Method: mini_feed
-  def mini_feed(user)
-#    send_as :action
-#    self.from( user)
-#    title &quot;wants to star in a porno with Zack.&quot;
-#    body &quot;#{fb_name(user)} is a good actor.&quot;
-#    image_1(image_path(&quot;fbtt.png&quot;))
-#    #image_1_link(&quot;http://chowder.msponge.com:8111&quot;) #outline_path(:only_path =&gt; false))
-#    RAILS_DEFAULT_LOGGER.debug(&quot;Sending mini feed story for user #{user.id}&quot;)
-    
-    
-      send_as :user_action
-      self.from user
-      data :friend=&gt;&quot;Mike&quot;
-  end
-  
-  def mini_feed_template
-      one_line_story_template &quot;{*actor*} did stuff with {*friend*}&quot;
-      one_line_story_template &quot;{*actor*} did stuff&quot;
-      short_story_template &quot;{*actor*} has a title {*friend*}&quot;, &quot;short_body&quot;
-      short_story_template &quot;{*actor*} has a title&quot;, &quot;short_body&quot;
-      full_story_template &quot;{*actor*} has a title {*friend*}&quot;, &quot;full_body&quot;
-  end
   
   def feed_role(user,role)
     send_as :user_action
@@ -32,8 +9,21 @@ class ZackPublisher &lt; Facebooker::Rails::Publisher
   
   def feed_role_template
     one_line_story_template &quot;{*actor*} wants to {*role*} - posted from #{link_to ENV['APP_NAME'],ENV['APP_URL']}&quot;
+    short_story_template &quot;{*actor*} wants to {*role*}&quot;,&quot;posted from #{link_to ENV['APP_NAME'],ENV['APP_URL']}&quot;
+  end
+  
+  def story_action_template
+    one_line_story_template &quot;{*actor*} wants to {*role*} - posted from #{link_to ENV['APP_NAME'],ENV['APP_URL']}&quot;
+    short_story_template &quot;{*actor*} wants to {*role*}&quot;, &quot;&lt;i&gt;{*comment*}&lt;/i&gt;&lt;br/&gt;posted from #{link_to ENV['APP_NAME'],ENV['APP_URL']}&quot;
+    full_story_template &quot;{*actor*} wants to {*role*}&quot;, &quot;&lt;i&gt;{*comment*}&lt;/i&gt;&lt;br/&gt;proudly posted from #{link_to ENV['APP_NAME'],ENV['APP_URL']}&quot;
   end
   
+#  def story_action
+#    send_as :user_action
+#    self.from user
+#    data :role=&gt;actor_role_text(role), :video =&gt; &quot;http://www.youtube.com/v/wzyT9-9lUyE&amp;hl=en&amp;fs=1&quot;
+#  end
+  
   def email(to,f = nil)
       send_as :email
       recipients to
@@ -41,5 +31,16 @@ class ZackPublisher &lt; Facebooker::Rails::Publisher
       title &quot;Zack N Miri think you are a star&quot;
       fbml 'Congratulations! You are going to be a movie star with Zack N Miri.'
       text fbml
-    end
+  end
+  
+  def self.register_if_needed(name)
+    find_bundle_id(name)
+  end
+  
+  def self.find_bundle_id(name)
+    template = Facebooker::Rails::Publisher::FacebookTemplate.find_by_template_name(name)
+    return template.bundle_id if template
+    result = self.send(&quot;register_#{name}&quot;)
+    return result
+  end
 end</diff>
      <filename>app/models/zack_publisher.rb</filename>
    </modified>
    <modified>
      <diff>@@ -67,6 +67,9 @@ Rails::Initializer.run do |config|
   # config.active_record.observers = :cacher, :garbage_collector
 end
 
+ENV['XD_RECEIVER_LOCATION'] = &quot;/zack/connect/xd_receiver.htm&quot;
+ENV['FACEBOOK_AUTHENTICATE_LOCATION'] = &quot;/zack/authenticate&quot;
+
 #File: lib/extensions.rb
 module Facebooker
   class Service   </diff>
      <filename>config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,9 +38,9 @@ ActionController::Routing::Routes.draw do |map|
   # Install the default routes as the lowest priority.
   # Note: These default routes make all actions in every controller accessible via GET requests. You should
   # consider removing the them or commenting them out if you're using named routes and resources.
-  map.connect '/', :controller =&gt; 'fb', :action =&gt; &quot;index&quot;
+  map.connect '/', :controller =&gt; 'zack', :action =&gt; &quot;index&quot;
   #map.connect '/intro', :controller =&gt; 'fb', :action =&gt; 'intro'
-  map.connect ':action', :controller =&gt; 'fb'
-  map.connect ':action/:id', :controller =&gt; 'fb'
-  map.connect ':action/:id.:format', :controller =&gt; 'fb'
+  map.connect ':controller', :action =&gt; &quot;index&quot;
+  map.connect ':controller/:action'
+  map.connect ':controller/:action/:id'
 end</diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,8 @@ module ActorRole
         &quot;splash around with Bubbles&quot;
       when :zack
         &quot;get some milk with Zack&quot;
+      when :force
+        &quot;use the force&quot;
       else
         &quot;do the unknown&quot;
     end</diff>
      <filename>lib/actor_role.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 FB_RequireFeatures([&quot;XFBML&quot;], function()
 {
-    FB.Facebook.init(window.api_key, &quot;/connect/xd_receiver.htm&quot;);
+    FB.Facebook.init(window.api_key, window.xd_receiver_location);
     FB.Facebook.get_sessionState().waitUntilReady(function() { } );
 });</diff>
      <filename>public/javascripts/facebook_require.js</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,7 @@ function ensure_init(callback) {
         // xd_receiver.php is a relative path here, because The Run Around
         // could be installed in a subdirectory
         // you should prefer an absolute URL (like &quot;/xd_receiver.php&quot;) for more accuracy
-        FB.Facebook.init(window.api_key, &quot;/connect/xd_receiver.htm&quot;);
+        FB.Facebook.init(window.api_key, window.xd_receiver_location);
 
         window.is_initialized = true;
         callback();
@@ -58,7 +58,7 @@ function facebook_button_onclick() {
           // you could do an ajax call for the account linking, and then
           // just replace content inline without a full page refresh.
           //refresh_page();
-          window.location = '/authenticate'
+          window.location = window.facebook_authenticate_location;
         });
     });
 }</diff>
      <filename>public/javascripts/zack.js</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>app/controllers/fb_controller.rb</filename>
    </removed>
    <removed>
      <filename>app/models/miri_publisher.rb</filename>
    </removed>
    <removed>
      <filename>app/views/fb/_roles.haml</filename>
    </removed>
    <removed>
      <filename>app/views/fb/action_success.haml</filename>
    </removed>
    <removed>
      <filename>app/views/fb/choose_role.haml</filename>
    </removed>
    <removed>
      <filename>app/views/fb/index.haml</filename>
    </removed>
    <removed>
      <filename>app/views/layouts/fb.haml</filename>
    </removed>
    <removed>
      <filename>public/connect/xd_receiver.htm</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>6d341301c1d81ec41f7d904379aec542f76e5d8d</id>
    </parent>
  </parents>
  <author>
    <name>Chris Hobbs</name>
    <email>chris@spongecell.com</email>
  </author>
  <url>http://github.com/ckhsponge/zacknmiri/commit/a5fb77604af356f34ec1053e8bac3ae3ded8ecb2</url>
  <id>a5fb77604af356f34ec1053e8bac3ae3ded8ecb2</id>
  <committed-date>2008-12-09T17:04:25-08:00</committed-date>
  <authored-date>2008-12-09T17:04:25-08:00</authored-date>
  <message>more story publishing and code cleanup</message>
  <tree>c8d073430148ac4a3da76c46d809cc98b27907da</tree>
  <committer>
    <name>Chris Hobbs</name>
    <email>chris@spongecell.com</email>
  </committer>
</commit>
