Skip to main content
100%

js: load latest tweet

✓ Published0🌍 Public
BBraMKJ
Last edited Mar 27, 2013
Created on Mar 22, 2013

This example displays the most recent tweet from a specified Twitter account as a styled HTML blockquote, complete with the tweet’s text, a relative timestamp, and a user avatar with a caption. It fetches the data via jQuery’s `$.getJSON` from the Twitter REST API endpoint `statuses/user_timeline`, parsing URL links in the tweet text with a custom `parseURL` method and formatting the creation date using the `parseTwitterDate` function. The code then conditionally injects either an image-based figure or a text-only caption into the `.tweets li` element, relying on jQuery for DOM manipulation. No other visualization libraries are used; the rendering approach is plain HTML and CSS.

AI-generated description

Similar vizzes