That was pretty close. Here is the method in user.rb:
##
# Set the status of the user
#
# DOES NOT prepend "is" to the message
#
# requires extended permission.
def status=(message)
case message
when String
session
.post
(''facebook.users.setStatus'',:status=>message,:status_includes_verb=>1)
do |ret|
ret
end
when Status
@status = message
when Hash
@status = Status.from_hash(message)
end
end
Basically, we need to handle both setting the status with a string as
well as with a Hash. The Hash setter is used to populate the data from
Facebook.
I added that code as well as some tests. To make status updates work,
it requires your application to have some extended permissions. I
added code for that as well. Now, in your controller you can do
something like:
before_filter :ensure_has_status_update
That will request permission to update status if it doesn''t exist. You
can tell Facebook where to redirect by re-defining the
application_needs_permission method to look something like:
def application_needs_permission(perm)
redirect_to(facebook_session.permission_url(perm,:next=>"http://apps.facebook.com/mangino''+request.request_uri))
end
Mike
On May 9, 2008, at 3:55 PM, Travis Jeffery wrote:
> Yeah they do the method is facebook.users.setStatus
(http://developers.facebook.com/documentation.php?v=1.0&method=users.setStatus
> )
>
> So to add support for it in would it be something like:
>
> ##
> # Update Facbook Status
> def update_status
> @status = post(''facebook.users.setStatus''. :string
=>
> params[:status])
> end
>
> In /lib/facebooker/user.rb? I''m not gonna lie, I have no clue on
> what to do for this kind of thing.
>
> Thanks
>
> On May 7, 2008, at 8:25 PM, Toby Hede wrote:
>> I don''t think Facebook actually provides that functionality.
>>
>>
>>
>> On Wed, May 7, 2008 at 8:28 PM, Travis Jeffery <eatsleepgolf at
gmail.com
>> > wrote:
>>> Does anyone know how to update a Facebook Status with Facebooker?
>>> _______________________________________________
>>> 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
>
> _______________________________________________
> Facebooker-talk mailing list
> Facebooker-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/facebooker-talk
--
Mike Mangino
http://www.elevatedrails.com