<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/models/facebooker_publisher.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -51,22 +51,28 @@ class FacebookConnectController &lt; ApplicationController
   private
   def publish_story_of_review(p_bundle_id, p_facebook_session, p_review)
     restaurant = p_review.reload.restaurant
-    attachements = {}
+    first_image = nil
     if restaurant.images &amp;&amp; !restaurant.images.empty?
       first_image = restaurant.images.first
-      attachements = {
-        :images =&gt; [
-          :src =&gt; first_image.public_filename(:small),
-          :href =&gt; restaurant_url(restaurant)
-        ]}
+      first_image = {
+        :type =&gt; 'image',
+        :src =&gt; &quot;#{root_url[0..root_url.length - 2]}#{first_image.public_filename(:large)}&quot;,
+        :href =&gt; restaurant_url(restaurant)
+      }
     end
 
-    p_facebook_session.publish_user_action(p_bundle_id, {
-        :restaurant_url =&gt; restaurant_url(restaurant.id),
-        :restaurant_name =&gt; restaurant.name,
-        :restaurant_review =&gt; restaurant_review(p_review),
-        :restaurant_stat =&gt; restaurant_review_stat(p_review),
-        :restaurants_url =&gt; root_url}.merge(attachements), nil, p_review.comment)
+    user = p_facebook_session.user
+    FacebookerPublisher::deliver_publish_stream(
+        user, user, {
+        :attachment =&gt;  {
+          :name =&gt; &quot;#{restaurant_review(p_review)} and reviewed '#{restaurant.name}'&quot;,
+          :href =&gt; restaurant_url(restaurant),
+          :caption =&gt; restaurant_review_stat(p_review),
+          :description =&gt; p_review.comment,
+          :media =&gt; [first_image].compact},
+        :action_links =&gt; {
+            'text' =&gt; 'add your review!',
+            'href' =&gt; restaurant_url(restaurant)}});
   end
 
   def restaurant_review_stat(p_review)
@@ -74,7 +80,7 @@ class FacebookConnectController &lt; ApplicationController
     loved_count = p_review.restaurant.reviews.loved.count
     loved_percentage = (100 / total_reviews_count) * loved_count
 
-    &quot;#{total_reviews_count} reviews, #{loved_percentage}% loved &amp;amp; #{100 - loved_percentage}% hated!&quot;
+    &quot;#{total_reviews_count} review#{total_reviews_count &gt; 1 ? 's' : ''}, #{loved_percentage}% loved &amp; #{100 - loved_percentage}% hated!&quot;
   end
 
   def restaurant_review(p_review)
@@ -82,32 +88,51 @@ class FacebookConnectController &lt; ApplicationController
   end
 
   def publish_story_on_image_added(p_bundle_id, p_facebook_session, p_restaurant, p_image)
-    p_facebook_session.publish_user_action(p_bundle_id, {
-        :restaurant_url =&gt; restaurant_url(p_restaurant.id),
-        :restaurant_name =&gt; p_restaurant.name,
-        :restaurants_url =&gt; root_url,
-        :images =&gt; [
-          :src =&gt; p_image.public_filename(:small),
-          :href =&gt; restaurant_url(p_restaurant)
-        ]}, nil, p_restaurant.description, 2)
+    user = p_facebook_session.user
+    FacebookerPublisher::deliver_publish_stream(
+        user, user, {
+        :attachment =&gt;  {
+          :name =&gt; &quot;uploaded a new image of '#{p_restaurant.name}'&quot;,
+          :href =&gt; restaurant_url(p_restaurant),
+          :description =&gt; p_restaurant.description,
+          :media =&gt; [{
+            :type =&gt; 'image',
+            :src =&gt; &quot;#{root_url[0..root_url.length - 2]}#{p_image.public_filename(:large)}&quot;,
+            :href =&gt; restaurant_url(p_restaurant)
+          }]},
+        :action_links =&gt; {
+            'text' =&gt; 'add your review!',
+            'href' =&gt; restaurant_url(p_restaurant)}});
   end
 
   def publish_story_of_restaurant(p_bundle_id, p_facebook_session, p_restaurant)
-    image_attachements = {}
+    images = []
     if p_restaurant.images &amp;&amp; !p_restaurant.images.empty?
