Skip to content

Commit

Permalink
old browser JSONP fixes
Browse files Browse the repository at this point in the history
-dont use allorigins for subway anymore, getting XML instead of JSON
 nowadays b/c Accept header can't be controlled
 gnuns/allOrigins#116

-dumb.js rmv dup line, from day 1 on blame
  • Loading branch information
bulk88 committed Dec 28, 2022
1 parent e5580d5 commit fdb6c9c
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ac.appcache
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CACHE MANIFEST
# v Wed Dec 28 02:40:59 2022
# v Wed Dec 28 05:39:19 2022

CACHE:
1p.js
Expand Down
6 changes: 4 additions & 2 deletions cloudflare_as_name.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ async function handleRequest(request, event) {
}
});
}
else if (pathname_callback.startsWith('/li/api/')) {
var resp = fetch("http://backend-unified.mylirr.org/arrivals/" + pathname_callback.substring(8), {
else if (pathname_callback.startsWith('/api/')) {
var resp = fetch((pathname_callback.substr(5,3) === 'su/' // 'li/' othr choice
? 'http://otp-mta-prod.camsys-apps.com/otp/routers/default/nearby?timerange=1800&apikey=Z276E3rCeTzOQEoBPPN4JCEc6GfvdnYE&stops=MTASBWY:'
: "http://backend-unified.mylirr.org/arrivals/") + pathname_callback.substring(8), {
headers: { //LIRR server errors otherwise
'accept-version': '1.5'
}
Expand Down
2 changes: 1 addition & 1 deletion cloudflare_as_name.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ac.appcache
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CACHE MANIFEST
# v Wed Dec 28 02:40:59 2022
# v Wed Dec 28 05:39:19 2022

CACHE:
1p.js
Expand Down
2 changes: 1 addition & 1 deletion docs/dumb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/li/stop.htm
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<meta content=0 name=mobileoptimized><meta content=no-referrer name=referrer><link href=//backend-unified.mylirr.org rel=dns-prefetch><link href=//backend-unified.mylirr.org rel=preconnect>No javascript<script>var x=this.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),s,t,i={"":"Meadowlands",ABT:"Albertson",ADL:"Auburndale",AGT:"Amagansett",ATL:"Atlantic Terminal",AVL:"Amityville",BDY:"Broadway",BHN:"Bridgehampton",BK:"Stony Brook",BMR:"Bellmore",BOL:"Bolands-Employees",BPG:"Bethpage",BPT:"Bellport",BRS:"Bellerose",BRT:"Belmont Park",BSD:"Bayside",BSR:"Bay Shore",BTA:"Babylon",BWD:"Brentwood",BWN:"Baldwin",CAV:"Centre Av",CHT:"Cedarhurst",CI:"Central Islip",CLP:"Country Life Press",CPG:"Copiague",CPL:"Carle Place",CSH:"Cold Spring Harbor",DGL:"Douglaston",DPK:"Deer Park",EHN:"East Hampton",ENY:"East New York",ERY:"East Rockaway",EWN:"East Williston",FHL:"Forest Hills",FLS:"Flushing Main Street",FMD:"Farmingdale",FPK:"Floral Park",FPT:"Freeport",FRY:"Far Rockaway",GBN:"Gibson",GCV:"Glen Cove",GCY:"Garden City",GHD:"Glen Head",GNK:"Great Neck",GPT:"Greenport",GRV:"Great River",GST:"Glen Street",GVL:"Greenvale",GWN:"Greenlawn",HBY:"Hampton Bays",HEM:"Hempstead",HGN:"Hempstead Gardens",HIL:"Hillside-Employees",HOL:"Hollis",HPA:"Hunterspoint Av",HUN:"Huntington",HVL:"Hicksville",HWT:"Hewlett",IPK:"Island Park",ISP:"Islip",IWD:"Inwood",JAM:"Jamaica",KGN:"Kew Gardens",KPK:"Kings Park",LBH:"Long Beach",LCE:"Lawrence",LHT:"Lindenhurst",LIC:"Long Island City",LMR:"Locust Manor",LNK:"Little Neck",LTN:"Laurelton",LVL:"Locust Valley",LVW:"Lakeview",LYN:"Lynbrook",MAK:"Mattituck",MAV:"Merillon Avenue",MFD:"Medford",MHL:"Murray Hill",MHT:"Manhasset",MIN:"Mineola",MPK:"Massapequa Park",MQA:"Massapequa",MRK:"Merrick",MSY:"Mastic-Shirley",MTK:"Montauk",MVN:"Malverne",NAV:"Nostrand Av",NBD:"Nassau Blvd",NHP:"New Hyde Park",NPT:"Northport",NYK:"Penn Station",OBY:"Oyster Bay",ODE:"Oceanside",ODL:"Oakdale",PDM:"Plandome",PGE:"Patchogue",PJN:"Port Jefferson",PLN:"Pinelawn",PWS:"Port Washington",QVG:"Queens Village",RHD:"Riverhead",RON:"Ronkonkoma",ROS:"Rosedale",RSN:"Roslyn",RVC:"Rockville Centre",SAB:"St. Albans",SCF:"Sea Cliff",SFD:"Seaford",SHD:"Southold",SHN:"Southampton",SJM:"St. James",SMR:"Stewart Manor",SPK:"Speonk",SSM:"Mets-Willets Point",STN:"Smithtown",SVL:"Sayville",SYT:"Syosset",VSM:"Valley Stream",WBY:"Westbury",WDD:"Woodside",WGH:"Wantagh",WHD:"West Hempstead",WHN:"Westhampton",WMR:"Woodmere",WWD:"Westwood",WYD:"Wyandanch",YPK:"Yaphank"},n=location.hash;function e(e){e=("object"==typeof(e=e.contents||e)?e:this.JSON?JSON.parse(e):eval("0,"+e)).arrivals;for(var a,t="West<br>",n,o,r=(new Date).toLocaleTimeString("en-US")+(s?" via JSONP":" via CORS")+"<br>Cur Sta: "+i[location.hash.substring(1)]+"<br>East<br>",a=0;a<e.length;a++)n=e[a],o=new Date(1e3*(o=n.time)).toLocaleTimeString().replace(":00 "," ")+"-Min "+Math.ceil((o-(new Date).getTime()/1e3)/60)+"-Tk"+(n.track||"?")+"-<font color="+{11:"60269E",12:"4D5357",BY:"00985F",FR:"6E3219",HM:"CE8E00",LB:"FF6319",MK:"00B2A9",OB:"00AF3F",PJ:"006EC7",PW:"C60C30",RK:"A626AA",WH:"00A1DE"}[n.branch]+">"+i[(o=n.stops)[o.length-1]]+"</font><br>","E"==n.direction?r+=o:t+=o;document.body.innerHTML+=r+t}function a(e){try{if(s)throw 0;x.open("get",t,1);try{x.responseType="json"}catch(a){}x.onreadystatechange=r,x.setRequestHeader("accept-version","1.5"),e&&x.setRequestHeader("if-modified-since",new Date(0)),x.send()}catch(a){o()}document.body.innerHTML=n}function o(){var e=document.createElement("script");e.src="/li/api/"+location.hash.substring(1)+"?callback=e",1<(s=document.getElementsByTagName("head")[0]).childNodes.length&&s.removeChild(s.childNodes[1]),s.appendChild(e)}function r(){4==x.readyState&&(200==x.status?"withCredentials"in x||x.getResponseHeader("Date")?e(x.response):a(1):alert("error HTTP status "+x.status))}""!=n&&"#"!=n&&(t="//backend-unified.mylirr.org/arrivals/"+n.substring(1),n="<a href=javascript:history.back()>Back</a> Refresh[<a href=javascript:a()>Fast</a> <a href=\"javascript:location.replace('stop_.htm"+n+"')\">Slow</a>] <a href="+t+">Raw</a><br>"),t?a():document.body.innerHTML="No station specified in url anchor."</script>
<meta content=0 name=mobileoptimized><meta content=no-referrer name=referrer><link href=//backend-unified.mylirr.org rel=dns-prefetch><link href=//backend-unified.mylirr.org rel=preconnect>No javascript<script>var x=this.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),s,t,i={"":"Meadowlands",ABT:"Albertson",ADL:"Auburndale",AGT:"Amagansett",ATL:"Atlantic Terminal",AVL:"Amityville",BDY:"Broadway",BHN:"Bridgehampton",BK:"Stony Brook",BMR:"Bellmore",BOL:"Bolands-Employees",BPG:"Bethpage",BPT:"Bellport",BRS:"Bellerose",BRT:"Belmont Park",BSD:"Bayside",BSR:"Bay Shore",BTA:"Babylon",BWD:"Brentwood",BWN:"Baldwin",CAV:"Centre Av",CHT:"Cedarhurst",CI:"Central Islip",CLP:"Country Life Press",CPG:"Copiague",CPL:"Carle Place",CSH:"Cold Spring Harbor",DGL:"Douglaston",DPK:"Deer Park",EHN:"East Hampton",ENY:"East New York",ERY:"East Rockaway",EWN:"East Williston",FHL:"Forest Hills",FLS:"Flushing Main Street",FMD:"Farmingdale",FPK:"Floral Park",FPT:"Freeport",FRY:"Far Rockaway",GBN:"Gibson",GCV:"Glen Cove",GCY:"Garden City",GHD:"Glen Head",GNK:"Great Neck",GPT:"Greenport",GRV:"Great River",GST:"Glen Street",GVL:"Greenvale",GWN:"Greenlawn",HBY:"Hampton Bays",HEM:"Hempstead",HGN:"Hempstead Gardens",HIL:"Hillside-Employees",HOL:"Hollis",HPA:"Hunterspoint Av",HUN:"Huntington",HVL:"Hicksville",HWT:"Hewlett",IPK:"Island Park",ISP:"Islip",IWD:"Inwood",JAM:"Jamaica",KGN:"Kew Gardens",KPK:"Kings Park",LBH:"Long Beach",LCE:"Lawrence",LHT:"Lindenhurst",LIC:"Long Island City",LMR:"Locust Manor",LNK:"Little Neck",LTN:"Laurelton",LVL:"Locust Valley",LVW:"Lakeview",LYN:"Lynbrook",MAK:"Mattituck",MAV:"Merillon Avenue",MFD:"Medford",MHL:"Murray Hill",MHT:"Manhasset",MIN:"Mineola",MPK:"Massapequa Park",MQA:"Massapequa",MRK:"Merrick",MSY:"Mastic-Shirley",MTK:"Montauk",MVN:"Malverne",NAV:"Nostrand Av",NBD:"Nassau Blvd",NHP:"New Hyde Park",NPT:"Northport",NYK:"Penn Station",OBY:"Oyster Bay",ODE:"Oceanside",ODL:"Oakdale",PDM:"Plandome",PGE:"Patchogue",PJN:"Port Jefferson",PLN:"Pinelawn",PWS:"Port Washington",QVG:"Queens Village",RHD:"Riverhead",RON:"Ronkonkoma",ROS:"Rosedale",RSN:"Roslyn",RVC:"Rockville Centre",SAB:"St. Albans",SCF:"Sea Cliff",SFD:"Seaford",SHD:"Southold",SHN:"Southampton",SJM:"St. James",SMR:"Stewart Manor",SPK:"Speonk",SSM:"Mets-Willets Point",STN:"Smithtown",SVL:"Sayville",SYT:"Syosset",VSM:"Valley Stream",WBY:"Westbury",WDD:"Woodside",WGH:"Wantagh",WHD:"West Hempstead",WHN:"Westhampton",WMR:"Woodmere",WWD:"Westwood",WYD:"Wyandanch",YPK:"Yaphank"},n=location.hash;function e(e){e=("object"==typeof(e=e.contents||e)?e:this.JSON?JSON.parse(e):eval("0,"+e)).arrivals;for(var a,t="West<br>",n,o,r=(new Date).toLocaleTimeString("en-US")+(s?" via JSONP":" via CORS")+"<br>Cur Sta: "+i[location.hash.substring(1)]+"<br>East<br>",a=0;a<e.length;a++)n=e[a],o=new Date(1e3*(o=n.time)).toLocaleTimeString().replace(":00 "," ")+"-Min "+Math.ceil((o-(new Date).getTime()/1e3)/60)+"-Tk"+(n.track||"?")+"-<font color="+{11:"60269E",12:"4D5357",BY:"00985F",FR:"6E3219",HM:"CE8E00",LB:"FF6319",MK:"00B2A9",OB:"00AF3F",PJ:"006EC7",PW:"C60C30",RK:"A626AA",WH:"00A1DE"}[n.branch]+">"+i[(o=n.stops)[o.length-1]]+"</font><br>","E"==n.direction?r+=o:t+=o;document.body.innerHTML+=r+t}function a(e){try{if(s)throw 0;x.open("get",t,1);try{x.responseType="json"}catch(a){}x.onreadystatechange=r,x.setRequestHeader("accept-version","1.5"),e&&x.setRequestHeader("if-modified-since",new Date(0)),x.send()}catch(a){o()}document.body.innerHTML=n}function o(){var e=document.createElement("script");e.src="/api/li/"+location.hash.substring(1)+"?callback=e",1<(s=document.getElementsByTagName("head")[0]).childNodes.length&&s.removeChild(s.childNodes[1]),s.appendChild(e)}function r(){4==x.readyState&&(200==x.status?"withCredentials"in x||x.getResponseHeader("Date")?e(x.response):a(1):alert("error HTTP status "+x.status))}""!=n&&"#"!=n&&(t="//backend-unified.mylirr.org/arrivals/"+n.substring(1),n="<a href=javascript:history.back()>Back</a> Refresh[<a href=javascript:a()>Fast</a> <a href=\"javascript:location.replace('stop_.htm"+n+"')\">Slow</a>] <a href="+t+">Raw</a><br>"),t?a():document.body.innerHTML="No station specified in url anchor."</script>
2 changes: 1 addition & 1 deletion docs/li/stop_.htm
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<meta content=0 name=mobileoptimized><meta content=no-referrer name=referrer><link href=//backend-unified.mylirr.org rel=dns-prefetch><link href=//backend-unified.mylirr.org rel=preconnect>No javascript<script>var x=this.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),s,t,i={"":"Meadowlands",ABT:"Albertson",ADL:"Auburndale",AGT:"Amagansett",ATL:"Atlantic Terminal",AVL:"Amityville",BDY:"Broadway",BHN:"Bridgehampton",BK:"Stony Brook",BMR:"Bellmore",BOL:"Bolands-Employees",BPG:"Bethpage",BPT:"Bellport",BRS:"Bellerose",BRT:"Belmont Park",BSD:"Bayside",BSR:"Bay Shore",BTA:"Babylon",BWD:"Brentwood",BWN:"Baldwin",CAV:"Centre Av",CHT:"Cedarhurst",CI:"Central Islip",CLP:"Country Life Press",CPG:"Copiague",CPL:"Carle Place",CSH:"Cold Spring Harbor",DGL:"Douglaston",DPK:"Deer Park",EHN:"East Hampton",ENY:"East New York",ERY:"East Rockaway",EWN:"East Williston",FHL:"Forest Hills",FLS:"Flushing Main Street",FMD:"Farmingdale",FPK:"Floral Park",FPT:"Freeport",FRY:"Far Rockaway",GBN:"Gibson",GCV:"Glen Cove",GCY:"Garden City",GHD:"Glen Head",GNK:"Great Neck",GPT:"Greenport",GRV:"Great River",GST:"Glen Street",GVL:"Greenvale",GWN:"Greenlawn",HBY:"Hampton Bays",HEM:"Hempstead",HGN:"Hempstead Gardens",HIL:"Hillside-Employees",HOL:"Hollis",HPA:"Hunterspoint Av",HUN:"Huntington",HVL:"Hicksville",HWT:"Hewlett",IPK:"Island Park",ISP:"Islip",IWD:"Inwood",JAM:"Jamaica",KGN:"Kew Gardens",KPK:"Kings Park",LBH:"Long Beach",LCE:"Lawrence",LHT:"Lindenhurst",LIC:"Long Island City",LMR:"Locust Manor",LNK:"Little Neck",LTN:"Laurelton",LVL:"Locust Valley",LVW:"Lakeview",LYN:"Lynbrook",MAK:"Mattituck",MAV:"Merillon Avenue",MFD:"Medford",MHL:"Murray Hill",MHT:"Manhasset",MIN:"Mineola",MPK:"Massapequa Park",MQA:"Massapequa",MRK:"Merrick",MSY:"Mastic-Shirley",MTK:"Montauk",MVN:"Malverne",NAV:"Nostrand Av",NBD:"Nassau Blvd",NHP:"New Hyde Park",NPT:"Northport",NYK:"Penn Station",OBY:"Oyster Bay",ODE:"Oceanside",ODL:"Oakdale",PDM:"Plandome",PGE:"Patchogue",PJN:"Port Jefferson",PLN:"Pinelawn",PWS:"Port Washington",QVG:"Queens Village",RHD:"Riverhead",RON:"Ronkonkoma",ROS:"Rosedale",RSN:"Roslyn",RVC:"Rockville Centre",SAB:"St. Albans",SCF:"Sea Cliff",SFD:"Seaford",SHD:"Southold",SHN:"Southampton",SJM:"St. James",SMR:"Stewart Manor",SPK:"Speonk",SSM:"Mets-Willets Point",STN:"Smithtown",SVL:"Sayville",SYT:"Syosset",VSM:"Valley Stream",WBY:"Westbury",WDD:"Woodside",WGH:"Wantagh",WHD:"West Hempstead",WHN:"Westhampton",WMR:"Woodmere",WWD:"Westwood",WYD:"Wyandanch",YPK:"Yaphank"},n=location.hash;function e(e){e=("object"==typeof(e=e.contents||e)?e:this.JSON?JSON.parse(e):eval("0,"+e)).arrivals;for(var a,t="West<br>",n,o,r=(new Date).toLocaleTimeString("en-US")+(s?" via JSONP":" via CORS")+"<br>Cur Sta: "+i[location.hash.substring(1)]+"<br>East<br>",a=0;a<e.length;a++)n=e[a],o=new Date(1e3*(o=n.time)).toLocaleTimeString().replace(":00 "," ")+"-Min "+Math.ceil((o-(new Date).getTime()/1e3)/60)+"-Tk"+(n.track||"?")+"-<font color="+{11:"60269E",12:"4D5357",BY:"00985F",FR:"6E3219",HM:"CE8E00",LB:"FF6319",MK:"00B2A9",OB:"00AF3F",PJ:"006EC7",PW:"C60C30",RK:"A626AA",WH:"00A1DE"}[n.branch]+">"+i[(o=n.stops)[o.length-1]]+"</font><br>","E"==n.direction?r+=o:t+=o;document.body.innerHTML+=r+t}function a(e){try{if(s)throw 0;x.open("get",t,1);try{x.responseType="json"}catch(a){}x.onreadystatechange=r,x.setRequestHeader("accept-version","1.5"),e&&x.setRequestHeader("if-modified-since",new Date(0)),x.send()}catch(a){o()}document.body.innerHTML=n}function o(){var e=document.createElement("script");e.src="/li/api/"+location.hash.substring(1)+"?callback=e",1<(s=document.getElementsByTagName("head")[0]).childNodes.length&&s.removeChild(s.childNodes[1]),s.appendChild(e)}function r(){4==x.readyState&&(200==x.status?"withCredentials"in x||x.getResponseHeader("Date")?e(x.response):a(1):alert("error HTTP status "+x.status))}""!=n&&"#"!=n&&(t="//backend-unified.mylirr.org/arrivals/"+n.substring(1),n="<a href=javascript:history.back()>Back</a> Refresh[<a href=javascript:a()>Fast</a> <a href=\"javascript:location.replace('stop.htm"+n+"')\">Slow</a>] <a href="+t+">Raw</a><br>"),t?a():document.body.innerHTML="No station specified in url anchor."</script>
<meta content=0 name=mobileoptimized><meta content=no-referrer name=referrer><link href=//backend-unified.mylirr.org rel=dns-prefetch><link href=//backend-unified.mylirr.org rel=preconnect>No javascript<script>var x=this.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),s,t,i={"":"Meadowlands",ABT:"Albertson",ADL:"Auburndale",AGT:"Amagansett",ATL:"Atlantic Terminal",AVL:"Amityville",BDY:"Broadway",BHN:"Bridgehampton",BK:"Stony Brook",BMR:"Bellmore",BOL:"Bolands-Employees",BPG:"Bethpage",BPT:"Bellport",BRS:"Bellerose",BRT:"Belmont Park",BSD:"Bayside",BSR:"Bay Shore",BTA:"Babylon",BWD:"Brentwood",BWN:"Baldwin",CAV:"Centre Av",CHT:"Cedarhurst",CI:"Central Islip",CLP:"Country Life Press",CPG:"Copiague",CPL:"Carle Place",CSH:"Cold Spring Harbor",DGL:"Douglaston",DPK:"Deer Park",EHN:"East Hampton",ENY:"East New York",ERY:"East Rockaway",EWN:"East Williston",FHL:"Forest Hills",FLS:"Flushing Main Street",FMD:"Farmingdale",FPK:"Floral Park",FPT:"Freeport",FRY:"Far Rockaway",GBN:"Gibson",GCV:"Glen Cove",GCY:"Garden City",GHD:"Glen Head",GNK:"Great Neck",GPT:"Greenport",GRV:"Great River",GST:"Glen Street",GVL:"Greenvale",GWN:"Greenlawn",HBY:"Hampton Bays",HEM:"Hempstead",HGN:"Hempstead Gardens",HIL:"Hillside-Employees",HOL:"Hollis",HPA:"Hunterspoint Av",HUN:"Huntington",HVL:"Hicksville",HWT:"Hewlett",IPK:"Island Park",ISP:"Islip",IWD:"Inwood",JAM:"Jamaica",KGN:"Kew Gardens",KPK:"Kings Park",LBH:"Long Beach",LCE:"Lawrence",LHT:"Lindenhurst",LIC:"Long Island City",LMR:"Locust Manor",LNK:"Little Neck",LTN:"Laurelton",LVL:"Locust Valley",LVW:"Lakeview",LYN:"Lynbrook",MAK:"Mattituck",MAV:"Merillon Avenue",MFD:"Medford",MHL:"Murray Hill",MHT:"Manhasset",MIN:"Mineola",MPK:"Massapequa Park",MQA:"Massapequa",MRK:"Merrick",MSY:"Mastic-Shirley",MTK:"Montauk",MVN:"Malverne",NAV:"Nostrand Av",NBD:"Nassau Blvd",NHP:"New Hyde Park",NPT:"Northport",NYK:"Penn Station",OBY:"Oyster Bay",ODE:"Oceanside",ODL:"Oakdale",PDM:"Plandome",PGE:"Patchogue",PJN:"Port Jefferson",PLN:"Pinelawn",PWS:"Port Washington",QVG:"Queens Village",RHD:"Riverhead",RON:"Ronkonkoma",ROS:"Rosedale",RSN:"Roslyn",RVC:"Rockville Centre",SAB:"St. Albans",SCF:"Sea Cliff",SFD:"Seaford",SHD:"Southold",SHN:"Southampton",SJM:"St. James",SMR:"Stewart Manor",SPK:"Speonk",SSM:"Mets-Willets Point",STN:"Smithtown",SVL:"Sayville",SYT:"Syosset",VSM:"Valley Stream",WBY:"Westbury",WDD:"Woodside",WGH:"Wantagh",WHD:"West Hempstead",WHN:"Westhampton",WMR:"Woodmere",WWD:"Westwood",WYD:"Wyandanch",YPK:"Yaphank"},n=location.hash;function e(e){e=("object"==typeof(e=e.contents||e)?e:this.JSON?JSON.parse(e):eval("0,"+e)).arrivals;for(var a,t="West<br>",n,o,r=(new Date).toLocaleTimeString("en-US")+(s?" via JSONP":" via CORS")+"<br>Cur Sta: "+i[location.hash.substring(1)]+"<br>East<br>",a=0;a<e.length;a++)n=e[a],o=new Date(1e3*(o=n.time)).toLocaleTimeString().replace(":00 "," ")+"-Min "+Math.ceil((o-(new Date).getTime()/1e3)/60)+"-Tk"+(n.track||"?")+"-<font color="+{11:"60269E",12:"4D5357",BY:"00985F",FR:"6E3219",HM:"CE8E00",LB:"FF6319",MK:"00B2A9",OB:"00AF3F",PJ:"006EC7",PW:"C60C30",RK:"A626AA",WH:"00A1DE"}[n.branch]+">"+i[(o=n.stops)[o.length-1]]+"</font><br>","E"==n.direction?r+=o:t+=o;document.body.innerHTML+=r+t}function a(e){try{if(s)throw 0;x.open("get",t,1);try{x.responseType="json"}catch(a){}x.onreadystatechange=r,x.setRequestHeader("accept-version","1.5"),e&&x.setRequestHeader("if-modified-since",new Date(0)),x.send()}catch(a){o()}document.body.innerHTML=n}function o(){var e=document.createElement("script");e.src="/api/li/"+location.hash.substring(1)+"?callback=e",1<(s=document.getElementsByTagName("head")[0]).childNodes.length&&s.removeChild(s.childNodes[1]),s.appendChild(e)}function r(){4==x.readyState&&(200==x.status?"withCredentials"in x||x.getResponseHeader("Date")?e(x.response):a(1):alert("error HTTP status "+x.status))}""!=n&&"#"!=n&&(t="//backend-unified.mylirr.org/arrivals/"+n.substring(1),n="<a href=javascript:history.back()>Back</a> Refresh[<a href=javascript:a()>Fast</a> <a href=\"javascript:location.replace('stop.htm"+n+"')\">Slow</a>] <a href="+t+">Raw</a><br>"),t?a():document.body.innerHTML="No station specified in url anchor."</script>
Loading

0 comments on commit fdb6c9c

Please sign in to comment.