treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Need HELP!

  • Im new to using JS, and what im trying to do, is make a twitter spy like this http://phaedrusdesign.com/temp/LinkSpy/
    but using the last new twitter posts using JSON API. i got a tutorial from there and i replaced the new.php in the javascript with a mytweets.php which is the page that loads the recents tweets, and im trying to make it cycle threw them and fade in and out but its not working. It was working when i had static DIVs to test it, but once i replaced that with the code to retrieve my twitter posts, its just blank, but when i goto mytweets.php manually, it shows 1 tweet when it should show the last 5. Can anyone help?

    http://moppieillusions.com/demowork/sdn/tweet/test.html This is the page that has the Spy script

    here is the code:
    <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">

    <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">

    <head>
    <title></title>

    <script language=\"javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js\" type=\"text/javascript\"></script>

    <script type=\"text/javascript\" src=\"jquery.js\"></script>
    <script type=\"text/javascript\" src=\"spy.js\"></script>


    <script type=\"text/javascript\">
    $(function() {
    /* returns a selection of HTML DIVs to be inserted in to
    the #spyContainer in a spy-style */
    $('#spyContainer > div:gt(5)').fadeEachDown(); // initial fade
    /* returns a selection of HTML DIVs to be inserted in to
    the #spyContainer in a spy-style */
    $('#spyContainer').spy({'ajax': 'mytweets.php',
    'limit': '12',
    'fadeInSpeed': '500',
    'fadeLast': '1',
    'timeout': 1000
    });
    });
    </script>

    </head>

    <body>




    <div id=\"spyContainer\">


    </div>



    </body>

    </html>


    http://moppieillusions.com/demowork/sdn ... tweets.php This is the page which loads my tweets

    Here is the code
    <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
    <html xmlns=\"http://www.w3.org/1999/xhtml\">

    <head>

    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />

    <title></title>

    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />



    <link href=\"jquery.tweet.css\" media=\"all\" rel=\"stylesheet\" type=\"text/css\"/>
    <link href=\"jquery.tweet.query.css\" media=\"all\" rel=\"stylesheet\" type=\"text/css\"/>
    <script language=\"javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js\" type=\"text/javascript\"></script>
    <script language=\"javascript\" src=\"jquery.tweet.js\" type=\"text/javascript\"></script>
    <script type='text/javascript'>
    jQuery(document).ready(function($) {
    $(\".tweet\").tweet({
    join_text: \"auto\",
    username: \"quickfire84\",
    avatar_size: 48,
    count: 3,
    auto_join_text_default: \"we said,\",
    auto_join_text_ed: \"we\",
    auto_join_text_ing: \"we were\",
    auto_join_text_reply: \"we replied\",
    auto_join_text_url: \"we were checking out\",
    loading_text: \"loading tweets...\"
    });
    })
    </script>

    </head>

    <body>

    <div class=\"tweet\"></div>

    </body>

    </html>


    If anyone can help me soon i would love it, only done a few things with jquery, and this is for a clients page. Thank You.