Skip to content

Instantly share code, notes, and snippets.

@cemkozinoglu
Created June 29, 2011 18:51
Show Gist options
  • Save cemkozinoglu/1054582 to your computer and use it in GitHub Desktop.
Save cemkozinoglu/1054582 to your computer and use it in GitHub Desktop.
My Solution for Twitter
<!-- dont forget to include jQuery -->
{% if account.provider == 'twitter' %}
<script type="text/javascript">
$(function(){
$.ajax({
url : "http://api.twitter.com/1/users/show.json?user_id={{ account.uid }}",
dataType : "jsonp",
success : function(data)
{
$('#twi').html('<img src="' + data.profile_image_url + '" align="absmiddle"> ' + data.screen_name);
},
error : function()
{
},
});
});
</script>
<img src="http://icons.iconarchive.com/icons/jankoatwarpspeed/handycons-2/32/twitter-icon.png" align="absmiddle"> <span id="twi"></span>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment