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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:35:43+00:00 2026-05-13T10:35:43+00:00

I am creating a webapp that relies on following a status timeline from twitter

  • 0

I am creating a webapp that relies on following a status timeline from twitter in php

I am making a request to the twitter using the following API call:

$since_id is equal to a stored id based on the last parsed tweet.

$req_url = ‘http://twitter.com/statuses/friends_timeline.xml?count=20&page=1&since_id=‘.$since_id;

I have noticed that if more than 20 tweets come through since the last call i’ll get the most recent 20 tweets since the last call and in turn missing those between the $since_id and the current 20.

example:

  1. at 0800 the last tweet parsed was 70001
  2. 50 tweets are made in the 10 min window since the last API call
  3. at 0810 i call to the API to get tweets since 70001
  4. it returns tweets 70031 – 70051

which causes me to miss 70002-70030

Now to the quest:
Is there a way to know how many tweets have been made since the last call? If so, is there a way to make sure when I call the API that I am getting the next tweet in line and not the most recent tweets made?

language: PHP5
using: Twitter REST API

  • 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-13T10:35:43+00:00Added an answer on May 13, 2026 at 10:35 am

    you can set the since_id parameter to the last seen tweet and specify a count of 200. then retrieve the older ones by specifying max_id.

    $startId = [last tweet_id]
    $tweets = "twitter.com/statuses/friends_timeline.xml?since_id=${istartId}" .
      "&count=200"
    
    while (count($tweets)) {
       insert $tweets into table on duplicate key update none
       $maxId = $tweets[count($tweets) - 1]['id'];
       if ($maxId <= $startId) {
         break;
       }
       $tweets = "twitter.com/statuses/friends_timeline.xml?max_id=${maxId}" .
         "&count=200"
    }
    

    there doesn’t appear to be a way to begin paginating at a particular id. in the api, you always start with the most recent entries and work your way back in time to the last seen id.

    it’s possible to search within a date range using the search atom and the operators since,until, and from:

    http://apiwiki.twitter.com/Twitter-Search-API-Method%3A-search
    

    but indeed, it’s still sorted by time desc, so you would need to scroll back in any case.

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

Sidebar

Related Questions

I'm a PHP programmer and I want to try creating a webapp using the
I'm creating quick web app that needs to send a php-created message from within
I have been busy in my project creating a webapp (in struts) that manages
I am creating a webapp for iPhone using jQuery Mobile and PhoneGap. Everything works
I'm making a trivia webapp that will feature both standalone questions, and 5+ question
I am creating a webapp on facebook that allows users to provide login details
I have a webapp that needs to sometimes download some bytes from a url
I'm creating a little iphone webapp for my school using the iWebkit (fancy css/javascript
I am creating an iPhone webapp with a textbox. I would like that textbox
I've created a simple webapp using Spring & Jetty, and am creating a hello

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.