(Note: This post describes how to use bookmarklets (scripts saved as bookmarks) in connection with creating and using portable DING! URLs.
You must have JavaScript enabled for these (or any JavaScript bookmarklets) to work.)
To create your own portable DING! URL, follow these steps:
- Install DING! on a supported platform.
- When a DING! offer arrives, use the DING! application to view the offer.
- While a DING! offer page is displayed in the active window/tab, copy and paste this small script to the URL line of your browser:
Code:
javascript:var o=document.dingForm, i=o.installId.value, c=o.cksum.value,sURL='http://ding.southwest.com/cgi-bin/systray?action=[a]&installId=[id]&cksum=[cksum]'.replace('[id]',i).replace('[cksum]',c);document.write('<blockquote>','Your portable DING! URL'.link(sURL.replace('[a]','getMessages')+'&os=UnknownOS&version=1.05').replace('>Y',' target=_blank>Y'),'\n<p>','Your update registration URL'.link(sURL.replace('[a]','updateRegistrationForm')).replace('>Y',' target=_blank>Y'),'</blockquote>');document.close();
- A page with your two custom URLs will be displayed: your portable DING! URL, and a link to update your registered airport list. Email the displayed links to the computer or device on which you need to use them. (If the receiving address can handle it, you can copy and Email the entire page source. If not, right-click the URLs to Email them.)
The DING! server sends information to DING! via XML. When you use the portable DING! URL, therefore, you won't see a normal web page. The appearance will in fact vary pretty dramatically depending on the browser and platform used to display the XML data. (Try it on your DING!-enabled computer to see how it works.) To actually view the DING! offers you will need to locate the "activationUrl" in the displayed XML data, copy it, and paste it to the URL line of your browser. That process can get tedious day after day. You can make it easier with another bookmarklet to either:
- open the first or a specific offer;
- display a page with DING! "info" messages, hotlinked if applicable, and open all "offers" in their own tabs/windows;or
- repoll the server every 30 minutes like the DING! application does, and automatically display the offers once they go live;
Option #2 is probably best for most people, if your browser can handle it. If you use the following bookmarklet while viewing the DING! XML response page, available DING! fare offers will be opened; if offers are posted but not yet active an alert will let you know how long you have to wait to see the offer. "Info" headlines with no links (like schedule opening messages) will be displayed; "Info" offers with links such as recent ones from Chase and swavactions.com will be written as hot links on a separate page.This bookmarklet also notes how many seconds remain until activation if the headline has been posted but is not yet active.
Code:
javascript:function fn$(o,p){return o.getElementsByTagName(p)[0].textContent;}function fnShowDing(){var arrH,i,ln,t,y,w,msg='',url;arrH=document.getElementsByTagName('headline');for(i=0;i<arrH.length;i++){ln=fn$(arrH[i],'activationText');y=fn$(arrH[i],'type');url=fn$(arrH[i],'activationUrl');if(y=='offer'){s=fn$(arrH[i],'activationNewDelta');if(s>0){alert('Offer #'+i+' viewable in '+s+' seconds');}else{window.open(url);}}else{if(url.length>0){ln=ln.link(url);msg=msg+ln+'<br>\n';}else{alert(ln);}}}if(msg.length>0){w=window.open();w.document.write(msg.small());w.document.close();}}void(fnShowDing())
That bookmarklet may be a few characters too long for at least some versions of IE and perhaps for mobile device browsers. For that or some other reason you might need to limit yourself to option #1 above. The following ultra-basic bookmarklet opens the first offer found in the DING! XML response data:
Code:
javascript:var i=1,strURL=document.getElementsByTagName('activationUrl')[i-1].firstChild.nodeValue; window.location=strURL
This basic DING! offer opener bookmarklet should work in all browsers and on all devices. Sometimes there are multiple DING! activation URLs. To only open an offer other than the first offer, change the value of i at the beginning of the script, as in the following example, which opens the second offer:
Code:
javascript:var i=2,strURL=document.getElementsByTagName('activationUrl')[i-1].firstChild.nodeValue; window.location=strURL
The DING! polling script has not yet been updated for multiple DING! headlines, so it is currently unavailable.