So I want to get linked typed post from users home stream
But I want it to have specific url like "where link url = example.com"
As a result I will have a data of my friends who had shared that link.
First I tried querying the home with
https://graph.facebook.com/me/home?q=example (worked but partly, only old posts)
Then I did:
friends_id = [Get all ids]
[foreach friends_id as id]
make facebook api call to that id
get all links that user had shared
[foreach links as link]
filter all of them for a specific link
[if shared the link] save user to an array
And that was really slow! 6 sec for a person
And lastly I tried to get it with
fql using stream and stream filter. The problem with that I can get posts but I can't query what is that link
Printing the array gives me:
[post_id] => **********
[actor_id] => *******
[target_id] =>
[message] =>
[action_links] =>
[type] => 80
So how can I achieve my goal of having an array of data of my friends who had shared that link?
Sorry, only possible by using
friends_id = [Get all ids]
[foreach friends_id as id]
make facebook api call to that id
get all links that user had shared
[foreach links as link]
filter all of them for a specific link
[if shared the link] save user to an array
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'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 manage to sent a photo from my server to a users album on facebook.
But this photo is not automaticly seen on his wall. And specifically it is not seen as a big photo, like how photos from albums are shown on a wall.
So I suppose I have to do a second request to tell facebook to put the photo on the wall.
I have these 2 requests:
$ret_obj = $facebook->api('/me/photos', 'POST',
array(
'source' => '#/var/www/cover/test.jpg',
'message' => $_POST['msg']
)
);
This returns for example:
[id] => 358313274248558 [post_id] => 100001736648729_358281023575116
$ret_obj = $facebook->api('/me/feed', 'POST',
array(
'message' => $_POST['msg'],
'object_attachment' => $ret_obj['id']
)
);
I have tried for the 'object_attachment' 358313274238558, 100001796648729_358281027575116 and 358281027575116. But facebook tells me that those are not correct.
So how on earth can we add a photo to a wall, which we just put in an album, and which we want to show in a large format (not as a little thumbnail).
If there is another way, without using albums, that is fine with me.
Please help. I know there have been a few questions already about photo uploads to facebook here on stackoverflow, I think I have read them all about 10 times already. It seems there is no answer yet. Somebody said we could post to /me/links but facebook doesn't seem to be able to handle links like http(s)://www.facebook.com/photo.php?fbid=358309510905631 anymore.
I have changed the ids in this post so they are not linked to actual stuff, they are here as examples.
Thanks
edit:
Ok, it seems a post of an image to an album is also a post of a big image to the wall IF the user allows the app to do public stuff. Because I was developing, I told the app to not do public stuff and only show stuff to me personally.
So there is no need to do 2 requests, just adding a photo to the album is enough to have it appear big on the users wall IF the user allows app activity to be public.
It is still somewhat confusing that a second request seems unable to also add the foto in a large size to the wall.
I want to track visitors coming from affiliate websites to my shopping cart. I see they have affiliate tracking, but I cant seem to find documentation. i tried adding ?tracking=idhere to URLs but its not working. I have added an affiliate and set the commission rate but still nothing.
Update: Using Version 1.5.2.1. I basically need a howto on affiliate tracking. I've never used it or opencart for very long. I can see any decent documentation. Is affiliate tracking built in or do I need a 3rd party extension for what I want.
Update 2: I dumped the $_SESSION variable on the cart page, and the tracking code isn't there.
Array
(
[language] => en
[currency] => USD
[cart] => Array
(
[51] => 1
)
[captcha] => 93e639
[vouchers] => Array
(
)
)
Tracking isn't done through sessions, it's done through a cookie. You can see the cookie code in the index.php file
if (isset($request->get['tracking']) && !isset($request->cookie['tracking'])) {
setcookie('tracking', $request->get['tracking'], time() + 3600 * 24 * 1000, '/');
}
This is then captured during the checkout process, which you can see in
/catalog/controller/checkout/confirm.php
If this isn't working, then you are either not putting the correct id for an affiliate, or cookies aren't being saved/read correctly for some reason
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