Skip to content

Instantly share code, notes, and snippets.

@iamphill
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamphill/130d7fd77c4b6b4ea3a4 to your computer and use it in GitHub Desktop.
Save iamphill/130d7fd77c4b6b4ea3a4 to your computer and use it in GitHub Desktop.
Access Twitter timeline with JS

https://cdn.syndication.twimg.com/widgets/timelines/[WIDGET URL]?suppress_response_codes=true&callback=?

Create a Twitter embed widget and then take the ID number from URL and swap the [WIDGET URL] with this ID. Then just use as you wish to get access to the data. With jQuery I use..

$.getJSON('https://cdn.syndication.twimg.com/widgets/timelines/[WIDGET URL]?suppress_response_codes=true&callback=?', function (data) {
  var $html = $(d.body)
  // Do something with the return HTML
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment