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 8718841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:38:53+00:00 2026-06-13T06:38:53+00:00

My application has a single index.php Main things it does are 1. Uses facebook

  • 0

My application has a single index.php

Main things it does are

1. Uses facebook login to let the user login to my application. (In future I will use additional sites like google etc for login etc)

2. Does the “Main work”

3. Displays the result.

Main work:

1. Gets an access token from fb. – Takes <10 ms

2. Gets data set 1 – Uses accesstoken and gets data about the user. – Takes about a second.

3. Gets data set 2 – Spiders each of the friend in the list for partiuclar information – Takes about a second for each friend. So, takes around 300 seconds on average.

4. Does some processing – Few Seconds

Problem Areas
1. Step 3 exceeds Max_Execution_Time always.

Solution constraints
1. Wish to stick with php only. No Python/ruby.

My code skeleton is :

<?php

//  Login
$facebook->getloginurl ......

//Main work
$access_token = $facebook-> ...... 
$user_id = $facebok->get ......

// Following is the time consuming step
foreach $friend_of_that_user .... get information required for this app.

//Displays result
echo ""
?>
  • 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-13T06:38:54+00:00Added an answer on June 13, 2026 at 6:38 am

    You are making a single request for each friend! this can be enhanced by one of the following methods:

    1. Field Expansion:
      Getting the name and 5 movies of the first 100 friends:

      me?fields=friends.limit(100).fields(name,movies.limit(5).fields(name))
      
    2. Batch API:
      For example, to get the details of 5 of your friends, you can issue the following Batch request:

      curl \
         -F 'access_token=...' \
         -F 'batch=[{ "method":"GET","name":"get-friends","relative_url":"me/friends?limit=5",},{"method":"GET","relative_url":"?ids={result=get-friends:$.data.*.id}"}]' \
         https://graph.facebook.com/
      

    Now I would really recommend considering pagination instead of removing the limit field all together. If pagination is relevant to your app, it could enhance the experience A LOT!

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

Sidebar

Related Questions

Currently my application has a single navigation screen that allows the user to select
my application has to deal with calendar information (incl. single occurrence, recurrence, etc.). In
I have a single view application. It has myAppDelegate and myViewController. In a earlier
My application has one activity which starts two services but does not bind them.
My application has two layouts A and B. In A a user chooses some
I have a single application which manages and delivers several sites. I does this
I have a GUI C# application that has a single button Start/Stop. Originally this
Iam coding a dating application for facebook. The application has to have a standalone
My application has multiple SQLite tables(around 20 with different fields). This I have created
My Application has 3 activities (MainActivity,SampleActivity,TempActivity) and Application have to start from MainActivity because

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.