-
Notifications
You must be signed in to change notification settings - Fork 0
/
status_.htm
1 lines (1 loc) · 4.76 KB
/
status_.htm
1
<meta content=0 name=mobileoptimized><meta content=no-referrer name=referrer><link href="//collector-otp-prod.camsys-apps.com/realtime/gtfsrt/ALL/alerts?type=json&apikey=qeqy84JE7hUKfaI0Lxm2Ttcm6ZA0bYrP"rel=preload crossorigin as=fetch><link href=//collector-otp-prod.camsys-apps.com rel=preconnect crossorigin><link href=//collector-otp-prod.camsys-apps.com rel=dns-prefetch><script async defer src=routes.js></script><script>var R</script><style>:root{color-scheme:light dark}</style>No javascript<script>"use strict";!function(){var M,B,r=["00933c","ff6319","fccc0a","6d6e71","ee352e","286ded","0078c6","996633","b933ad"],a={F:1,D:1,M:1,FX:1,B:1,N:2,Q:2,R:2,W:2,H:3,GS:3,FS:3,S:3,1:4,3:4,2:4,A:5,C:5,E:5,SI:6,SIR:6,J:7,Z:7,"7X":8,7:8,G:"6cbe45",L:"a7a9ac"},n=window,e=location,O=document,o=O.documentElement.firstChild;function y(t){function e(t){200!=t.status?alert("error http status "+t.status):t.json().then(function(t,e){M=e,B=function(t){for(var e,r,a,n,o,i,s,c={},l=Math.round(Date.now()/1e3),u=0;u<t.length;u++){e=t[u],r=0;try{if((a=e.alert["transit_realtime.mercury_alert"])&&e.alert.active_period){var h="undefined"!=typeof a.display_before_active;if(~e.id.indexOf("planned_work")&&!h)r=0;else for(o=e.alert.active_period,n=0;n<o.length;n++)(i=o[n]).start&&!r&&(s=i.start,h&&(s-=a.display_before_active),s<l&&(r=1),i.end)&&l>i.end&&(r=0)}}catch(p){}if(r)for(o=e.alert.informed_entity,n=0;n<o.length;n++)(r=(i=o[n]).route_id)&&(r=r.toLowerCase(),(s=(s=c[i.agency_id]=c[i.agency_id]||{})[r]=s[r]||[]).push(e))}return c}(t.entity),R?i():R=i})}(t=n.S)&&(n.S=0,""==t.s)&&Date.now()-t.t<3e3?t.f(e):fetch("//collector-otp-prod.camsys-apps.com/realtime/gtfsrt/ALL/alerts?type=json&apikey=qeqy84JE7hUKfaI0Lxm2Ttcm6ZA0bYrP").then(e),0===R&&(o.appendChild(O.createElement("script")).src="routes.js"),O.body.innerHTML='<a href=javascript:history.back()>Back</a> Refresh[<a href="javascript:y();void 0">Fast</a> <a href="javascript:location.replace(\'status.htm\')">Slow</a>] <a href=//collector-otp-prod.camsys-apps.com/realtime/gtfsrt/ALL/alerts?type=json&apikey=qeqy84JE7hUKfaI0Lxm2Ttcm6ZA0bYrP>Raw</a><br>'}function N(t,e){return"<font color="+("string"!=typeof(t=a[e])?a[e]=r[0|t]:t)+">["+e+"]</font>"}function I(t){var e,r,a,n,o;if(t)for(o=(t=t.translation).length;a=t[--o];){if(n=a.text,"en-html"===(a=a.language))return n;"en"===a?e=n:r=n}return e||r||""}function k(t){return t?t.replace(/(\xE2\x80\u0152)|(<p style="min-height:10px"><\/p>)|(^<p>)|((<p><\/p>|<\/p>)+$)/g,"").replace(/\[(\w+)\]/g,N):""}function i(){function i(t,e){return e[1]-t[1]}function t(t,c,l){return t.forEach(function(t){var e,r,a,n,o,i=(""+t[0]).toLowerCase(),s=l[t[2]||0];if(e=(e=c[s])&&e[i]){for(r=0;r<e.length;r++)n=(a=e[r]).alert.informed_entity.find(function(t){return t.agency_id===s&&t.route_id.toLowerCase()==i?1:0}),e[r]=[(o=a.alert["transit_realtime.mercury_alert"])?o.alert_type:"No Status Summary",(o=-10,o=(n=(n=(n=n)["transit_realtime.mercury_entity_selector"])&&n.sort_order)?(o=n.split(":")[2])?+o:100:o),I(a.alert.header_text),I(a.alert.description_text),I(a.alert["transit_realtime.mercury_alert"].human_readable_active_period)];t[4]=e}}),t}function e(t){t.sort(function(t,e){return t[1]-e[1]})}function r(t,e){for(var r,a,n=0;n<e.length;n++){var o=e[n],i=o[4]?o[4][0][0]:"On or Close",s="On or Close"!=i,c="";if(s){for(c=o[4],a=0;a<c.length;a++)r=c[a],c[a]="<b>"+r[0]+"</b><br>"+k(r[2])+(r[4]?"<br>"+r[4]:"")+"<br>"+k(r[3]);c=c.join("<hr>")}e[n]="<hr>"+(s?"<details><summary>":"")+"<font color="+o[1]+">"+(o[3]||("+"==(a=o[0].indexOf("BX")?o[0]:"Bx"+o[0].slice(2)).slice(-1)?a.slice(0,-1)+"-SBS":a))+"</font> "+i+(s?"</summary>"+c+"</details>":"")}return"<hr>"+t+"<br>"+e.join("")}for(var a,n,o,s,c,l,u,h,p,d,m=(new Date).toLocaleTimeString("en-US")+(M?" via JSONP":" via CORS")+"<br>",_=[],b=[],g=[],v=[],j=[],C=(l=v,u=j,t(R[2],B,["MTASBWY"]).forEach(function(t){(t[4]?l:u).push(t)}),e(l),e(u),h=b,p=g,t(R[1],B,["LI","MNR"]).forEach(function(t){(t[2]?h:p).push(t),t[4]&&t[4].sort(i)}),d=_,t(R[0],B,["MTA NYCT","MTABC"]).forEach(function(t){t[4]&&(t[4].sort(i),d.push(t))}),function(t){for(var e,r,a,n={},o=0;o<t.length;o++)(e=t[o])[4].sort(i),(r=n[r=(a=e[4][0])[0]]=n[r]||[r,a[1],[]])[2].push(e);return Object.values(n).sort(i)}(v)),A=0;A<C.length;A++)for(m+="<hr>"+(a=C[A])[0]+"<br>",a=a[2],o=0;o<a.length;o++){for(m+="<details><summary>"+N(0,(n=a[o])[0])+"</summary>",n=n[4],s=0;s<n.length;s++)c=n[s],n[s]="<b>"+c[0]+"</b><br>"+k(c[2])+(c[4]?"<br>"+c[4]:"")+"<br>"+k(c[3]);m=m+n.join("<hr>")+"</details>"}if(j.length)for(m+="<hr>No Active Alerts<br>",A=0;A<j.length;A++)m+=N(0,j[A][0])+" ";m=(m=(m+=r("Metro-North Railroad",b))+r("Long Island Rail Road",g))+r("Bus",_),O.body.innerHTML+=m,R=B=0}n.y=y,n.onpopstate?onhashchange=y:(n.onpopstate=function(t){null!==t.state&&e.reload()},Object.values?y():o.appendChild(O.createElement("script")).src="f.js")}()</script>