I am able to post to a users feed using a URL from my app, for example:
https://graph.facebook.com/USER_ID/feed?
link=https://developers.facebook.com/docs/reference/dialogs/&
picture=http://fbrell.com/f8.jpg&
name=Facebook%20Dialogs&
caption=Reference%20Documentation&
description=Using%20Dialogs%20to%20interact%20with%20users.&
message=Facebook%20Dialogs%20are%20so%20easy!
According to the documentation here: https://developers.facebook.com/docs/reference/dialogs/feed/ it is possible to add "actions" which appear next to the Like and Comment buttons under each post. The documentation states the actions must be in a JSON format with object with keys name and link
Well, you could add actions parameter. If in PHP then you could do like:
'actions' => json_encode( array(
'name' => 'Some sample link example',
'link' => 'http://something.com/test/'
)),
Did you mean something like that.
Hope it helps
Related
All i'm trying to get the items reviews from amazon using Net::Amazon::Attribute::Review
I have tried everything in my low knowledge of perl to try to get it to work but I can't seem to get it. Any help would be appreciated.
DESCRIPTION
Net::Amazon::Attribute::Review holds customer reviews.
Net::Amazon::Attribute::Review - Customer Review Class
SYNOPSIS
use Net::Amazon::Attribute::Review;
my $rev = Net::Amazon::Attribute::Review->new(
'rating' => $rating,
'summary' => $summary,
'content' => $content,
'asin' => $asin,
'customer_id' => $customer_id,
'date' => $date,
'helpful_votes' => $helpful_votes,
'total_votes' => $total_votes,
);
It looks like you are pointing to a sub-package being part of Net-Amazon-0.62.
Reading the README, you can find some request example and Net::Amazon::Attribute::Review is one of the attributes of the response.
Digging into the source code of the Response serialization, the object Review is parsed from xml here https://metacpan.org/source/BOUMENOT/Net-Amazon-0.62/lib/Net/Amazon/Response.pm#L123-129 .
If you want to debug the content of the response, you can call the method as_string.
You can find a full example of fetching reviews inside the library in this file:
https://metacpan.org/source/BOUMENOT/Net-Amazon-0.62/eg/reviews
I have a drupal site where I want to show some videos.
I would like to have a field where I can Uplaod and Image, a title, a description, and url for video.
I could not figure it out how could I make this. I believe drupal has some way of doing custom fieds.
Is it possible to do the above?
Finally I did with a paragraph type where I put all the fields I need it and it worked.
I got the same goal, but I don't want to use Paragraph for this. I created a fieldItem, a fieldWidget and a fieldFormatter.
For the image subfield, in my fieldItem class I use an integer type :
$properties['poster'] = DataDefinition::create('integer')
->setLabel(t('Poster override'))
and inside the widget class, I use a 'managed_file' type :
$element['poster'] = array(
'#title' => $this->t('The poster of the video'),
'#type' => 'managed_file',
'#upload_location' => 'private://',
...)
It works fine, but my problem is that I want the upload widget to work as well as a "classic image field", that is to say with a preview of the uploaded image, and so on.
Do you think it is possible ?
Thanks
ben
I'm playing around w/ the /me/music.listens endpoint of Graph API and I have it working just fine. Except I can't seem to figure out how to get actual artist info to come back. I see the song and even the album (though that seems a little inconsistent too). But never any artist info.
Check the developer explorer here: https://developers.facebook.com/tools/explorer/?method=GET&path=me%2Fmusic.listens
No artist info. Is this just not returned? I can't see how to specify this in a fields param list. FB's documentation of the actions is spotty at best so I figured I'd try here.
Thanks!
I've figured out a work around. It doesn't look like Facebook actually returns artist info. So you have to use the Spotify Lookup Service (http://developer.spotify.com/technologies/web-api/lookup/).
To break it down a little further, you start by pulling the music.listens feed from FB and you'll get info that looks like:
(
[song] => Array
(
[id] => 381659191902248
[url] => http://open.spotify.com/track/**2Vv27Gc5k5GgGW9jgtj1CS**
[type] => music.song
[title] => Follow Through
)
)
From there, you need to grab the bolded track ID.
Lastly, fetch the song metadata with this call to Spotify: http://ws.spotify.com/lookup/1/.json?uri=spotify:track:2Vv27Gc5k5GgGW9jgtj1CS
You'll be returned the album name, artist info, etc.
If someone knows a better way, lemme know!
You can retrieve artists informations on graph API with the song id :
https://graph.facebook.com/song_id?fields=data{musician}
ex : https://graph.facebook.com/697975930266172?fields=data{musician}
Old question I know, but you can retrieve related information such as both the song title and artist title in the same request using Graph API's 'field expansion'.
For example - Last 10 songs
me?fields=music.listens.limit(10){data{song{title,id},musician{id,title}}}
To retrieve more information from either the song or musician entities just tweak the fields requested.
Note, this requires user_actions.music permission
I am trying to insert a text on show page of Spree's product page.
My app/overrides/show_new.html.erb as follows:
Deface::Override.new(:virtual_path => "spree/products/show",
:insert_after => "[data-hook='product_show']",
:text => "<p>This is overriding......</p>",
:name => "show_new",
:disabled => false)
But, the view is not overridden. Am I missing something?
You must restart your app for the overrides to register first.
Otherwise, this seems correct (assuming your code is in app/overrides/something.rb)
Watch out if you are not on latest version, some views HTML are broken and it breaks deface.
https://github.com/spree/spree/issues/1056 (I ran into this issue last week)
I have my app posting a link to the user's wall if they have given it permissions, but it ignores the picture, name, and caption values I pass along with it.
HTTParty.post("https://graph.facebook.com/#{#sponsorship.fbid}/links", :query => {:access_token => URI.escape(#access_token), :link => URI.escape(request.env['HTTP_HOST']), :picture => URI.escape("#{request.env['HTTP_HOST']}/images/fb_post/after_donation.jpg"), :name => URI.encode("Click here"), :caption => URI.encode("This is the caption")})
Any help is appreciated, thanks.
Think you might need to be using
https://graph.facebook.com/#{#sponsorship.fbid}/feed
instead of
https://graph.facebook.com/#{#sponsorship.fbid}/links
It's probably taking those values from the open graph meta tags on the link target rather than the ones you provide at post time. Not sure if that's supposed to be happening but you should check if your link has the correct tags.
https://developers.facebook.com/docs/opengraph/ is the docs and https://developers.facebook.com/tools/debug will show you what markup is detected on your page