First, what I have:
I have an FB app which is able to get a user's access_token and post on user's wall using FB API in PHP.
Can anyone please help me to 1) post on my all groups wall using a batch request (or any other technique) and 2) how to get my all groups id?
If I use my app to post on my all groups (100+) wall, is it ok with FB?
Does FB treat this as spam ?
Thanks
i have created a facebook application 1 month back, called WooTube
To promote my application free,i joined around of 100 Groups to promote my fb video app in various of interest base like "KPOP,SNSD,SUPER JUNIOR,Just For Laught and etc" with my application build in features "Post To My Group".It is writen using fb.api
https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-ash4/383568_191076937694203_922285357_n.jpg
Unfortunately this is spam...i was blocked from facebook for 2 days due to spamming.The reason is i shared the same link for around 30-40 time in less then 5-10 minutes.
what i would like to suggest is:
Do not share the same link for more then 20 times per day (to be safe)
Do not post too frequence, each post should have a space of 10 second.
Don't used your own account for spamming (you know what i talking about :) )
You can use Facebook batch API to post to multiple wall (groups, pages or friends wall).
The basic method to do it is shown below. The IDs can be User IDs, group IDs or Page IDs.
You can read more about it at: http://25labs.com/tutorial-post-to-multiple-facebook-wall-or-timeline-in-one-go-using-graph-api-batch-request/
$batchPost[] = array(
'method' => 'POST',
'relative_url' => "/{ID1}/feed",
'body' => http_build_query($body) );
$batchPost[] = array(
'method' => 'POST',
'relative_url' => "/{ID2}/feed",
'body' => http_build_query($body) );
$batchPost[] = array(
'method' => 'POST',
'relative_url' => "/{ID3}/feed",
'body' => http_build_query($body) );
$multiPostResponse = $facebook->api('?batch='.urlencode(json_encode($batchPost)), 'POST');
Related
So. I can't make this work and i can't find any solution about this.
Here is my code.
$result1 = $facebook->batchApi('***********/feed', 'POST', array(
'attached_files' => $facebook->attachFile($uploads[2]),
));
$result2 = $facebook->batchApi('*********/feed', 'POST', array(
'attached_files' => $facebook->attachFile($uploads[1]),
));
$res = $facebook->processBatch(array(
"access_token" => $user_profile['data'][0]['access_token'],
));
I'm using facebook-batch-api. It's just simple wrapper for batch requests.
Need make post like this https://www.facebook.com/centrMAN/posts/587573351326832
You cannot post multiple images to a single feed. (Dosen't make any sense either)
The example link that you've mentioned in simply posting photos, not adding photos to a feed.
So, instead of /feed, simply use the /photos API to get the result.
Posting stories via php facebook application using such construction :
$facebook->api('/'.$wall_id.'/feed',
'post',
array(
'access_token' => $access_token,
'message' => $message,
'picture' => $picture,
'caption' => $caption,
'link' => $link
)
);
There are "702 Stories Published" in app insights ( Apps->My application->Insights->Stream Publish ). But there are no Story Impressions or Story Clicks at all. (702 - 0 - 0)
Is it a bug, or do I need to pass some additional parameters to FB api to track these clicks?
How much time has passed since the stories have been first posted? Facebook Insights requires at least three days to update its data.
Let's wait, and we'll see if this is a bug. I don't know about any special parameter to enable tracking: it should be available without any configuration.
I hope you will be able to help me.
I'm developing an app, and I'm willing to post an activity (that appears on user timeline in recent activity) everytime the user use my application.
Although, for the moment, I have this code below, and it only posts a normal link :
if($can_post){
$facebook->api('/'.$uid.'/feed', 'post', array(
'message' => '',
'name' => 'Name',
'caption' => 'Caption',
'description' => 'SDesc',
'picture' => 'picture url',
'link' => 'link',
'actions' => array(array('name' => 'catch phrase',
'link' => 'http://link'))
));
Check out this guide on posting "stories" to the user's timeline using the Open Graph API, so maybe it's this functionality that you need. The example they give is just a like, but it can be easily modified.
Be aware that Facebook will have to approve you app again if you want to use stories (see end of page on link above).
It's also worth noting that Facebook have also defined a wide range of predefined "Actions" to help in the process, so it's a good idea to check to see if your app falls into one of these categories.
(noob question)
Using the example.php that comes with the PHP SDK I can post to my timeline successfully.
I'd like though to be able to set the date, so I added:
:
:
'created_time' => "2012-06-21T13:46:10+0000",
'updated_time' => "2012-02-19T14:46:10+0000",
'actions' => array(
array(
'name' => 'Get Search',
'link' => 'http://www.google.com'
)
)
);
$result = $facebook->api('/me/feed/', 'post', $attachment);
?>
<?php endif ?>
But created_time is ignored, the post is always "NOW". I've searched around for a solution to this but found nothing. Am i doing something wrong, is it a typo, or just not possible like this?
Looking on the web I did find articles about placing "ACTIONS" in the past - e.g.: How can I add a custom date to the facebook timeline through graph api
Is that the (only?) way to go, create a "publish" action ,,. with start_time etc.? Any links to how to do this (in PHP?)
You can only create actions in the past, not Posts using the API. However, you can manually change the date of a post using the Activity Log - it doesn't look like this feature is available via the API yet.
I have stored a Facebook user ID and a Facebook friend ID. How can I publish to the user's wall without logging into Facebook?
I have used the old Facebook API that has UID and target_id fields like this:
$param = array(
'method' => 'stream.publish',
'callback' => '',
'message' => $row[message],
'attachment' => json_encode($attachment),
'target_id' => $row[friends_id],
'uid' => $row[sender_id],
'privacy' => ''
);
$result = $facebook->api($param);
Is this possible in new facebook PHP API?
$attachment = array('message' => $wall);
$facebook->api("/$target/feed/",'post', $attachment);
The application has wall posting permissions.
According to the docs it's also possible to post to a users feed without the "offline_permission" when the "publish_stream" permission is granted:
Comment about "publish_stream" taken from the docs:
Enables your app to post content, comments, and likes to a user's stream and to the streams of the user's friends. With this permission, you can publish content to a user's feed at any time, without requiring offline_access.
this is possible only if you have the access_token with offline_permission granted.
if you have it, then include the token in $attachment with key "access_token"