Skip to content

scfrisby/twit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twit v0.0.5

Your Custom Twitter Widget : "Embed Tweets The Right Way"

DEMO

http://grayghostvisuals.koding.com/twit

TWIT'S RECIPE

index.html


<head>
<!-- jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.8.0.min.js"><\/script>')</script>

<!-- Twit -->
<script src="js/twit.js" async></script>
</head>

<body>
<!-- twit -->
<div id="twit-container">
    <ul id="twitter_update_list">
        <li id="twitter_feed"></li>
    </ul>
</div>
<!-- twit -->
</body>

USERNAME and TWIT DISPLAY SETUP

twit.js


// Load Twit
window.onload = function() {
    var ajax_load            = "<img class='twit-loader' src='img/loading.gif' alt='Loading...'>",
        twitter_preferences  = {
            count    : [enter_twit_count_here],
            username : '[username_goes here]'
        },
        twitterUrl = 'http://twitter.com/statuses/user_timeline.json?screen_name='   twitter_preferences.username   '&callback=twitterCallback&count='   twitter_preferences.count,
        script     = document.createElement('script');

    $("#twitter_feed").html(ajax_load);

    script.setAttribute('src', twitterUrl);
    script.setAttribute('async', true);

    document.body.appendChild(script);
};

GOTCHYAS

  1. Unauthenticated Twitter API calls are permitted 150 requests per hour https://dev.twitter.com/docs/rate-limiting

  2. Retweets and favorites will not display currently. Only single user tweets will display at the moment (this will eventually change)

IN THE PIPELINE

  1. jQuery Plugin → checkout our jQueryPlugin feature branch

  2. Due to unauthenticated Twitter API requests being limited to 150 per hour we're working out a way to cache them properly. Feel free to chime in if you have a better way or are great with Twitter's oAuth (350 per hour)

CONTRIBUTING REQUIREMENTS

  1. No Whitespace
  2. Play Nice
  3. Keep it simple stupid
  4. Use a clean branching model with forks (We use Gitflow Model w/SourceTree: Master → Develop → Feature → Hot Fix → Release)
  5. Don't shoot the bird

CONTRIBUTORS

We would like to thank the following contributors and their awesome-nesses...

Tim Pietrusky

  1. JSHint corrections (twit.js)
  2. Callback Function Rewrites (twit.js)
  3. Twitter API Unauthenticated calls research

About

Your Custom Twitter Widget : "Embed Tweets The Right Way"

Resources

Stars

Watchers

Forks

Packages

No packages published