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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:49:16+00:00 2026-05-26T04:49:16+00:00

I want to write a WordPress plugin that will fetch ‘updates’ of my friends

  • 0

I want to write a WordPress plugin that will fetch ‘updates’ of my friends or pages I like on facebook.

  • Is that doable in PHP?

Any code sample? I tried to look at Facebook for Websites but didn’t find and example on how to get the updates.

  • Any suggestions how this could be done?
  • 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-05-26T04:49:16+00:00Added an answer on May 26, 2026 at 4:49 am

    OK. Let’s start by the beginning. You can do this, sure. Facebook API is growing and you can do it for a very simple way, using “FQL”.

    Following the code (based on the facebook example):

    <?php
    
    $facebook = new Facebook(array(
        'appId'  => '127375200698444',
        'secret' => '3584a791118c4d8811573c8184b51385',
    ));
    
    // Get User ID
    $user = $facebook->getUser();
    
    if ($user) {
        try {
            $fql = 'SELECT status_id, message  from status where uid=' . $user;
            // Proceed knowing you have a logged in user who's authenticated.
            $updates = $facebook->api(array(
                'method' => 'fql.query',
                'query' => $fql,
            ));
        } catch (FacebookApiException $e) {
            $user = null;
        }
    }
    
    // Login or logout url will be needed depending on current user state.
    if ($user) {
      $logoutUrl = $facebook->getLogoutUrl();
    } else {
      $loginUrl = $facebook->getLoginUrl(array(
        'scope' => 'user_status, friends_status',
      ));
    }
    

    The code above require an application registered at facebook (You can register on at https://developers.facebook.com/apps). Just register there and replace the appId and the secret with your values.

    After all this done, you must echo the url $loginUrl to get the AuthToken of your user. With this token, you can get all the updates of him (using the fql of the example).

    The Facebook type used in here is available at https://github.com/facebook/php-sdk.

    I hope this helps or at least have given a path.

    Status FQL Docs:
    http://developers.facebook.com/docs/reference/fql/status/

    API Method Docs (my example was based in here):
    http://developers.facebook.com/docs/reference/php/facebook-api/

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

Sidebar

Related Questions

I want to write a script that disable all the submit buttons when the
I want to write a template that returns me the smallest signed integer type
I want to write a test that calls a remote server and validates the
I want to write a program that uses the GPL-licensed pandoc for Markdown processing.
I want to write a series of delegates that call one another. It's a
my friends .. I want to design a small plugin .. it is work
Update: someone answered and suggested that I write a plugin, but that is a
I'm trying to write a little WordPress plugin to support some migrated content. The
For eg, I wrote my own Wordpress plugin that uses the Transient API's to
I want to write an iOS app that must download data from a website

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.