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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:33:27+00:00 2026-06-16T00:33:27+00:00

I am trying to fetch Newsfeed using the Facebook (API) FQL. In an attempt

  • 0

I am trying to fetch Newsfeed using the Facebook (API) FQL.

In an attempt to page results, I was initially using LIMIT and OFFSET parameters like this:

SELECT post_id,.... FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid = me() AND type = 'newsfeed') AND is_hidden = 0 LIMIT 20 OFFSET 0

And then every time, I hit the end of the ListView, I run another query and fetch the next set of Feeds by incrementing the OFFSET by +20. I took the logic from this answer: https://stackoverflow.com/a/13265776/450534

However, the problem is, LIMIT and OFFSET parameters don’t necessarily give you all the results and searching on SO revealed that Facebook recommends using time constraints.

Now I need to modify the code so that Feeds are fetched for each day. For example:

Initial Set Of Data - `created_time < 1355788800` (17th December)
Second Set Of Data - `created_time < 1355702400` (16th December)
Third Set Of Data - `created_time < 1355616000` (15th December)
.
.
.
.

After searching a bit, getting a solution to convert current time into a Unix TimeStamp was achieved like this:

Date now = new Date();
long unixTime = new Long(now.getTime()/1000);

But, for every new set of data, how do I decrease the Date by 1? I tried this piece of code:

Calendar newCal = Calendar.getInstance();
Calendar xDate = (Calendar) newCal.clone();
xDate.set(Calendar.DATE, -1);
System.out.println(xDate.getTime().toString());

But the result is: Thu Nov 29 17:18:50 GMT+05:30 2012 when I am was hoping it would be 16th December. Any help will be appreciated.

Thank you.

  • 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-16T00:33:27+00:00Added an answer on June 16, 2026 at 12:33 am

    I found subtracting day’s worth seconds from the original Unix Timestamp created on each pass. Thanks to this answer here: https://stackoverflow.com/a/5128186/450534

    So, everytime, for the purposes of paging, I call the AsyncTask that fetches data I subtract 86400 seconds from the Unix Timestamp.

    This works like a charm.

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

Sidebar

Related Questions

I'm trying fetch a live currency rate using the following API. http://www.exchangerate-api.com/INR/USD/1?k=FQRxs-xT2tk-NExQj When I
I'm trying to fetch this page (it's in Chinese, sorry for that): amazon(dot)cn/s?rh=n:663227051 using
I am trying to parse a result (JSON) fetched from the Facebook API using
I am trying to fetch a page using urllib2.urlopen (actually, I am using mechanize
I'm trying to fetch data from a page that resides on an intranet. The
I am trying to fetch orders created in a specific period of dates using
I'm trying to fetch some JSON data from my server like so: var a
I'm trying to fetch data from a div (based on his id), using PHP's
I am trying to Fetch GPS continuously every minute using Android Code. When it
I'm trying to fetch an interface using D2010 RTTI. program rtti_sb_1; {$APPTYPE CONSOLE} {$M+}

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.