Hi first i want to clarify that this is not a question about how to embed a flash player in user wall, because i already know how to do it.
The question is if anybody can help me whith my code or if someone has the same problem as me and it is a bug.
I want to publish this link ( http://www.test.hollybyte.tv/watch/4e45080a94a05f1478000000 ) into wall via Graph Api. If you see the code of the link you can see that the required metas are wrote. In fact, if you paste the link in Fb, you can see that it recognise and even publish the player.
For test purpose i have used the Graph API Explorer ( http://developers.facebook.com/tools/explorer ) with this parameters:
Method: "POST"
Api : https://graph.facebook.com/user/feed
oauth_token : ...
message: "Test from API Explorer"
link: http://www.test.hollybyte.tv/watch/4e45080a94a05f1478000000
picture: http://repo.eu-w1.hollybyte.com/acc/test/as/4e45080a94a05f1478000000/splash.jpg
source: http://repo.eu-w1.hollybyte.com/acc/test/py/default-flash/swf/flowplayer.commercial-3.2.7.swf?config=http://repo.eu-w1.hollybyte.com/acc/test/st/www/default/js/emb/4e45080a94a05f1478000000.js
type: video
And it does post perfectly well, wiht the player !!
But when i tried the same thing wiht PHP using Facebook PHP SDK, it does not. It publish a link but with no picture, nor player either.
My PHP code for this is:
$facebook = new Facebook( array('appId' => $this->_appId, 'secret' => $this->_appSecret));
$param = array(...); //Array with all the data from above, the same data.
$result = $facebook->api('/'.$userId.'/feed', 'post', $param);
echo $result;
I do not understand why, whith the API Explorer works fine, but whit my PHP call does not. Please tell me if it is a bug, or what i am doing wrong.
I have to say that i have all permissions right (publish stream, offline access, read stream), and i can post to wall so it is not a permission problem (or correcti if i am wrong)
Thanks in advance for your answers.
P.D.
I am not used to write in english, so forgive me if i have some grammar errors.
From the Feed dialog documentation, It doesnt look like there is supposed to be a type parameter in the param array... In addition, the message parameter should not be used - facebook said that they will start ignoring that parameter from July 12 :
"This field will be ignored on July 12, 2011"
They also say things like
The URL of a media file (e.g., a SWF or video file) attached to this post. If both source and picture are specified, only source is used.
You should try removing unnecessary parameters. I dont believe that there is a bug with the API... Most of the times when I have encountered these types of bugs it was an issue of wrong parameters.
Just to clarify the solution.
If you want to publish a link to a flash player in user wall. You only need tree paremeters
Message: The message you want (optional).
Link: A link to the page with the player. The page must have the proper metas (video_src, video_img, etc...)
Type: Video.
And only those parameters, no more.
Thanks Lix to show me the way.
Tolke does your embed still work ? It seems that Flash ,Video Embed is not working anymore mostly all over FB. Two exceptions youtube and vimeo serving over https .
dont get it to work with the usual parameter
Related
This has been a nightmare to get right for the past few days. First I was struggling with redirect_uri_mismatch errors, or bad requests, but now that I thought I nailed it, I'm getting this message from Google after clicking the "Allow" button in the consent screen :
Please copy this code, switch to your application and paste it there
Where exactly do I need to paste this code? I'm using PHP in a web server, I went to the "Other" application type when creating the credentials, because I read that this was preferred if I didn't want my users to keep getting that auth link.
I can't seem to find a concrete example of how to do this, I got it working this far by grabbing bits from here and there, but this one I just can't figure it out.
https://gist.github.com/andruxnet/0f7fe237730c13846a690da12935a708
I'm using a file client_secret.json that I downloaded from Google's oAuth credentials screen, it looks like this:
{"installed":{"client_id":"xxxxxxxxxxxxxxx.apps.googleusercontent.com","project_id":"my-project-id","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://accounts.google.com/o/oauth2/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"xxxxxxxxxxx","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}
Anyone knows what else I need to do or where to put that code returned from Google after the consent screen?
Thanks
Although the answer here does not use PHP, I still think it's worth to add it here as it's the only complete working example of how to update a youtube video without displaying the consent screen to the user, at least I wasn't able to find a concrete working example.
I ended up using the Javascript library, I still wasn't able to find a single complete example, not even in the library docs, nor Google's, it took taking pieces of code from here and there, and connecting the dots.
First thing to do is to create the credentials, we do this by going to Google developer console, and under Credentials we create a new OAuth Client ID, choosing Web Application and adding our domain to the Authorized JavaScript origins field - eg. http://www.example.com
The only information we will need from these credentials is the Client ID, so we copy it and paste it in the Javascript file below.
Here's the HTML part, where we also load the API library:
<input type="button" id="make-private" value="private" /> Make video private
<input type="button" id="make-public" value="public" /> Make video public
Current privacy status: <span id="current-status"></span>
<script type="text/javascript" src="update.js"></script>
<script src="https://apis.google.com/js/client.js?onload=googleApiClientReady"></script>
This is the Javascript code to make it happen - update.js in the code above, remember to update with your own client ID: https://gist.github.com/andruxnet/2efe7898f5cd9722e0d42b71fce5d183
The relevant Javascript code, once we figure out the authentication part that can be found in several places online, is this piece of code:
// we first grab the video resource from Youtube, using youtube video id
var request = gapi.client.youtube.videos.list({
id: 'youtubevideoid',
part: 'status'
});
// once we get the video resource, we update the status and
// run the update method
request.execute(function(response) {
// since we looked for a video id, we only got one result - the first
// and only item in the array of result items
video = response.result.items[0];
// set the privacy status to one of public, private or unlisted
video.status.privacyStatus = 'private';
// prepare the update with the new privacy status
var updateRequest = gapi.client.youtube.videos.update({
part: 'status',
fields: 'status',
resource: video
});
// execute the update - I didn't see this part in the API documentation,
// I found it somewhere else in SO as part of another question, although
// I should've figured it out by looking at the first list() method above
updateRequest.execute();
});
I hope this saves someone's time in the future as it would have saved my own.
Cheers
I see disinformation, go and check this link:
https://developers.google.com/api-client-library/php/auth/web-app#example
There you have many examples of what you are requesting, anyway the code you are receiving from google is the Auth Code which allows you to authenticate the client (The Google_client->authenticate(AuthCode) created in you php app to be more exact), after that you can start using their services with Accesstoken or RefreshTokens depending on what type of connection you requested to generete the perms.
I hope this comment help you a bit with the nightmare of developing Google Services :)
i feel so frustrated, since i have been looking for this all day, from hundreds of sites and with my accumulated frustration i´m not making my life easier.
My problem is this.. i have made an app for facebook in php, and now i want to put a button there that when people press it, it would send a post to their time line, with the permissions and all. I have seen a lot of things and have not been able to help my self, í´m almost having a stroke with this. Can some one please help me?????
Facebook has decent documentation. Besides the overall reference mentioned in the comment, start here:
https://developers.facebook.com/docs/php/gettingstarted/
https://developers.facebook.com/docs/php/howto/postwithgraphapi
Be sure to create a Facebook app to get the App ID that you'll need to configure the Facebook object.
The part of the code that does the actual post is this:
$facebook->api('/me/feed', 'POST',
array(
'link' => 'www.example.com',
'message' => 'Posting with the PHP SDK!'
));
I know you mentioned doing this with PHP. I have created similar functionality in a PHP app (post to a user's wall when clicking a button), but I used the Javascript API, so it's invoked client-side. There is similar documentation for the Javascript API by Facebook. Just a thought.
If you are getting specific errors, please post them and you'll get more specific answers.
i was able to do something similar to what i wanted with the search parameters from the help you provided.
I found this tutorial and with a little tweaking i managed to do something. I will leave the link to the tutorial below so it can help some one in the future.
http://25labs.com/tutorial-integrate-facebook-connect-to-your-website-using-php-sdk-v-3-x-x-which-uses-graph-api/
I work with Facebook API SDK. I'm trying to get all public photos using https://graph.facebook.com/search?access_token=xxxx|xxxxx&q=%23hashtag&type=post
But I have a problem: result contains only shared photos in first account. When i'm posting photo without share, search not found it.
Otherwise, I have another account where I'm posted photo and share it, but photo is not found too.
Who knows, how can I get all public photos with hastag using FQL or graph search
Addition:
Few days ago - facebook search is not working
After discussing with facebook developers, I got the answer:
Facebook API does not support searching for hashtags.
%23 is just the URL encoded version of a # which gets decoded on a
server generally so it still won't work. For example if I wanted to
search for #YOLO I would just say q=YOLO with no # or it's URL encoded
form.
It's just something that the api doesn't support at the moment
Facebook has officially deprecated the post search type. Im not sure when exactly but I can tell you I tried today (10/15/2014) and its a no go.
As a newbie in facebook apps , I copied the social-cafe facebook app and tried to publish it using all the details that was provided in the readme files .
I read the basics of the facebook app from here
For instance my app is not publishing story to stream.Actually I am not able to login through my app ,, :(
All tags are there, graph api is all set ,but still app is not working.
The problem is that when I click a drink to post it to my stream, I get an error that says:
There was a problem with your purchase. Please Login again.
In debug Tool got this Info:-
Response Code: 206
Open Graph Warnings That Should Be Fixed
Inferred Property: The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags.
Small og:image: All the images referenced by og:image should be at least 200px in both dimensions. Please check all the images with tag og:image in the given url and ensure that it meets the recommended specification.
Thank you in advance!
So here is the story, my girl wrote me on my wall and I got the notification but even 3 days later there is no sign of actually reading that wall post. I am obsessed about this because she wrote it from the hospital and it wont be soon that she writes again so I must read what she wrote. The notification has some ids associated with them to see if that helps. Please help me figure it out. Figured out using context id in this form but shows blank. Looks like the post still lives since deleted posts show a clear cut error. https://www.facebook.com/ali.gajani/posts/content_id
Edit: looks like the context id turned out to be my profile id. This is driving me crazy! I want to see that wall post at any cost and I am sure it's an Fb issue because the wall post has not been deleted!
since you are not looking to make a whole application it is likely you can obtain the information you are looking for using the Graph Explorer if you have the ID of the post, it could be relatively simple. if not it could be more difficult. The problem lies in why you can not see it on your wall.
If she changed the permissions on the post, or deleted it you will not be able to see it. Even if she did not delete it, you will not be able to read it if it the applicable permissions are not there. To be brief, if you cant see it now, you likely will not be able to programatically.
Good luck.
Get the read_stream permission in the graph explorer, and you should be able to submit this fql query:
SELECT post_id, message FROM stream WHERE source_id = '<user id>'
This should show the stream stories that have showed up in your stream from the specified source (you could use page/group/user id there). Once you get the post_id, you could just copy-paste it to the graph api part, and see what facebook can tell about that object.
For the user id, you might need to look into the /me/friends relation with the [graph api] part of the explorer.