Does anyone know the deal with including images in the Short version of news feed stories? I did end up getting my FB Connect working with news feed submissions using the FeedDialog. The short story is the default in the dialog box, which is fine but I can''t for the life of me get an image in there. The Full story template has no problem. Facebook policy says that the short stories can be up to 100px high. Even when I just try a 50px square image I don''t see the image, just the text. - Adeel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20090303/97cb2d7c/attachment.html>
Stéphane Akkaoui
2009-Mar-04 00:15 UTC
[Facebooker-talk] images in Short news feeed stories
Hi, I had problems too with images in short feed. I find a turn around, but nothing to make a good patch, since it''s all crappy hard coding. The thing is that facebook waits for the json for image in feeds to be like : {"message":"blablabla", "images":[{"src":"http://base_url/ image.png/", "href":"http://base_url/controller/action"}]} Not the order of the parameters. In the image array, src has to come first, and href has to come last. It''s mandatory for the image feed to work. Now, in facebooker you can give your args in a hash, something like : def profil_feed(card, current_user, host) send_as :user_action from current_user.facebooker_user data({ :message => "blablabla", :images => [{:src => "http://base_url/image.png/", :href => "http://base _url/controller/action"}] }) end This is correct, if only the hash was keeping the order of its key/ value pairs. In the facebooker feed workflow, this hash will be converted into json, rendering something like : {"message":"blablabla", "images":[{"href":"http://base_url/controller/ action", "src":"http://base_url/image.png/"}]} And that fails to render a correct image feed in facebook. What I did was to call the feeds method by hand, without all the publisher ease of use. For instance, when I was needing this in the profile_publisher, I did : def render_publisher_response(user_action, card) response.content_type = Mime::JSON text = card.full_message(current_user).to_s.dup.gsub("\n \r","<br>").gsub("\r", "").gsub("\n", "<br />") render_for_text(''{"content": {"feed": {"template_id":'' + user_action.template_id.to_s + '', "template_data": {"message":"blablabla", "images":[{"src":"http://base_url/image.png/", "href":"http://base _url/controller/action"}] }, }, "method":"publisher_getFeedStory" }'') end I have not tested this under ruby 1.9, but it should be ok the old way, because in this new version of ruby, hashes keep the position of their key/value pairs. HTH, -- St?phane Akkaoui Le 3 mars 09 ? 19:02, Adeel Ahmad a ?crit :> Does anyone know the deal with including images in the Short version > of news feed stories? > I did end up getting my FB Connect working with news feed > submissions using the FeedDialog. The short story is the default in > the dialog box, which is fine but I can''t for the life of me get an > image in there. The Full story template has no problem. Facebook > policy says that the short stories can be up to 100px high. Even > when I just try a 50px square image I don''t see the image, just the > text. > > > - Adeel > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
Chris Johnson
2009-Mar-04 08:02 UTC
[Facebooker-talk] Calling "Users.getInfo" without a session key
Hi all. The API method Users.getInfo does not require a session key to be called. See here: http://wiki.developers.facebook.com/index.php/Users.getInfo I want to the current user''s name without creating a Facebooker session or having the user authorize my app. It''s late and I''m tired, so maybe I''m overlooking something obvious, but any guidance is appreciated! Cheers, Chris
Have you guys filed a bug on this with Facebook? That''s a bit of a pain for us to have to deal with. Mike On Mar 3, 2009, at 7:15 PM, St?phane Akkaoui wrote:> Hi, > > I had problems too with images in short feed. > I find a turn around, but nothing to make a good patch, since it''s > all crappy hard coding. > > The thing is that facebook waits for the json for image in feeds to > be like : > > {"message":"blablabla", "images":[{"src":"http://base_url/ > image.png/", "href":"http://base_url/controller/action"}]} > > Not the order of the parameters. In the image array, src has to come > first, and href has to come last. It''s mandatory for the image feed > to work. > > Now, in facebooker you can give your args in a hash, something like : > > def profil_feed(card, current_user, host) > send_as :user_action > from current_user.facebooker_user > data({ > :message => "blablabla", > :images => [{:src => "http://base_url/image.png/", :href => "http://base > _url/controller/action"}] > }) > end > > This is correct, if only the hash was keeping the order of its key/ > value pairs. In the facebooker feed workflow, this hash will be > converted into json, rendering something like : > > {"message":"blablabla", "images":[{"href":"http://base_url/ > controller/action", "src":"http://base_url/image.png/"}]} > > And that fails to render a correct image feed in facebook. > > What I did was to call the feeds method by hand, without all the > publisher ease of use. For instance, when I was needing this in the > profile_publisher, I did : > > def render_publisher_response(user_action, card) > response.content_type = Mime::JSON > > text = card.full_message(current_user).to_s.dup.gsub("\n > \r","<br>").gsub("\r", "").gsub("\n", "<br />") > > render_for_text(''{"content": > {"feed": > {"template_id":'' + user_action.template_id.to_s + '', > "template_data": > {"message":"blablabla", > "images":[{"src":"http://base_url/image.png/", "href":"http://base > _url/controller/action"}] > }, > }, > "method":"publisher_getFeedStory" }'') > end > > I have not tested this under ruby 1.9, but it should be ok the old > way, because in this new version of ruby, hashes keep the position > of their key/value pairs. > > HTH, > > -- > St?phane Akkaoui > > Le 3 mars 09 ? 19:02, Adeel Ahmad a ?crit : > >> Does anyone know the deal with including images in the Short >> version of news feed stories? >> I did end up getting my FB Connect working with news feed >> submissions using the FeedDialog. The short story is the default in >> the dialog box, which is fine but I can''t for the life of me get an >> image in there. The Full story template has no problem. Facebook >> policy says that the short stories can be up to 100px high. Even >> when I just try a 50px square image I don''t see the image, just the >> text. >> >> >> - Adeel >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Stéphane Akkaoui
2009-Mar-04 14:22 UTC
[Facebooker-talk] images in Short news feeed stories
No, I didn''t. But now, it''s done : http://bugs.developers.facebook.com/show_bug.cgi?id=4545 (hope that I correctly explain the probleme...) -- St?phane Akkaoui Le 4 mars 09 ? 13:16, Mike Mangino a ?crit :> Have you guys filed a bug on this with Facebook? That''s a bit of a > pain for us to have to deal with. > > Mike > > On Mar 3, 2009, at 7:15 PM, St?phane Akkaoui wrote: > >> Hi, >> >> I had problems too with images in short feed. >> I find a turn around, but nothing to make a good patch, since it''s >> all crappy hard coding. >> >> The thing is that facebook waits for the json for image in feeds to >> be like : >> >> {"message":"blablabla", "images":[{"src":"http://base_url/ >> image.png/", "href":"http://base_url/controller/action"}]} >> >> Not the order of the parameters. In the image array, src has to >> come first, and href has to come last. It''s mandatory for the image >> feed to work. >> >> Now, in facebooker you can give your args in a hash, something like : >> >> def profil_feed(card, current_user, host) >> send_as :user_action >> from current_user.facebooker_user >> data({ >> :message => "blablabla", >> :images => [{:src => "http://base_url/image.png/", :href => "http://base >> _url/controller/action"}] >> }) >> end >> >> This is correct, if only the hash was keeping the order of its key/ >> value pairs. In the facebooker feed workflow, this hash will be >> converted into json, rendering something like : >> >> {"message":"blablabla", "images":[{"href":"http://base_url/ >> controller/action", "src":"http://base_url/image.png/"}]} >> >> And that fails to render a correct image feed in facebook. >> >> What I did was to call the feeds method by hand, without all the >> publisher ease of use. For instance, when I was needing this in the >> profile_publisher, I did : >> >> def render_publisher_response(user_action, card) >> response.content_type = Mime::JSON >> >> text = card.full_message(current_user).to_s.dup.gsub("\n >> \r","<br>").gsub("\r", "").gsub("\n", "<br />") >> >> render_for_text(''{"content": >> {"feed": >> {"template_id":'' + user_action.template_id.to_s + '', >> "template_data": >> {"message":"blablabla", >> "images":[{"src":"http://base_url/image.png/", "href":"http://base >> _url/controller/action"}] >> }, >> }, >> "method":"publisher_getFeedStory" }'') >> end >> >> I have not tested this under ruby 1.9, but it should be ok the old >> way, because in this new version of ruby, hashes keep the position >> of their key/value pairs. >> >> HTH, >> >> -- >> St?phane Akkaoui >> >> Le 3 mars 09 ? 19:02, Adeel Ahmad a ?crit : >> >>> Does anyone know the deal with including images in the Short >>> version of news feed stories? >>> I did end up getting my FB Connect working with news feed >>> submissions using the FeedDialog. The short story is the default >>> in the dialog box, which is fine but I can''t for the life of me >>> get an image in there. The Full story template has no problem. >>> Facebook policy says that the short stories can be up to 100px >>> high. Even when I just try a 50px square image I don''t see the >>> image, just the text. >>> >>> >>> - Adeel >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > > >
I will do the same. Strength in numbers... - Adeel Sent from iPhone On Mar 4, 2009, at 6:22 AM, St?phane Akkaoui <stephane.akkaoui at imeuble.inf o> wrote:> No, I didn''t. But now, it''s done : > http://bugs.developers.facebook.com/show_bug.cgi?id=4545 (hope that > I correctly explain the probleme...) > > -- > St?phane Akkaoui > > > Le 4 mars 09 ? 13:16, Mike Mangino a ?crit : > >> Have you guys filed a bug on this with Facebook? That''s a bit of a >> pain for us to have to deal with. >> >> Mike >> >> On Mar 3, 2009, at 7:15 PM, St?phane Akkaoui wrote: >> >>> Hi, >>> >>> I had problems too with images in short feed. >>> I find a turn around, but nothing to make a good patch, since it''s >>> all crappy hard coding. >>> >>> The thing is that facebook waits for the json for image in feeds >>> to be like : >>> >>> {"message":"blablabla", "images":[{"src":"http://base_url/ >>> image.png/", "href":"http://base_url/controller/action"}]} >>> >>> Not the order of the parameters. In the image array, src has to >>> come first, and href has to come last. It''s mandatory for the >>> image feed to work. >>> >>> Now, in facebooker you can give your args in a hash, something >>> like : >>> >>> def profil_feed(card, current_user, host) >>> send_as :user_action >>> from current_user.facebooker_user >>> data({ >>> :message => "blablabla", >>> :images => [{:src => "http://base_url/ >>> image.png/", :href => "http://base_url/controller/action"}] >>> }) >>> end >>> >>> This is correct, if only the hash was keeping the order of its key/ >>> value pairs. In the facebooker feed workflow, this hash will be >>> converted into json, rendering something like : >>> >>> {"message":"blablabla", "images":[{"href":"http://base_url/ >>> controller/action", "src":"http://base_url/image.png/"}]} >>> >>> And that fails to render a correct image feed in facebook. >>> >>> What I did was to call the feeds method by hand, without all the >>> publisher ease of use. For instance, when I was needing this in >>> the profile_publisher, I did : >>> >>> def render_publisher_response(user_action, card) >>> response.content_type = Mime::JSON >>> >>> text = card.full_message(current_user).to_s.dup.gsub("\n >>> \r","<br>").gsub("\r", "").gsub("\n", "<br />") >>> >>> render_for_text(''{"content": >>> {"feed": >>> {"template_id":'' + user_action.template_id.to_s >>> + '', >>> "template_data": >>> {"message":"blablabla", >>> "images":[{"src":"http://base_url/ >>> image.png/", "href":"http://base_url/controller/action"}] >>> }, >>> }, >>> "method":"publisher_getFeedStory" }'') >>> end >>> >>> I have not tested this under ruby 1.9, but it should be ok the old >>> way, because in this new version of ruby, hashes keep the position >>> of their key/value pairs. >>> >>> HTH, >>> >>> -- >>> St?phane Akkaoui >>> >>> Le 3 mars 09 ? 19:02, Adeel Ahmad a ?crit : >>> >>>> Does anyone know the deal with including images in the Short >>>> version of news feed stories? >>>> I did end up getting my FB Connect working with news feed >>>> submissions using the FeedDialog. The short story is the default >>>> in the dialog box, which is fine but I can''t for the life of me >>>> get an image in there. The Full story template has no problem. >>>> Facebook policy says that the short stories can be up to 100px >>>> high. Even when I just try a 50px square image I don''t see the >>>> image, just the text. >>>> >>>> >>>> - Adeel >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>> >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> -- >> Mike Mangino >> http://www.elevatedrails.com >> >> >> >
Or: ------- mixonic at pandora ~/Projects/givereal $ script/console Loading development environment (Rails 2.1.2)>> h = ActiveSupport::OrderedHash.new=> []>>------- That''s in ActiveSupport, we could just use it in facebooker. Not so much of a pain... -- Matthew Beale :: 607 227 0871 Resume & Portfolio @ http://madhatted.com On Wed, 2009-03-04 at 06:24 -0800, Adeel Ahmad wrote:> I will do the same. Strength in numbers... > > > - Adeel > > Sent from iPhone > > > On Mar 4, 2009, at 6:22 AM, St?phane Akkaoui <stephane.akkaoui at imeuble.inf > o> wrote: > > > No, I didn''t. But now, it''s done : > > http://bugs.developers.facebook.com/show_bug.cgi?id=4545 (hope that > > I correctly explain the probleme...) > > > > -- > > St?phane Akkaoui > > > > > > Le 4 mars 09 ? 13:16, Mike Mangino a ?crit : > > > >> Have you guys filed a bug on this with Facebook? That''s a bit of a > >> pain for us to have to deal with. > >> > >> Mike > >> > >> On Mar 3, 2009, at 7:15 PM, St?phane Akkaoui wrote: > >> > >>> Hi, > >>> > >>> I had problems too with images in short feed. > >>> I find a turn around, but nothing to make a good patch, since it''s > >>> all crappy hard coding. > >>> > >>> The thing is that facebook waits for the json for image in feeds > >>> to be like : > >>> > >>> {"message":"blablabla", "images":[{"src":"http://base_url/ > >>> image.png/", "href":"http://base_url/controller/action"}]} > >>> > >>> Not the order of the parameters. In the image array, src has to > >>> come first, and href has to come last. It''s mandatory for the > >>> image feed to work. > >>> > >>> Now, in facebooker you can give your args in a hash, something > >>> like : > >>> > >>> def profil_feed(card, current_user, host) > >>> send_as :user_action > >>> from current_user.facebooker_user > >>> data({ > >>> :message => "blablabla", > >>> :images => [{:src => "http://base_url/ > >>> image.png/", :href => "http://base_url/controller/action"}] > >>> }) > >>> end > >>> > >>> This is correct, if only the hash was keeping the order of its key/ > >>> value pairs. In the facebooker feed workflow, this hash will be > >>> converted into json, rendering something like : > >>> > >>> {"message":"blablabla", "images":[{"href":"http://base_url/ > >>> controller/action", "src":"http://base_url/image.png/"}]} > >>> > >>> And that fails to render a correct image feed in facebook. > >>> > >>> What I did was to call the feeds method by hand, without all the > >>> publisher ease of use. For instance, when I was needing this in > >>> the profile_publisher, I did : > >>> > >>> def render_publisher_response(user_action, card) > >>> response.content_type = Mime::JSON > >>> > >>> text = card.full_message(current_user).to_s.dup.gsub("\n > >>> \r","<br>").gsub("\r", "").gsub("\n", "<br />") > >>> > >>> render_for_text(''{"content": > >>> {"feed": > >>> {"template_id":'' + user_action.template_id.to_s > >>> + '', > >>> "template_data": > >>> {"message":"blablabla", > >>> "images":[{"src":"http://base_url/ > >>> image.png/", "href":"http://base_url/controller/action"}] > >>> }, > >>> }, > >>> "method":"publisher_getFeedStory" }'') > >>> end > >>> > >>> I have not tested this under ruby 1.9, but it should be ok the old > >>> way, because in this new version of ruby, hashes keep the position > >>> of their key/value pairs. > >>> > >>> HTH, > >>> > >>> -- > >>> St?phane Akkaoui > >>> > >>> Le 3 mars 09 ? 19:02, Adeel Ahmad a ?crit : > >>> > >>>> Does anyone know the deal with including images in the Short > >>>> version of news feed stories? > >>>> I did end up getting my FB Connect working with news feed > >>>> submissions using the FeedDialog. The short story is the default > >>>> in the dialog box, which is fine but I can''t for the life of me > >>>> get an image in there. The Full story template has no problem. > >>>> Facebook policy says that the short stories can be up to 100px > >>>> high. Even when I just try a 50px square image I don''t see the > >>>> image, just the text. > >>>> > >>>> > >>>> - Adeel > >>>> _______________________________________________ > >>>> Facebooker-talk mailing list > >>>> Facebooker-talk at rubyforge.org > >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk > >>> > >>> _______________________________________________ > >>> Facebooker-talk mailing list > >>> Facebooker-talk at rubyforge.org > >>> http://rubyforge.org/mailman/listinfo/facebooker-talk > >> > >> -- > >> Mike Mangino > >> http://www.elevatedrails.com > >> > >> > >> > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
On Mar 4, 2009, at 9:38 AM, Matthew Beale wrote:> Or: > > ------- > mixonic at pandora ~/Projects/givereal $ script/console > Loading development environment (Rails 2.1.2) >>> h = ActiveSupport::OrderedHash.new > => [] >>> > ------- > > That''s in ActiveSupport, we could just use it in facebooker. Not so > much of a pain...Only it doesn''t output JSON correctly I just wrapped this in a class which should handle things. If Facebook fixes the bug, we can remove that class. Mike -- Mike Mangino http://www.elevatedrails.com
Hmmm, we''re still having problems publishing images in short stories. Has anyone been successful with the new commit? There is a facebook engineer working on it already on bugzilla. Hope they can take care of it. - Adeel On Wed, Mar 4, 2009 at 9:37 AM, Mike Mangino <mmangino at elevatedrails.com>wrote:> > On Mar 4, 2009, at 9:38 AM, Matthew Beale wrote: > > Or: >> >> ------- >> mixonic at pandora ~/Projects/givereal $ script/console >> Loading development environment (Rails 2.1.2) >> >>> h = ActiveSupport::OrderedHash.new >>>> >>> => [] >> >>> >>>> ------- >> >> That''s in ActiveSupport, we could just use it in facebooker. Not so >> much of a pain... >> > > Only it doesn''t output JSON correctly > > I just wrapped this in a class which should handle things. If Facebook > fixes the bug, we can remove that class. > > Mike > > > -- > Mike Mangino > http://www.elevatedrails.com > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20090305/63a089b9/attachment.html>