Fork me on GitHub

Get Twitter profile data with jQuery ajax, super easy!

Update:The following technique is also available as a Hovercard plugin.

We’ll use Twitter REST API in json format to look up any twitter user by its username. We’ll create a twitter card for President Barack Obama (@barackobama) as an example:

Resource url 
We’ll make an ajax request to this url.

Ajax request:

    successfunction (data{
       //Profile name will be data[0].name 
       //Location will be data[0].location
       //Profile pic will be data[0].profile_image_url
       //Bio will be data[0].description
       //Tweets will be data[0].statuses_count
       //Followers will be data[0].followers_count
       //Visit for all options


Live Demo: (including html and css for twitter card)

1 note

  1. designwithpc posted this
blog comments powered by Disqus