I'm getting the following using the PHP client on my server (connecting via FBML). I've included the appropriate php files (facebook etc..)
Fatal error:
Call to undefined method FacebookRestClient::feed_publishUserAction()
in ..../index.php on line 50
I'm trying to use the example given.
Any ideas?
You might want to take a quick browse/grep through your Facebook API files (facebookapi_php5_restlib.php) and make sure that the feed_publishUserAction() method exists. Perhaps you're using an older version of the API library?
OMG I found the answer
Because the facebookapi_php5_restlib.php that facebook.com provided you is a piece of outdated shit
i.e. you won't be able to find the word feed_publishUserAction in the facebookapi_php5_restlib.php file
HOWEVER, the official facebook smiley demo from this facebook wiki page , contained a more completed facebookapi_php5_restlib.php , along with the feed_publishUserAction function
Which finger would you like to show to the facebook developer staffs?
Related
For some reason when I call the following code:
echo file_get_contents('http://gdata.youtube.com/feeds/api/videos/wGG543FeHOE?v=2&alt=json');
I get the following image: http://i.ytimg.com/vi/UKY3scPIMd8/sddefault.jpg
This was working a few days ago - have Youtube started to restrict PHP access to their API?
For anyone else who gets this problem - see https://developers.google.com/youtube/v3/getting-started. Basically they've deprecated the free4all api and are now limiting it to token access. Its quite easy to get a token and once you have one just call:
https://www.googleapis.com/youtube/v3/videos?id=ID&key=YOUR__KEY&part=snippet,contentDetails,statistics,status
I'm trying to build a form that uploads videos to my Dailymotion account.
I built the code myself using the documentation, and I got this error:
Fatal error: Uncaught exception 'DailymotionAuthRequiredException'
with message 'Unsufficient scope for `POST /videos', scope required:
manage_videos, write, delete'
I tried using the script here: http://easyscript4u.blogspot.com/2013/05/how-to-upload-video-on-dailymotion.html
And I get the same error. I looked up the error, and it seems as though you need a token. The documentation doesn't say anything about needing this if you have the password, and that tutorial seemed to work for that dude just fine without it.
I'm thinking this may be a new feature they added so it isn't fully documented. My question is just how do I get a token for this type of request(when I have the user password and everything), and where would I plug it in to the linked script?
Thank you for any help you can provide :)
As mentioned in your error, you need the manage_videos, write and delete scopes to be able to upload a video on Dailymotion. This is detailed in http://www.dailymotion.com/doc/api/authentication.html#requesting-extended-permissions : your application needs to request some specific permissions to its user.
Hence, the line you should change in the code you mention is the following:
$api->setGrantType(
Dailymotion::GRANT_TYPE_PASSWORD,
$apiKey,
$apiSecret,
array('write', 'delete', 'manage_videos'),
array('username' => $testUser, 'password' => $testPassword)
);
It should make it work.
I am trying to implement an store locator using php and mysql and google maps
I have gone through this article "https://developers.google.com/maps/articles/phpsqlajax_v3 "
it says "Check your configuration or try initializing a domxml_new_doc() to determine if your server's PHP has dom_xml functionality on."
But apparantly mine is not on because it is giving me this error :
"Fatal error: Call to undefined function domxml_new_doc() in C:\wamp\www\StoreLocator\phpsqlajax_genxml.php on line 5"
I am using php 5, and I am not sure how I can turn it on.
Please help me with your opinions.
This question might help answer your problems.
Are you sure you want to go down the XML route and not the JSON one?
Background:
I am making a facebook app where users post messages like in a forum. For that I save the users facebook id to then present their names. I know it is possible to show the name out of a facebook id by using the Graph API, but I can't make it work.
The code I use is the following:
//$fbId is the facebook id to find out the name for
$facebookUrl = "https://graph.facebook.com/".$fbId;
echo(file_get_contents($facebookUrl));
$str = file_get_contents($facebookUrl);
$result = json_decode($str);
echo($result);
return $result->name;
I researched and tested this for hours, but I feel like I'm getting nowhere. I got an idea of how it works from:
http://www.phpexpertsforum.com/how-to-get-the-facebook-name-with-user-id-using-php-code-t1852.html
Didn't work so I researched further from here:
Get user's name from Facebook Graph API
I dowloaded and currently use the Facebook php SDK, but I don't find the way to use it to get anyone's name other than the current user.
The problem here seems to be the file_get_contents() function that returns a false, meaning that it can't read the file.
I checked out the php documentation. Also, by using the php functions fopen() and file().
//echo(pathinfo($facebookUrl, PATHINFO_EXTENSION)); -> Doesn't give any response!
//echo(file_exists($facebookUrl)); -> No response!
//fopen() doesn't work
//file() doesn't work
//file_get_contents() doesn't work
//tried adding an access token to the $facebookUrl but it doesn't make any difference
Any idea of what could be wrong here? Little guidance would be very helpful. What am I doing wrong? What did I miss?
Seems that your allow_url_fopen directive is set to Off.
Look for it in your php.ini (or create a php file containing <?php phpinfo(); ?> and point to it in your browser) and check if is set to 'On'.
I'm using the new Google Calendar API v3. I'm trying to obtain the users calendar list using the PHP library. If I make the request directly using CURL then it works fine, but for some reason when I try and use the PHP library it fails and throws a 500 error.
Here's the (abbreviated) code:
$this->calendarAPI = new apiCalendarService($this->client);
$calendar_list = $this->calendarAPI->calendarList->list();
If I var_dump the contents of $this->calendarAPI->calendarList then I get an object as I would expect. It's only when I call the list method that everything goes wrong.
Can anyone help or am I going to have to write my own library and interact with the API protocol directly?
Ok, so it turns out this is a mistake in the docs. Instead of calling a method called list() you have to call listCalendarList() so the second line should be:
$calendar_list = $this->calendarAPI->calendarList->listCalendarList();