Skip to content

Instantly share code, notes, and snippets.

@ZJONSSON

ZJONSSON/index.html

Last active Jan 22, 2020
Embed
What would you like to do?
New York Traffic - Live
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<a style="font-size:10px" href="http://nyctmc.org/">Source: nyctmc.org</a><br>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
var cams = [252,263,644,494,200,489,488,486,485,484,487,261,251,102,491,258,497,400,203,430,431,290,429,428,432,305,466,299,465,446,448,304,401,447,440,439,444,443,441,355,354,352,350,349,468,469,455,424,425,427,281,551,335,116,434,550,105,106,285,286,438,337,194,348,548,538,547,530,524,536,523,527,526,517,532,535,539,529,528,521,531,537,525,519,533,318,325,324,339,340,445,464,496,341,178,143,166,442,643,642,641,419,329,330,420,421,426,202,201,635,481,127,108,269,268,266,609,509,508,505,504,503,506,502,510,279,280,140,163,603,604,605,606,611,459,457,458,453,500,495,175,173,188,247,615,616,450,483,482,303,302,294,182,157,129,264,570,571,572,555,560,562,564,565,566,563,567,556,569,568,558,573,561,557,191,296,297,467,470,475,111,184,386,397,399,273,613,614,612,122,187,289,186,473,309,492,316,317,516,515,514,511,512,418,416,412,407,404,415,413,408,417,146,145,185,436,320,315,314,633,627,634,630,631,632,628,402,590,589,581,598,594,592,582,591,600,597,593,596,599,595,583,586,198,331,171,170,232,213,212,356,369,371,373,374,357,377,378,359,361,617,622,624,625,623,618,347,207,189,197,602,601,183,323,322,321,195];
$.fn.update = function() {
return $(this).each(function() {
$(this).attr("src","http://207.251.86.238/cctv"+$(this).attr("data-cam")+".jpg?math=0."+(new Date()).valueOf());
});
};
while (cams.length) {
$("body").append(
$('<img>')
.attr("data-cam",cams.pop())
.attr("width",88)
.attr("height",60)
.update()
);
}
setInterval(function() {
$("img").update();
},10000);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment