Audio file share on Facebook using my app - ruby-on-rails

Am also having some problem with sharing audio/video,
I tried this code block to share audio file.
me = FbGraph::User.me(ACCESS_TOKEN)
me.feed!(
:message => 'Updating via FbGraph',
:source => 'http://s3.amazonaws.com/derbywire_development/system/audios/21/original/ROJA.mp3?1376993284',
:description => 'A Ruby wrapper for Facebook Graph API',
:name => 'FbGraph',
:type => 'mp3'
)
Its sharing the post the but the player is not coming for me. its simply showing the link.
Can anyone help me out this problem?

Related

How do I use multiple filters with the auto_html gem?

I'm using the auto_html Ruby gem for my Rails application to handle embedded links in a content field. I was originally using the standard <%= #object.content_html %> method which works fine. However, this doesn't support the extra filters that may be needed. For example, it handles youtube links and image links, but not Soundcloud links. In order to handle Soundcloud links, I had to change the code to <%= auto_html(#object.content) {soundcloud} %> as mentioned in a SO question Auto_html says block not supplied
However, this only now supports Soundcloud and it doesn't support the other filters (Youtube, images, links, etc). How can I support all of them, including soundcloud? Adding soundcloud to the object's model doesn't work:
auto_html_for :content do
html_escape
image
youtube(:width => 400, :height => 250, :autoplay => false)
link :target => "_blank", :rel => "nofollow"
soundcloud
simple_format
end
The problem was that I placed soundcloud after the link filter, so the application was rendering the soundcloud link as a normal link. Here's the final model:
auto_html_for :description do
html_escape
image
youtube(:width => 400, :height => 250, :autoplay => false)
soundcloud
link :target => "_blank", :rel => "nofollow"
simple_format
end

Facebook video/audio share?

Am also having some problem with sharing audio/video,
I tried this code block to share audio file.
me = FbGraph::User.me(ACCESS_TOKEN)
me.feed!(
:message => 'Updating via FbGraph',
:source => 'http://s3.amazonaws.com/derbywire_development/system/audios/21/original/ROJA.mp3?1376993284',
:description => 'A Ruby wrapper for Facebook Graph API',
:name => 'FbGraph',
:type => 'mp3'
)
Its sharing the post the but the player is not coming for me. its simply showing the link.
Can any one help me out from this? Thanks in advance.

FBGraph message containing embedded link text in ruby on rails?

I am new in FBGraph and ruby.
I am using FBGraph api for facebook and the following code for posting.
me = FbGraph::User.me(ACCESS_TOKEN)
me.feed!(
:message => 'Updating via FbGraph',
)
Its working fine for me.
I want to post a message containing an html tag Text
Please advice.
Thanks in Advance
You would add the following to me.feed! (I added some others just for good measure):
me.feed!(
:message => 'Updating via FbGraph',
:name => 'Update',
:link => 'http://www.somelink.com/',
:description => 'My description'
)

An invalid merchant configuration in Paypal with rails

I am making the paypal application with rails.
I have create all the necessary a/c in http://develpers.paypal.com and also have insert all that information in my rails app.
My problem is when i am trying to authorize my seller a/c, it gives me error like
"Failure: This transaction cannot be processed due to an invalid merchant configuration."
My code is:
# all inforation is of seller API id, password, signature
gateway = ActiveMerchant::Billing::PaypalGateway.new(
:login => "seller_1302505219_biz_api1.gmail.com",
:password => "...",
:signature => "..."
)
options = {
:ip => request.remote_ip,
:billing_address => {
:name => "Name",
:address1 => '1 Main St',
:address2 => '',
:city => 'San Jose',
:state => 'CA',
:country => 'US',
:zip => '95131',
# :phone => '408-983-5678'
:phone => '408-678-0945'
}
}
res = gateway.authorize(amount, credit_card, options)
You need to have a seller account set up with Website Payments Pro.
Create your selling test account using the Preconfigured option.
Under Account Type, select Website Payments Pro.
Good luck!
Got the solution.
I have google it but got the information about the "Billing agreement".
But that functionality is provided in Website Payment Pro.
so I have just create an test account using WPP and use that WPP account credential for transaction.
It works fine.
Cheers!!!
In addition, your account may or may not be enabled for Pro (DoDirectPayment) even after signing up for it in Sandbox. There's a thread on the x.com forums where you can ask one of the support guys to enable it for you.

Ruby on Rails / Yellow Maps For Ruby Plugin woes

Okay I've read through the plugin comments and the docs as well and I have yet to come up with an answer as to how to do this. Here's my problem I want to use the :info_window_tabs and the :icon option, but I don't know what format to pass my information in. According to the documentation the following code should be correct. Here's my code:
#mapper.overlay_init(GMarker.new([map.lat, map.lng],
:title => map.name,
:info_window_tabs => [
{:tab => "HTML", :content => #marker_html},
{:tab => "Attachments", :content => "stuff"}],
:icon => {
:image => "../images/icon.png"
}))
The readme and documentation can be viewed here.
And the relevant ruby file that I am trying to interact with, including the author's comments, can be viewed here.
I have tried the #rubyonrails channel in IRC as well as emailing the author directly and reporting an issue at GitHub. It really is just a question of syntax.
Thanks!
Okay, so I finally got this figured out. Here's how you do it; :icon accepts a GIcon variable and :info_window_tabs accepts an array of GInfoWindowTabs. Here is how you would declare each with the plugin.
Declare GIcon
#mapper.icon_global_init(GIcon.new(:image => "../images/civil.png",
:icon_anchor => GPoint.new(0,0),
:shadow => "../images/shadow.png",
:shadow_size => GSize.new(37,32),
:info_window_anchor => GPoint.new(9,2)), "civil_icon")
#civil_icon = Variable.new("civil_icon")
Declare GInfoWindowTab
#tab1 = GInfoWindowTab.new('Tab 1 Label', 'HTML for inside of tab1')
#tab2 = GInfoWindowTab.new('Tab 2 Label', 'HTML for inside of tab2')
#window_tabs = [#tab1, #tab2]
Then in your GMarker declaration just do the following:
#mapper.overlay_init(GMarker.new([map.lat, map.lng],
:title => map.name,
:icon => #civil_icon,
:max_width => 300,
:info_window_tabs => #window_tabs))
And you're done.

Resources