Sunday, November 2, 2008

Yotreps Widget

Update: Improved and moved the tracking widget to the sidebar. It now tracks all the boats reporting to Yotreps. Just select the boat's call sign from the list and hit the "get" button. Clicking "Enlarge Map" will take you to that boat's Yotreps page with more information about the boat. Kyle and Maryanne's call sign is AI4QI.

This widget can be embedded in any webpage. I used the code below in Google Blogger. (Change the call sign to whatever boat you want to track.) Let me know if you try to embed the widget in a webpage and have any problems.

Code:

<iframe
width="375" height="300"
src="http://nautig.com/wc/tracker/yotrepsHTML.pl?callSign=AI4QI">
</iframe>


Kyle and Maryanne left last week on their sailing adventure to the Caribbean. They have a Gemini catamaran too, although much newer than mine. They're much more adventuresome than I am. They did a little bit of the ICW to start the trip, but now are way out in the ocean. They're not even bothering to stop in Bermuda, which I hear is a nice place in the middle of the Atlantic to visit.

Being that far out, they do not have cell phone service. But they do have an Iridium satellite phone. They've been updating their position on a website called Yotreps, and sending short updates about their progress. They have a link to Yotreps on their blog, but I thought I'd create a little map for them like the one I used to track my progress.

11 comments:

SV-Footprint said...

Hey! We are amazed! Thanks for doing that special Yotreps thing, I hope to update our blog and steel your ready made code and make our blog a little more friendly for the Yotreps Link - We Really appreciate it.

As you can tell, we've arrived in Antigua. We are spending a raining day catching up with rest and emails and the real world, before exploring more of the islands.

Thanks again, it is so nice to know that people are following our journey, and a real treat to find someone (you) volunteering effort to make our web page (and yotreps reporting) look even better.

SV-Footprint said...

Hi Scott, the widget has not been working for a few days, but it is up and running now and looks better than ever - thanks again!

John said...

Thanks for making this widget. Super job!

I've embedded it as a joomla module, and it seems to work.

When I use my spare callsign (PI6316) it works, but my actual callsign (NEBULAE) does not give any positions.

Can you shine a lite on this?

Thanks,

John

NautiG said...

John,

Glad you like the widget and are getting some use out of it. Can you give me a link to the page where you have embedded the widget? I'd love to see it in use.

I added NEBULAE to the yacht list. It should now be included in the widget.

Scott

NautiG said...

John,

I updated the blog so that Nebulae is the boat shown in my widget. Please let me know if you have any more problems with the widget. I'm not sure why it didn't pick up Nebulae on it's own.

Scott

ScottE said...

This is great, thanks! I did notice one minor detail though - your widget appears to be case-sensitive, which is not consistent with yotreps/shiptrak - either of which will find a boat name regardless of case. Other than that, I like this, thanks!

ScottE said...

One other thing I came across - this widget seems to violate js security in the Chrome browser with the following (URLs trimmed):

Unsafe JavaScript attempt to access frame with URL http://<...> from frame with URL http://<...> Domains, protocols and ports must match.

Just passing this along! I like your widget better than the shiptrak one - it's much faster at loading the map.

Thanks!

NautiG said...

Scott,

I'm glad you like the widget! If you embed it in a page, please give me a link.

I'm not sure how to fix the bugs you've found. I wrote the code over a year ago, and it's a bit of a hack.

The chrome security error is probably something I can't fix. The widget pulls data from a few different sites. I'm guessing that fixing the security error would require a massive work around and slow down the loading of the widget substantially.

I don't understand your comment that the widget is case sensitive. The list of boats is a drop down list. Do you mean it is case sensitive when you try to embed it?

Also, I do not have access to a Mac. Only windows and linux. If you could describe the bugs you encounter on a mac in more detail, I might be able to fix some of them.

Thanks, Scott

ScottE said...

Hi Scott,

Thanks for replying to the comments!

For the case sensitive bit, yep - I mean in terms of embedding it with a query string. This widget requires the case be exactly as in yotreps, but yotreps is not inherently case-sensitive for searches itself. It's minor, but there are cases where the widget could stop working, say if somebody - like me :-) - was to report to yotreps sometimes in uppercase, and sometimes in lowercase. Yeah, it's a subtle edge case to be sure!

I was able to get around the Chrome XSS in a test by just using the html output of your Perl script directly. Is the list of boats the only dynamic content? If so, that's not a huge deal.

Perhaps it was someone else with Mac issues? All my playing/testing has been on Linux.

Thanks again!!
-Scott

NautiG said...

Hey Scott,

As I've mentioned, I wrote the widget over a year ago. It's not something I'm actively supporting. If there is some way that I can make it more useful to you, please let me know. I'm happy to share the code with you. And if you come up with improvements to the widget, I would appreciate you sharing them with me, so I could improve the widget for others.

Thanks, Scott

ScottE said...

Sorry, I didn't mean to sound like I had an expectation of you changing anything :-) and I admit I also was just going by the date of the last comment, it never occurred to me that it was something done much earlier. Regardless, it's very useful!

Anyway, I'm trying a somewhat stripped-down version of the widget at our site+blog http://svjaneo.com - I guess I'll have to wait until I report another position to see if all the dynamic content works. :-) While it's stripped down, I still have - and always will have - a link back to your widget page.

Thanks again for making this widget available and for responding to all my various random feedback, I appreciate it!

BTW, nice Gemini!