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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:18:38+00:00 2026-06-18T18:18:38+00:00

I have a checkbox form that lets users select one or more Twitter timelines

  • 0

I have a checkbox form that lets users select one or more Twitter timelines to display. Right now, the timelines appear in batches (i.e., all the tweets from first timeline, followed by all the tweets from the second timeline, and so on). I’d like to sort all of the collected tweets into a single chronology before output.

Here is a JS fiddle: http://jsfiddle.net/brianeoneill/z9cuP/2/

$('input[type=submit]').on('click', function(e){

    // prevent default behavior of the submit button
    e.preventDefault();

    // empty the div with ID of tweets
    $('#tweets').empty();

    // perform a function on all of the checked boxes
    $(':checkbox:checked').each( function(){

    var twitterID = $(this).attr('data');

    // use the "data" attribute to build the query string for getJSON
    $.getJSON( 'http://api.twitter.com/1/statuses/user_timeline/'+twitterID+'.json?callback=?', null, function(data){

    // create an empty ul
    var tweetList = $('<ul id="tweets-list">');

    // for each JSON object returned, parse it into an li
    $.each(data, function(i, tweet){
        var item  = $('<li class="'+i+'">');
        var name  = $('<h2>').text(tweet.user.name);
        var date  = $('<small>').text(tweet.created_at);
        var img   = $('<img>').attr('src', tweet.user.profile_image_url);
        var msg   = $('<p>').text(tweet.text);
        item.append(img,name,date,msg);

        // add the li to the empty tweetList ul
        tweetList.append(item);

    }); // end of JSON parse function

  // SORT BEFORE SENDING TO DOM

  $('#tweets').append(tweetList);

I’ve tried creating an array of li’s and then sorting them by the Twitter timestamp, but I’d always end up with an empty array. So clearly I’m missing something.

Thanks in advance!

  • 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-18T18:18:39+00:00Added an answer on June 18, 2026 at 6:18 pm

    Hint: all Tweet IDs are generated chronologically ascending. Doesn’t matter whose timeline a Tweet is from, even can be mixed timelines, if you order Tweets by their ID, you get the right chronological order.

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

Sidebar

Related Questions

I have a simple user signup form with a checkbox that lets users get
I have a checkbox group in one form that I need to be posted.
So I have a checkbox form where users can select multiple values. Then can
I have a checkbox that when it is clicked it submits the form to
I have a Rails App that lets Users register. Users can have several music
Let's say I have a checkbox search form like this: Check all that interests
I have a pie chart created with raphael. I have a form checkbox that
I have two checkboxes. each one have a sub form that is disable when
I have the next form: <form id=form> <input type=checkbox name=numbers value=1> <select name=ordering[numbers]> <option
Lets say I have a partial view that contains both a checkbox and a

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.