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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:30:26+00:00 2026-05-24T06:30:26+00:00

Im trying to make a twitter feed for my website, however, I want do

  • 0

Im trying to make a twitter feed for my website, however, I want do display 3 of the most recent tweets but in different divs.

I have this code here… I have set up 3 vars with targets to the individual classes where each tweet will be stored.

My main problem is how to store the data for each tweet (i) in the loop. but this is not working… can someone tell me where im going wrong with this? Cheers

$(document).ready(function() {
    // Call the Twitter API to retrieve the last 3 tweets in JSON format for the pcpro Twitter account
    $.getJSON("http://twitter.com/statuses/user_timeline.json?screen_name=allaboutjames&count=3&callback=?", function(tweetdata) {      

        var t1 = $("#work-thumbs .tweet-1");
        var t2 = $("#work-thumbs .tweet-2");
        var t3 = $("#work-thumbs .tweet-3");

        // For each item returned in tweetdata
        $.each(tweetdata, function(i,tweet) {
            // Append the info in li tags to the ul, converting any links to HTML <a href=.. code and convert the tweeted date
            // to a more readable Twitter format
            t(i).append("<li>&ldquo;" + urlToLink(tweet.text) + "&rdquo;&ndash; " + relTime(tweet.created_at) + "</li>");
        });
    });
});
  • 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-24T06:30:26+00:00Added an answer on May 24, 2026 at 6:30 am

    t(i) won’t work. Try this instead:

    $(document).ready(function() {
        // Call the Twitter API to retrieve the last 3 tweets in JSON format for the pcpro Twitter account
        $.getJSON("http://twitter.com/statuses/user_timeline.json?screen_name=allaboutjames&count=3&callback=?", function(tweetdata) {      
            // For each item returned in tweetdata
            $.each(tweetdata, function(i,tweet) {
                // Append the info in li tags to the ul, converting any links to HTML <a href=.. code and convert the tweeted date
                // to a more readable Twitter format
                $("#work-thumbs .tweet-"+(1+i)).append("<li>&ldquo;" + urlToLink(tweet.text) + "&rdquo;&ndash; " + relTime(tweet.created_at) + "</li>");
            });
        });
    });
    

    Also notice that jQuery’s $.each() populates i with an indexInArray (beginning with 0).

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

Sidebar

Related Questions

I'm trying to make a link to update twitter status with a link..but it
I am trying to make an application which integrates facebook and twitter. I have
I'm trying to make an auto-complete function for twitter usernames. So far, I have
I am trying to make work twitter oAuth with twitterizer, but I am unable.
I am trying to make a twitter box with sliding tweets in jquery. For
I'm trying to make a twitter like system that scrolls through info slowly and
I am trying to make a simple twitter client in C. I'm new at
I'm trying to make an AJAX form that will update a twitter status when
I'm trying to make a simple way to post a tweet to twitter, nothing
I am trying to make Twitter work in my app and everything works fine

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.