Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 11-23-2010, 07:30 AM   #1
goodsites
Confirmed User
 
Industry Role:
Join Date: Jan 2010
Location: Over the rainbows
Posts: 538
Php Facebook Programmers.. question..

I am using the Graph API to connect to facebook via logged in user and get a list of his friends on my site.. the goal is for me to send a post to their friends wall... It works fine but there is a problem I am facing, and do not understand

The problem is this... If you go to a friends profile image and look at his profile ID< you would get back a ID # of something like...

"100000935245404"

Now if I dump the contents of the id's I get using a call to "/me/friends"
it spits out id's something liek

"287548238"

Now if I do my post to /287548238/feed/

it fails with some stupid error Unkown alais..

But if I hardcode the /100000935245404/feed/ it posts to their feed fine

So my question is "What are these ID numbers /me/friends is spitting back?"
Am I missing something? Do I need to do another query to get the proper user profile id to post to their wall?



provided some code for whatever reason, in case question is not clear
if ($session) {
try {
$fb_uid = $facebook->getUser();
$friends = $facebook->api('/me/friends/');
//var_dump($friends);
$friendslist = array_slice($friends[data], 0, 25);
} catch (FacebookApiException $e) {
error_log($e);
}
}

if ($me) {
$friendform = _createFBFriendForm($friendslist);
}


...
...

if ($session) {
$attachment = array(
'message' => 'test message',
'picture' => 'http://www.test.com/',
'link' => 'http://www.test.com',
'name' => 'Swap',
'caption' => "Test Swap Invitation",
'description' => '',
'source' => '',
'actions' => array(array('name' => 'Swap',
'link' => 'http://www.test2.com',
'privacy' => 'EVERYONE' ))
);
// $cb == what the get/friends call id is for this particular friend
$feedlink = "/" . $cb . "/feed";
// echo $session['access_token']; exit;
// echo $feedlink; exit;
// $myfeed = $facebook->api('/100000937335201/feed/', 'post', $attachment); // this works
$myfeed = $facebook->api($feedlink, 'post', $attachment);
}
goodsites is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-23-2010, 07:50 AM   #2
goodsites
Confirmed User
 
Industry Role:
Join Date: Jan 2010
Location: Over the rainbows
Posts: 538
nevermind, i found a bug where it was intval'ing the facebook id, which converted it down because it a very large number...

Thus it was providing an invalid id, the real id is what is coming back now as I thought should be <heh>
goodsites is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.