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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:56:54+00:00 2026-06-11T07:56:54+00:00

I am building a caching system to store Twitter API tweets as to avoid

  • 0

I am building a caching system to store Twitter API tweets as to avoid violating the hourly call limit.

I am storing the tweets in a database with a timestamp and then checking in PHP to see if the timestamp is an hour old, if so then I call the API again. At the moment I can’t seem to get it working. Here is what I curently have (which I admit is most probably wrong!)

 if($results->tweet_date <= strtotime('-1 hours')) {
 //do api call
 } else {
 //call tweets from database
 } 

This doesn’t seem to be working though. Can anyone point me in the right direction?
Thanks!

  • 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-11T07:56:55+00:00Added an answer on June 11, 2026 at 7:56 am

    What about using the timestamp minus 3600?

    if($results->tweet_date <= time() - 3600) {
    //do api call
    } else {
    //call tweets from database
    } 
    

    EDIT: If you want to use strtotime, you can use strtotime('-1 hour') to calculate the time (mind the hour instead of hours).

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

Sidebar

Related Questions

I'm currently in the process of building a caching system for some of our
We are building a system that would benefit greatly from a Distributed Caching mechanism,
I am building MVC application and would like to put caching in my application.
Building an inventory system. I have lots of products and each product has three
building a site using PHP and MySQL that needs to store a lot of
I created a re-usable plugin for a system I'm building. All seems to work
Investigating the security of a system I'm building with ASP.NET MVC 2 led me
I'm building a custom page caching utility that uses a syntax like {Substitution:GetNonCachedData} to
I have a caching system build within php that stores the results of a
I am building a fairly large statistics system, which needs to allow users to

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.