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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:26:38+00:00 2026-05-21T17:26:38+00:00

I am trying to build a page that displays user tweets, however in between

  • 0

I am trying to build a page that displays user tweets, however in between each tweet I want to visualise the space that represents what the user could have typed in that time period.

I have been going round and round in circles with the logic of what I am trying to achieve and getting nowhere. My current code is here: http://jsfiddle.net/k5234/, but this doesn’t include the loop I am trying to achieve where the code takes the item’created_at field (date/time of current tweet) and takes it away from the next item.created_at field.

If anyone can point me in the right direction with how I can get my code working, I would be really grateful. i am working on the basis that 3x s == 1 second.

To clarify, if a user tweets at 1.05pm and then again at 1.07pm, there would be 120 seconds of empty space ie. 120seconds * 3 characters = 360 blank spaces between the 2 tweets. Hope it all makes sense.

Thanks,
David

ADDED INFO: Imagine someone continuously tweeting. The page will be full of text. However in reality, someone only tweets every so often. The space after the tweet (until their next one) will be of a size which represents what they could have typed in that time. Eg. I type a tweet, and don’t tweet again for 10 minutes. Visualised on my page will be this last tweet, but the previous one will appear 1800 blank spaces after that (10 minutes * 60 seconds * 3 characters per second = 1800 blank spaces). What i can retrieve is the date of the tweet at time of need, but what I am having trouble with is getting the time of the next tweet to determine the gap at the stage of presenting the information in this manner. I can’t really illustrate the concept any clearer than that.

  • 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-21T17:26:39+00:00Added an answer on May 21, 2026 at 5:26 pm

    I think your question is clear.

    See if this solution works :-

           function getTweets() {
                html += "<pre>";
                $.each(data, function(i, item) {
                    html += item.text; // add tweet
                    var timeCreated = new Date(item.created_at); // date of tweet
                    if( (i+1) in data)
                    {
                    var timeTillNextTweet = new Date( data[ i+1 ].created_at);
    
                    var timeDiff = timeTillNextTweet.getTime() - timeCreated.getTime();
                    var secondsDifference = Math.floor(timeDiff/1000);
    
                    // use secondsDifference to generate the spaces..
                    }
                });
                html += "</pre>";
            }
    

    hope this helps.

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

Sidebar

Related Questions

I am trying to build a page that will allow me to take an
I'm trying to build a Web page that has a rich text editor. Is
I am trying to build a simple page that will show book information, I
I'm trying to build a page on my personal website that both used jQuery
I'm trying to build a control logic that depends on the current gsp page
I am trying to build a simple FAQ page with answers that slideDown and
I'm trying to build a very simple bit of javascript that reads and displays
I'm trying to build an ASP.NET page that can crawl web pages and display
I am trying to build an estimates page and need to send via email
I'm trying to build a list page like the one in the Computers sample.

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.