Folks,
I am trying this logic to send stream.publish ->
def ask_for_recommendation
params[:message] ="#{
current_user.name} is looking for #{params
[:id]}
on HotelsBlah. #{
current_user.name} is unsure
and needs
your help. Will you help #{
current_user.name} by
rating #{params[:id]}?"
links = Hash.new()
links["text"] = "Recommend hotels in #{params[:id]} on
HotelsBlah.com"
links["href"] = "
http://www.hotelsblah.com"
params[:action_links] = links
attach = Hash.new()
attach["name"] = "Hotel name"
attach["href"] = "
http://www.hotelsblah.com"
attach["caption"] = "HotelsBlah.com"
attach["description"] = "Hotel description"
media_attach = Hash.new()
media_attach["type"] = "image"
media_attach["src"] = "
http://image.hotelsblah.com/hotels/
10776_6_390_0_1.jpg"
media_attach["href"] = "
http://www.hotelsblah.com#{params
[:ref_uri]}"
attach["media"] = media_attach
params[:attachment] = attach
FbPublisher.deliver_publish_stream(facebook_session.user,
facebook_session.user, params)
flash[:notice] = "Your request has been sent to the friends who
are also using HotelsBlah."
redirect_to params[:ref_uri]
end
I am getting the following error ->
Processing MessagingController#ask_for_recommendation (for
76.104.161.13 at 2009-10-12 00:47:07) [GET]
Parameters: {"ref_uri"=>"/hotels/united-states/california/san-
francisco", "id"=>"San Francisco Hotels"}
facebook.friends.getAppUsers (0.24001407623291)
facebook.stream.publish (0)
Facebooker::Session::MissingOrInvalidParameter: type 'h' is not
allowed: target_id = 100000335871919, uid = 100000335871919,
action_links = [{"href": "
http://www.hotelsoutlook.com", "text":
"Recommend hotels in San Francisco Hotels on HotelsOutlook.com"}],
message = Rajat Garg is looking for San Francisco Hotels
on HotelsOutlook. Rajat Garg is unsure and needs
your help. Will you help Rajat Garg by rating
San Francisco Hotels?, attachment = {"name": "Hotel name", "href":
"
http://www.hotelsoutlook.com", "media": {"href": "http://
www.hotelsoutlook.com/hotels/united-states/california/san-francisco",
"type": "image", "src": "
http://image.gtahotels.com/hotels/
10776_6_390_0_1.jpg"}, "caption": "HotelsOutlook.com", "description":
"Hotel description"}
What am I missing? Any pointers will be greatly appreciated.
Thx.