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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:22:13+00:00 2026-05-25T16:22:13+00:00

I am hoping this is possible. What I am doing is using the Facebook

  • 0

I am hoping this is possible.

What I am doing is using the Facebook PHP SDK and the Social Graph API to retrieve posts from a page and refreshing it every x millseconds but this is a bit of waste of resources if the content is exactly the same so I was wanting to only do the refresh is the content has changed.

<div id="bottom-bar">
    <?php require("graph.php"); ?>
</div>

<script>
var auto_refresh = setInterval(
function ()
{
    $('#bottom-bar').fadeOut("slow").load('graph.php').fadeIn("slow");
}, 30000); // refresh every 30000 milliseconds
</script>

So, graph.php has the massive array that is returned by the page and I am taking out the data I want etc but is there a way to only do it if it’s different than before?

Thanks for all your help,

  • 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-25T16:22:14+00:00Added an answer on May 25, 2026 at 4:22 pm

    thanks for your help, managed to get it with the following code so if anyone runs into this situation then hopefully it’s of some use to you:

    <script>
    var cacheData;
    var data = $('#bottom-bar').html();
    var auto_refresh = setInterval(
    function ()
    {
        $.ajax({
            url: 'graph.php',
            type: 'POST',
            data: data,
            dataType: 'html',
            success: function(data) {
                if (data !== cacheData){
                    //data has changed (or it's the first call), save new cache data and update div
                    cacheData = data;
                    $('#bottom-bar').fadeOut("slow").html(data).fadeIn("slow");
                }           
            }
        })
    }, 30000); // check every 30000 milliseconds
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hoping that using something like this demo it is possible to drag items within
I'm hoping this is an easy one, I'm using mySQL and php to upload
Not sure if this is possible in one Makefile alone, but I was hoping
I'm hoping this is just a bug on Facebook's end that will be fixed
Using php coding, I'm attempting to make a script which will grab content from
I'm hoping what I'm trying to do is possible using Visual States... What I
Hoping this will be a quick/easy one, but I can't seem to find the
I'm hoping this just needs a new pair of eyes casting over it. I
I'm hoping this will be an easy one :) I've been stuffing around for
I'm hoping this question has a very simple answer. I can think of ways

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.