Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8590825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:23:00+00:00 2026-06-11T23:23:00+00:00

I have tried using facebook api to post the ratings on the friends all.

  • 0

I have tried using facebook api to post the ratings on the friends all. but it is taking a long time to respond and makes my webpage hang. here is my code.

I am getting the user info through Facebook connect. once i connected , i set the user id in the session and allowing the user to rate the product on my page. once the rating is submitted , i am posting the user rating values eg. 4.5 stars to the user’s Facebook wall and also on the friends page. but the page is taking a long to respond back. Is there any way to work out this. i am expecting some thing like , the posting process should happen in the back end without the user notice and the page should respond to him very fast.

if($user)
   {
      $accessToken = $facebook->getAccessToken();
      $ret_obj= $facebook->api('/me/feed', 'post', array(
         'access_token' =>$accessToken,
         'message' => $message,
         'link' => $link,
         'name' => strip_tags($pagetitle),
         'picture' => $picture,
         'caption' => $caption,
         'description' => $description,
     ));
      $mypostid = $ret_obj['id'];       
      $friends = $facebook->api('/me/friends'); 
      foreach($friends['data'] as $friend) {

    $frendid = "/".$friend['id']."/feed";         
    $frend_return = $facebook->api($frendid, 'post', array(
         'access_token' =>$accessToken,
         'message' => $message,
         'link' => $link,
         'name' => strip_tags($pagetitle),
         'picture' => $picture,
         'caption' => $caption,
         'description' => $description,
     )); 

      }

   }
$insert = mysql_query("INSERT INTO `rating`
         (
            `id`,
            `user_id`,
            `username`,
            `useremail`,
            `rateformoney`,
            `ratefordesign`,
            `rateforperform`,
            `rateforfeatures`,
            `rateforquality`,
            `avgrating`,
            `ratingcomment`,                
            `recommended`,
            `category`,
            `product_id`,
            `created_date`
         )
      VALUES
         (
            NULL,
            '$usrid',
            '$name',
            '$email',
            '$rat_price', '$rat_design', '$rat_perf', '$rat_feat', '$rat_qlt', '$avgrating',
            '$rat_comment',  '$recommended', '$category', '$productid', CURRENT_TIMESTAMP
         )
          ");




header($redirect);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:23:01+00:00Added an answer on June 11, 2026 at 11:23 pm

    I have tried using facebook api to post the ratings on the friends all.

    Do all of the user’s friends actually want to have this posted to their wall?

    This behavior could easily lead to some of them flagging your posts as spam … (Just a warning, it’s up to you what your app does.)

    but it is taking a long time to respond

    That’s because you’re making one API call and therefor also one HTTP request for each friend in your loop.

    Try bundling the API calls into one (or more) batch requests to speed things up – this limits the amount of actual HTTP requests happening, and therefore should be noticeably quicker.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Facebook API v5.3 BETA, although have tried the following using v5.2.1 Stable.
I have tried using the code below but it only display results in Chrome
I have tried using a stemmer but the words it produces are just not
I have tried using the accordion plugin, but it does not work, and I
I have tried using date(m/d/Y, strtotime(04-05-2012)) but I will get 05/04/2012 or on some
How can I avoid NullPointerExceptions ? I have tried using try-catch blocks but that
We have tried it using an orm mapper tool, but it opens en closes
I have a couple of problems using facebook graph api. 1). When i try
Working with the Facebook API makes my ears bleed, but nonetheless I've got a
I tried a number of methods of posting to Facebook using Graph API and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.