Skip to content

Instantly share code, notes, and snippets.

@bsudekum
Created September 13, 2013 15:01
Show Gist options
  • Save bsudekum/6551870 to your computer and use it in GitHub Desktop.
Save bsudekum/6551870 to your computer and use it in GitHub Desktop.
Twitter timeline embed in popup
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.ie.css' rel='stylesheet' >
<![endif]-->
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'></div>
<script type='text/javascript'>
var map = L.mapbox.map('map', 'examples.map-20v6611k')
.setView([40, -74.50], 9);
L.marker([40,-74.50])
.bindPopup('<a class="twitter-timeline" href="https://twitter.com/bobws" data-widget-id="243383551444254720">Tweets by @bobws</a>')
.addTo(map)
.openPopup()
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment