I''ve added support for the new message templates. Check out the documentation (http://facebooker.rubyforge.org/ and http://facebooker.rubyforge.org/classes/Facebooker/Rails/Publisher.html in particular) If you''ve already created a publisher, you will need to re-run the script/generate command to create a new migration. By default, Facebooker will now keep track of your template ids. To send a message using the new API, you''ll need to create two methods. The first returns the templates. For example: class MyPublisher < Facebooker::Rails::Publisher def publish_action_template one_line_story_template "{*actor*} did stuff with {*friend*}" one_line_story_template "{*actor*} did stuff" short_story_template "{*actor*} has a title {*friend*}", render(:partial=>"short_body") short_story_template "{*actor*} has a title", render(:partial=>"short_body") full_story_template "{*actor*} has a title {*friend*}", render(:partial=>"full_body") end The name of the method needs to end in _template. To register this template, you can call MyPublisher.register_publish_action or, to register all templates in a publisher, you can call MyPublisher.register_all_templates Facebooker will store the template id and the template name in the facebook_templates table. To send a message from a stored template, you''ll need to create another method that registers the data: def publish_action(f) from f data :friend=>"Mike" end Then, you can call MyPublisher.deliver_publish_action Facebooker will look up the template id automatically. Let me know if you have any issues with this. Mike -- Mike Mangino http://www.elevatedrails.com
FYI, I couldn''t get the migration to generate. I went into publisher_generator.rb and commented out the unless (and end) line because it wasn''t getting in there, even though I didn''t have the migration already. Then it worked. On Tue, Jul 15, 2008 at 9:54 AM, Mike Mangino <mmangino at elevatedrails.com> wrote:> I''ve added support for the new message templates. Check out the > documentation (http://facebooker.rubyforge.org/ and > http://facebooker.rubyforge.org/classes/Facebooker/Rails/Publisher.html in > particular) > > If you''ve already created a publisher, you will need to re-run the > script/generate command to create a new migration. By default, Facebooker > will now keep track of your template ids. To send a message using the new > API, you''ll need to create two methods. The first returns the templates. For > example: > > class MyPublisher < Facebooker::Rails::Publisher > def publish_action_template > one_line_story_template "{*actor*} did stuff with {*friend*}" > one_line_story_template "{*actor*} did stuff" > short_story_template "{*actor*} has a title {*friend*}", > render(:partial=>"short_body") > short_story_template "{*actor*} has a title", > render(:partial=>"short_body") > full_story_template "{*actor*} has a title {*friend*}", > render(:partial=>"full_body") > end > > The name of the method needs to end in _template. > > To register this template, you can call > > MyPublisher.register_publish_action > > or, to register all templates in a publisher, you can call > > MyPublisher.register_all_templates > > > Facebooker will store the template id and the template name in the > facebook_templates table. > > To send a message from a stored template, you''ll need to create another > method that registers the data: > > def publish_action(f) > from f > data :friend=>"Mike" > end > > Then, you can call > MyPublisher.deliver_publish_action > > Facebooker will look up the template id automatically. > > Let me know if you have any issues with this. > > Mike > -- > Mike Mangino > http://www.elevatedrails.com > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-- Christopher Redinger http://www.agiledisciple.com
Same thing happened to me, btw. Dave On Tue, Jul 15, 2008 at 11:02 AM, Christopher Redinger <redinger at gmail.com> wrote:> FYI, I couldn''t get the migration to generate. I went into > publisher_generator.rb and commented out the unless (and end) line > because it wasn''t getting in there, even though I didn''t have the > migration already. Then it worked. > > On Tue, Jul 15, 2008 at 9:54 AM, Mike Mangino > <mmangino at elevatedrails.com> wrote: > > I''ve added support for the new message templates. Check out the > > documentation (http://facebooker.rubyforge.org/ and > > http://facebooker.rubyforge.org/classes/Facebooker/Rails/Publisher.htmlin > > particular) > > > > If you''ve already created a publisher, you will need to re-run the > > script/generate command to create a new migration. By default, Facebooker > > will now keep track of your template ids. To send a message using the new > > API, you''ll need to create two methods. The first returns the templates. > For > > example: > > > > class MyPublisher < Facebooker::Rails::Publisher > > def publish_action_template > > one_line_story_template "{*actor*} did stuff with {*friend*}" > > one_line_story_template "{*actor*} did stuff" > > short_story_template "{*actor*} has a title {*friend*}", > > render(:partial=>"short_body") > > short_story_template "{*actor*} has a title", > > render(:partial=>"short_body") > > full_story_template "{*actor*} has a title {*friend*}", > > render(:partial=>"full_body") > > end > > > > The name of the method needs to end in _template. > > > > To register this template, you can call > > > > MyPublisher.register_publish_action > > > > or, to register all templates in a publisher, you can call > > > > MyPublisher.register_all_templates > > > > > > Facebooker will store the template id and the template name in the > > facebook_templates table. > > > > To send a message from a stored template, you''ll need to create another > > method that registers the data: > > > > def publish_action(f) > > from f > > data :friend=>"Mike" > > end > > > > Then, you can call > > MyPublisher.deliver_publish_action > > > > Facebooker will look up the template id automatically. > > > > Let me know if you have any issues with this. > > > > Mike > > -- > > Mike Mangino > > http://www.elevatedrails.com > > > > > > > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > -- > Christopher Redinger > http://www.agiledisciple.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080715/8c54ee43/attachment.html>
And then I had to rename the migration class to CreateFacebookTemplates. It was CreateFacebookTemplateRegistries, but the filename was create_facebook_templates. On Tue, Jul 15, 2008 at 1:16 PM, David Clements <digidigo at gmail.com> wrote:> Same thing happened to me, btw. > > Dave > > > On Tue, Jul 15, 2008 at 11:02 AM, Christopher Redinger <redinger at gmail.com> > wrote: >> >> FYI, I couldn''t get the migration to generate. I went into >> publisher_generator.rb and commented out the unless (and end) line >> because it wasn''t getting in there, even though I didn''t have the >> migration already. Then it worked. >> >> On Tue, Jul 15, 2008 at 9:54 AM, Mike Mangino >> <mmangino at elevatedrails.com> wrote: >> > I''ve added support for the new message templates. Check out the >> > documentation (http://facebooker.rubyforge.org/ and >> > http://facebooker.rubyforge.org/classes/Facebooker/Rails/Publisher.html >> > in >> > particular) >> > >> > If you''ve already created a publisher, you will need to re-run the >> > script/generate command to create a new migration. By default, >> > Facebooker >> > will now keep track of your template ids. To send a message using the >> > new >> > API, you''ll need to create two methods. The first returns the templates. >> > For >> > example: >> > >> > class MyPublisher < Facebooker::Rails::Publisher >> > def publish_action_template >> > one_line_story_template "{*actor*} did stuff with {*friend*}" >> > one_line_story_template "{*actor*} did stuff" >> > short_story_template "{*actor*} has a title {*friend*}", >> > render(:partial=>"short_body") >> > short_story_template "{*actor*} has a title", >> > render(:partial=>"short_body") >> > full_story_template "{*actor*} has a title {*friend*}", >> > render(:partial=>"full_body") >> > end >> > >> > The name of the method needs to end in _template. >> > >> > To register this template, you can call >> > >> > MyPublisher.register_publish_action >> > >> > or, to register all templates in a publisher, you can call >> > >> > MyPublisher.register_all_templates >> > >> > >> > Facebooker will store the template id and the template name in the >> > facebook_templates table. >> > >> > To send a message from a stored template, you''ll need to create another >> > method that registers the data: >> > >> > def publish_action(f) >> > from f >> > data :friend=>"Mike" >> > end >> > >> > Then, you can call >> > MyPublisher.deliver_publish_action >> > >> > Facebooker will look up the template id automatically. >> > >> > Let me know if you have any issues with this. >> > >> > Mike >> > -- >> > Mike Mangino >> > http://www.elevatedrails.com >> > >> > >> > >> > _______________________________________________ >> > Facebooker-talk mailing list >> > Facebooker-talk at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/facebooker-talk >> > >> >> >> >> -- >> Christopher Redinger >> http://www.agiledisciple.com >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > >-- Christopher Redinger http://www.agiledisciple.com
Wow, that was really buggy. What Rails version are you using? I''ll try to commit fixes today. Mike On Jul 15, 2008, at 1:27 PM, Christopher Redinger wrote:> And then I had to rename the migration class to > CreateFacebookTemplates. It was CreateFacebookTemplateRegistries, but > the filename was create_facebook_templates. > > On Tue, Jul 15, 2008 at 1:16 PM, David Clements <digidigo at gmail.com> > wrote: >> Same thing happened to me, btw. >> >> Dave >> >> >> On Tue, Jul 15, 2008 at 11:02 AM, Christopher Redinger <redinger at gmail.com >> > >> wrote: >>> >>> FYI, I couldn''t get the migration to generate. I went into >>> publisher_generator.rb and commented out the unless (and end) line >>> because it wasn''t getting in there, even though I didn''t have the >>> migration already. Then it worked. >>> >>> On Tue, Jul 15, 2008 at 9:54 AM, Mike Mangino >>> <mmangino at elevatedrails.com> wrote: >>>> I''ve added support for the new message templates. Check out the >>>> documentation (http://facebooker.rubyforge.org/ and >>>> http://facebooker.rubyforge.org/classes/Facebooker/Rails/Publisher.html >>>> in >>>> particular) >>>> >>>> If you''ve already created a publisher, you will need to re-run the >>>> script/generate command to create a new migration. By default, >>>> Facebooker >>>> will now keep track of your template ids. To send a message using >>>> the >>>> new >>>> API, you''ll need to create two methods. The first returns the >>>> templates. >>>> For >>>> example: >>>> >>>> class MyPublisher < Facebooker::Rails::Publisher >>>> def publish_action_template >>>> one_line_story_template "{*actor*} did stuff with {*friend*}" >>>> one_line_story_template "{*actor*} did stuff" >>>> short_story_template "{*actor*} has a title {*friend*}", >>>> render(:partial=>"short_body") >>>> short_story_template "{*actor*} has a title", >>>> render(:partial=>"short_body") >>>> full_story_template "{*actor*} has a title {*friend*}", >>>> render(:partial=>"full_body") >>>> end >>>> >>>> The name of the method needs to end in _template. >>>> >>>> To register this template, you can call >>>> >>>> MyPublisher.register_publish_action >>>> >>>> or, to register all templates in a publisher, you can call >>>> >>>> MyPublisher.register_all_templates >>>> >>>> >>>> Facebooker will store the template id and the template name in the >>>> facebook_templates table. >>>> >>>> To send a message from a stored template, you''ll need to create >>>> another >>>> method that registers the data: >>>> >>>> def publish_action(f) >>>> from f >>>> data :friend=>"Mike" >>>> end >>>> >>>> Then, you can call >>>> MyPublisher.deliver_publish_action >>>> >>>> Facebooker will look up the template id automatically. >>>> >>>> Let me know if you have any issues with this. >>>> >>>> Mike >>>> -- >>>> Mike Mangino >>>> http://www.elevatedrails.com >>>> >>>> >>>> >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>> >>> >>> >>> -- >>> Christopher Redinger >>> http://www.agiledisciple.com >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> > > > > -- > Christopher Redinger > http://www.agiledisciple.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
I am on rails 2.0.... dave On Tue, Jul 15, 2008 at 11:46 AM, Mike Mangino <mmangino at elevatedrails.com> wrote:> Wow, that was really buggy. What Rails version are you using? I''ll try to > commit fixes today. > > Mike > > > On Jul 15, 2008, at 1:27 PM, Christopher Redinger wrote: > > And then I had to rename the migration class to >> CreateFacebookTemplates. It was CreateFacebookTemplateRegistries, but >> the filename was create_facebook_templates. >> >> On Tue, Jul 15, 2008 at 1:16 PM, David Clements <digidigo at gmail.com> >> wrote: >> >>> Same thing happened to me, btw. >>> >>> Dave >>> >>> >>> On Tue, Jul 15, 2008 at 11:02 AM, Christopher Redinger < >>> redinger at gmail.com> >>> wrote: >>> >>>> >>>> FYI, I couldn''t get the migration to generate. I went into >>>> publisher_generator.rb and commented out the unless (and end) line >>>> because it wasn''t getting in there, even though I didn''t have the >>>> migration already. Then it worked. >>>> >>>> On Tue, Jul 15, 2008 at 9:54 AM, Mike Mangino >>>> <mmangino at elevatedrails.com> wrote: >>>> >>>>> I''ve added support for the new message templates. Check out the >>>>> documentation (http://facebooker.rubyforge.org/ and >>>>> http://facebooker.rubyforge.org/classes/Facebooker/Rails/Publisher.html >>>>> in >>>>> particular) >>>>> >>>>> If you''ve already created a publisher, you will need to re-run the >>>>> script/generate command to create a new migration. By default, >>>>> Facebooker >>>>> will now keep track of your template ids. To send a message using the >>>>> new >>>>> API, you''ll need to create two methods. The first returns the >>>>> templates. >>>>> For >>>>> example: >>>>> >>>>> class MyPublisher < Facebooker::Rails::Publisher >>>>> def publish_action_template >>>>> one_line_story_template "{*actor*} did stuff with {*friend*}" >>>>> one_line_story_template "{*actor*} did stuff" >>>>> short_story_template "{*actor*} has a title {*friend*}", >>>>> render(:partial=>"short_body") >>>>> short_story_template "{*actor*} has a title", >>>>> render(:partial=>"short_body") >>>>> full_story_template "{*actor*} has a title {*friend*}", >>>>> render(:partial=>"full_body") >>>>> end >>>>> >>>>> The name of the method needs to end in _template. >>>>> >>>>> To register this template, you can call >>>>> >>>>> MyPublisher.register_publish_action >>>>> >>>>> or, to register all templates in a publisher, you can call >>>>> >>>>> MyPublisher.register_all_templates >>>>> >>>>> >>>>> Facebooker will store the template id and the template name in the >>>>> facebook_templates table. >>>>> >>>>> To send a message from a stored template, you''ll need to create another >>>>> method that registers the data: >>>>> >>>>> def publish_action(f) >>>>> from f >>>>> data :friend=>"Mike" >>>>> end >>>>> >>>>> Then, you can call >>>>> MyPublisher.deliver_publish_action >>>>> >>>>> Facebooker will look up the template id automatically. >>>>> >>>>> Let me know if you have any issues with this. >>>>> >>>>> Mike >>>>> -- >>>>> Mike Mangino >>>>> http://www.elevatedrails.com >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Facebooker-talk mailing list >>>>> Facebooker-talk at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>>> >>>>> >>>> >>>> >>>> -- >>>> Christopher Redinger >>>> http://www.agiledisciple.com >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>> >>> >>> >> >> >> -- >> Christopher Redinger >> http://www.agiledisciple.com >> _______________________________________________ >> 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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080715/f2ccdd5c/attachment.html>
2.1 On Tue, Jul 15, 2008 at 1:48 PM, David Clements <digidigo at gmail.com> wrote:> I am on rails 2.0.... > > dave > > > On Tue, Jul 15, 2008 at 11:46 AM, Mike Mangino <mmangino at elevatedrails.com> > wrote: >> >> Wow, that was really buggy. What Rails version are you using? I''ll try to >> commit fixes today. >> >> Mike >> >> On Jul 15, 2008, at 1:27 PM, Christopher Redinger wrote: >> >>> And then I had to rename the migration class to >>> CreateFacebookTemplates. It was CreateFacebookTemplateRegistries, but >>> the filename was create_facebook_templates. >>> >>> On Tue, Jul 15, 2008 at 1:16 PM, David Clements <digidigo at gmail.com> >>> wrote: >>>> >>>> Same thing happened to me, btw. >>>> >>>> Dave >>>> >>>> >>>> On Tue, Jul 15, 2008 at 11:02 AM, Christopher Redinger >>>> <redinger at gmail.com> >>>> wrote: >>>>> >>>>> FYI, I couldn''t get the migration to generate. I went into >>>>> publisher_generator.rb and commented out the unless (and end) line >>>>> because it wasn''t getting in there, even though I didn''t have the >>>>> migration already. Then it worked. >>>>> >>>>> On Tue, Jul 15, 2008 at 9:54 AM, Mike Mangino >>>>> <mmangino at elevatedrails.com> wrote: >>>>>> >>>>>> I''ve added support for the new message templates. Check out the >>>>>> documentation (http://facebooker.rubyforge.org/ and >>>>>> >>>>>> http://facebooker.rubyforge.org/classes/Facebooker/Rails/Publisher.html >>>>>> in >>>>>> particular) >>>>>> >>>>>> If you''ve already created a publisher, you will need to re-run the >>>>>> script/generate command to create a new migration. By default, >>>>>> Facebooker >>>>>> will now keep track of your template ids. To send a message using the >>>>>> new >>>>>> API, you''ll need to create two methods. The first returns the >>>>>> templates. >>>>>> For >>>>>> example: >>>>>> >>>>>> class MyPublisher < Facebooker::Rails::Publisher >>>>>> def publish_action_template >>>>>> one_line_story_template "{*actor*} did stuff with {*friend*}" >>>>>> one_line_story_template "{*actor*} did stuff" >>>>>> short_story_template "{*actor*} has a title {*friend*}", >>>>>> render(:partial=>"short_body") >>>>>> short_story_template "{*actor*} has a title", >>>>>> render(:partial=>"short_body") >>>>>> full_story_template "{*actor*} has a title {*friend*}", >>>>>> render(:partial=>"full_body") >>>>>> end >>>>>> >>>>>> The name of the method needs to end in _template. >>>>>> >>>>>> To register this template, you can call >>>>>> >>>>>> MyPublisher.register_publish_action >>>>>> >>>>>> or, to register all templates in a publisher, you can call >>>>>> >>>>>> MyPublisher.register_all_templates >>>>>> >>>>>> >>>>>> Facebooker will store the template id and the template name in the >>>>>> facebook_templates table. >>>>>> >>>>>> To send a message from a stored template, you''ll need to create >>>>>> another >>>>>> method that registers the data: >>>>>> >>>>>> def publish_action(f) >>>>>> from f >>>>>> data :friend=>"Mike" >>>>>> end >>>>>> >>>>>> Then, you can call >>>>>> MyPublisher.deliver_publish_action >>>>>> >>>>>> Facebooker will look up the template id automatically. >>>>>> >>>>>> Let me know if you have any issues with this. >>>>>> >>>>>> Mike >>>>>> -- >>>>>> Mike Mangino >>>>>> http://www.elevatedrails.com >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Facebooker-talk mailing list >>>>>> Facebooker-talk at rubyforge.org >>>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Christopher Redinger >>>>> http://www.agiledisciple.com >>>>> _______________________________________________ >>>>> Facebooker-talk mailing list >>>>> Facebooker-talk at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>>> >>> >>> >>> >>> -- >>> Christopher Redinger >>> http://www.agiledisciple.com >>> _______________________________________________ >>> 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 > >-- Christopher Redinger http://www.agiledisciple.com
Can you guys try this again? For some reason the built-in helper didn''t work. I re-implemented that. Mike On Jul 15, 2008, at 2:15 PM, Christopher Redinger wrote:> 2.1-- Mike Mangino http://www.elevatedrails.com
Works now. Thanks Mike. On Tue, Jul 15, 2008 at 5:59 PM, Mike Mangino <mmangino at elevatedrails.com> wrote:> Can you guys try this again? For some reason the built-in helper didn''t > work. I re-implemented that. > > Mike > > On Jul 15, 2008, at 2:15 PM, Christopher Redinger wrote: > >> 2.1 > > -- > Mike Mangino > http://www.elevatedrails.com > > > >-- Christopher Redinger http://www.agiledisciple.com
Hi! What migration are you talking about? How to generate it? I don''t see anything about it on the Publisher''s Rdoc... Thanks ;) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080730/f37782f6/attachment.html>
You need to regenerate a facebook publisher file. The generator checks to see if you''ve already performed the necessary migration and, if not, generates a new migration for you. So, assuming you already have your publishers set up and just need the migration, do this: ./script/generate publisher Something it will then generate a new facebook publisher in app/models called something_publisher.rb. You can safely delete that. It should have also created a new migration for you. That''s the one he''s referring to. :-) -Joel On Jul 30, 2008, at 10:58 AM, Aur?lien Malisart wrote:> Hi! > > What migration are you talking about? How to generate it? > I don''t see anything about it on the Publisher''s Rdoc... > > Thanks ;) > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
Thanks ;) On Wed, Jul 30, 2008 at 8:36 PM, Joel Watson <joel at i5labs.com> wrote:> You need to regenerate a facebook publisher file. The generator checks to > see if you''ve already performed the necessary migration and, if not, > generates a new migration for you. So, assuming you already have your > publishers set up and just need the migration, do this: > > ./script/generate publisher Something > > it will then generate a new facebook publisher in app/models called > something_publisher.rb. You can safely delete that. It should have also > created a new migration for you. That''s the one he''s referring to. :-) > > -Joel > > > On Jul 30, 2008, at 10:58 AM, Aur?lien Malisart wrote: > > Hi! >> >> What migration are you talking about? How to generate it? >> I don''t see anything about it on the Publisher''s Rdoc... >> >> Thanks ;) >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> > >-- Aur?lien Malisart aurelien.malisart at gmail.com http://malisart.be/aurelien -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080730/9eea29bb/attachment-0001.html>
Perhaps the problem I''m running into has to do with using the old action profile. Do I have to use this new way of publishing, or can I use the older way? On Jul 15, 2008, at 6:54 AM, Mike Mangino wrote:> I''ve added support for the new message templates. Check out the > documentation (http://facebooker.rubyforge.org/ and http://facebooker.rubyforge.org/classes/Facebooker/Rails/Publisher.html > in particular) > > If you''ve already created a publisher, you will need to re-run the > script/generate command to create a new migration. By default, > Facebooker will now keep track of your template ids. To send a > message using the new API, you''ll need to create two methods. The > first returns the templates. For example: > > class MyPublisher < Facebooker::Rails::Publisher > def publish_action_template > one_line_story_template "{*actor*} did stuff with {*friend*}" > one_line_story_template "{*actor*} did stuff" > short_story_template "{*actor*} has a title {*friend*}", > render(:partial=>"short_body") > short_story_template "{*actor*} has a title", > render(:partial=>"short_body") > full_story_template "{*actor*} has a title {*friend*}", > render(:partial=>"full_body") > end > > The name of the method needs to end in _template. > > To register this template, you can call > > MyPublisher.register_publish_action > > or, to register all templates in a publisher, you can call > > MyPublisher.register_all_templates > > > Facebooker will store the template id and the template name in the > facebook_templates table. > > To send a message from a stored template, you''ll need to create > another method that registers the data: > > def publish_action(f) > from f > data :friend=>"Mike" > end > > Then, you can call > MyPublisher.deliver_publish_action > > Facebooker will look up the template id automatically. > > Let me know if you have any issues with this. > > Mike > -- > Mike Mangino > http://www.elevatedrails.com > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk