/* 1. Paste this entire gist over at https://mrcoles.com/bookmarklet/ to generate a bookmarklet */ /* 2. If desired, update the default PATH station code and heading [line #9 below, but refer to line 12 for station codes */ /* 3. Use a meaningful (or fun!) name, like: "Simple PATH Times" or "🚊 Arrivals" */ /* 4. Drag the generated bookmarklet link to your Bookmarks Toolbar */ /* 6. Enjoy the clean, simple UI to browse PATH arrivals information */ function(){ sta = 'EXP'; dir = 'NY'; let da = ['NJ', 'NY']; let sa = new Map([["NWK", [0, "Newark"]], ["HAR", [1, "Harrison"]], ["JSQ", [2, "Journal Square"]], ["GRV", [3, "Grove Street"]], ["NEW", [4, "Newport / Pavonia"]], ["EXP", [5, "Exchange Place"]], ["HOB", [6, "Hoboken"]], ["WTC", [7, "World Trade Center"]], ["CHR", [8, "Christopher Street"]], ["09S", [9, "9th Street"]], ["14S", [10, "14th Street"]], ["23S", [11, "23rd Street"]], ["33S", [12, "33rd Street"]]]); w = window; d = w.document; b = d.body; u = 'https://www.panynj.gov/bin/portauthority/ridepath.json'; if (w.location.href.split('#')[0] != u) {alert('To use this bookmarklet, you must first navigate to:\n' + u + '\n\nYou will be taken there now. Once the page loads, click the bookmarklet again.' ); w.location.href = u; return; } w.gei = function(i) { return d.getElementById(i); }; w.rtt = function() { s = gei("ss").value; h = gei("sd").selectedIndex; jt = gei("jo").textContent; tt = ""; try { jd = JSON.parse(jt); if ((jd.results[s].destinations.length == 1) && (jd.results[s].destinations[0].label == "ToNY")) { h ^= 1; } jd.results[s].destinations[h].messages.forEach(t => {tt += `
| Train to | Arrives in | ||
| -------- | ---------- | ||