-      images = []
+      url_base = root_url[0..root_url.length - 2]
       p_restaurant.images.each do |image|
-        images &lt;&lt; {'src' =&gt; image.public_filename(:small),
-                   'href' =&gt; restaurant_url(p_restaurant.id)}
+        images &lt;&lt; {
+          :type =&gt; 'image',
+          :src =&gt; &quot;#{url_base}#{image.public_filename(:large)}&quot;,
+          :href =&gt; restaurant_url(p_restaurant)
+        }
       end
-      image_attachements[:images] = images
     end
 
-    p_facebook_session.publish_user_action(p_bundle_id, {
-        :restaurant_url =&gt; restaurant_url(p_restaurant.id),
-        :restaurant_name =&gt; p_restaurant.name,
-        :restaurants_url =&gt; root_url}.merge(image_attachements), nil, p_restaurant.description)
-
+    verb = 'added'
+    verb = 'updated' if p_bundle_id == RESTAURANT_UPDATED_TEMPLATE_BUNDLE_ID
+
+    user = p_facebook_session.user
+    FacebookerPublisher::deliver_publish_stream(
+        user, user, {
+        :attachment =&gt;  {
+          :name =&gt; &quot;#{verb} '#{p_restaurant.name}'&quot;,
+          :href =&gt; restaurant_url(p_restaurant),
+          :caption =&gt; &quot;Address: #{p_restaurant.address}&quot;,
+          :description =&gt; p_restaurant.description,
+          :media =&gt; images},
+        :action_links =&gt; {
+            'text' =&gt; 'add your review!',
+            'href' =&gt; restaurant_url(p_restaurant)}});
   end
 
   def build_facebook_session</diff>
      <filename>app/controllers/facebook_connect_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-&lt;script src=&quot;http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
+&lt;%= fb_connect_javascript_tag %&gt;
 
 &lt;script type=&quot;text/javascript&quot;&gt;
   App.Facebook = {
@@ -35,12 +35,6 @@
   }
 &lt;/script&gt;
 
-&lt;script type=&quot;text/javascript&quot;&gt;
-  FB.init(&quot;be437507fb7096f8faf2d9d9cda1607f&quot;, null, {
+&lt;%= init_fb_connect(:app_settings =&gt; &quot;{
     'ifUserConnected': App.Facebook.Events.onloggedin,
-    'ifUserNotConnected': App.Facebook.Events.onloggedout
-  });
-
-  // FB.ensureInit(function () {});
-
-&lt;/script&gt;
\ No newline at end of file
+    'ifUserNotConnected': App.Facebook.Events.onloggedout}&quot;) %&gt;
\ No newline at end of file</diff>
      <filename>app/views/users/parts/_facebook_app_script.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -9,8 +9,8 @@
 # This should only be necessary until the final version of the new profile is released.
 
 development:
-  api_key: be437507fb7096f8faf2d9d9cda1607f
-  secret_key: eaa491647bbea73cedf613c325299807 
+  api_key: 15b8a8040af0fe31fc46da4867ab6488
+  secret_key: 492ddee03156bcecd8f57c6f44de3ca9
   canvas_page_name:
   callback_url: http://servicedev1.net/
   pretty_errors: true</diff>
      <filename>config/facebooker.yml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f78acd65537fa15b934945abc9e5d9c6234e5b5e</id>
    </parent>
  </parents>
  <author>
    <name>nhm tanveer hossain khan (hasan)</name>
    <email>hasan@somewherein.net</email>
  </author>
  <url>http://github.com/we4tech/restaurant-review/commit/6a37082025506be97e2b0fccc3b1c2556ea01a61</url>
  <id>6a37082025506be97e2b0fccc3b1c2556ea01a61</id>
  <committed-date>2009-10-25T11:19:50-07:00</committed-date>
  <authored-date>2009-10-25T11:19:50-07:00</authored-date>
  <message>added publisher api</message>
  <tree>4528200a6a5f5a64dd99cbebb7967a4b4b52fd4f</tree>
  <committer>
    <name>nhm tanveer hossain khan (hasan)</name>
    <email>hasan@somewherein.net</email>
  </committer>
</commit>
