Use SPOT on other web sites - Findmespot's Weblog



How To Use SPOT On Your Web Site

Example 1: SPOT XML data

The SPOT shared page is built upon an XML data stream that is enabled when a new shared page is created. For example if the shared page url is:



Then the underlying XML data can be retrieved from:



The XML returned will look something like :

0-7341007

Jono SPOT

TEST

This is a Test message. The device is powered on and is working.

2008-05-20T10:52:55.000-07:00

1211305975

37.425

-121.8958

Milpitas, CA, US

0 km(s)

The XML schema is included in Appendix A of this document.

The XML document will contain 0 or more messages. Only the messengers and message types enabled by the customer will be available in this data stream. Also note that the XML data is cached by our servers. *The message service should be called no more frequently than every 15 minutes, since the data is cached and data will not be made available any faster. In addition, viewing limits are imposed on all shared page links and abuse of this feature may cause the viewing limits to come into effect. Viewing limits are currently reset on a weekly basis*.

For server->server synchronization of data this method may not be optimal. The SPOT development team will be providing an additional message sync mechanism that will provide non-cached access to the data and provide additional control to retrieve only the new message data and not the full message history. Additional information may be required from our customers to use this feature. Please contact the SPOT product team for more information on this service.

Example 2: Using Yahoo! Pipes to view SPOT data in Google Maps for Mobile & Google Earth

Yahoo pipes is a powerful composition tool to aggregate, manipulate, and mashup content from around the web.

Like Unix pipes, simple commands can be combined together to create output that meets your needs:

• combine many feeds into one, then sort, filter and translate it.

• geocode your favorite feeds and browse the items on an interactive map.

• power widgets/badges on your web site.

• grab the output of any Pipes as RSS, JSON, KML, and other formats.

When you create a SPOT shared page, the data from your account is also made available in an XML format. Using this data it is possible to integrate with Yahoo! Pipes and create some powerful features. In order to run this example on your own SPOT data, you will also need a Yahoo! Pipes account (if you already have a Yahoo account it is very easy to setup a pipes account).

A number of customers have asked about getting the SPOT message data displayed on a mobile version of Google Maps. In this example we create a Yahoo! Pipe that converts SPOT shared data and allows that data to be viewed by Google maps on your mobile phone (using the appropriate Google Maps for mobile installed on your phone).

Native support for Google’s KML message format is not yet built into the SPOT shared data. However, Yahoo! Pipes provides KML support by default as one of the output formats once your pipe has been created and run. For this example our pipe will need to do the following :

1. Ask the user for the Guest Link ID. (this is the very last part of the SPOT Shared page link.

So for example if the full URL is:



Then the user will just enter:

0XapxKsaW5RCHYhVkaCBpaHT9cNMUcEea

2. The pipe will then build a URL that points to the Shared page data stream using this ID. (it first creates a String by concatenating the base URL with the ID and then converts it to a URL)

The XML data stream URL will then look something like:



3. The pipe will then parse the XML data stream made available by the SPOT shared page

4. It will truncate the number of messages to only include the last 9 locations (Google Maps for mobile can only display a maximum of 9 locations at any one time. So there is no need to pass any more data)

5. Loop through the SPOT data to perform additional formatting on the message time/date and also rename (re-label) some of the fields. In the SPOT xml data, the GPS timestamp of the message is stored in a long (unix time) format.

6. Finally the pipe runs the data through Yahoo!’s location extractor. This will convert the latitude longitude information into a format that Yahoo can then use to build the final output (& KML).

We have published this SPOTPipe as an example. The URL of the published pipe is:



You can simply clone this pipe for your own use and edit it for your own needs.

The Yahoo! Pipes site uses simple drag and drop mechanisms to configure these steps. You will only need to enter the Shared Page ID from your link to have it work with your own data. The final pipe will look something like this.

[pic]

If we run the pipe, Yahoo will retrieve the latest SPOT data and process it using the pipe that we have setup. By default, if it recognizes any location information it will display it on a yahoo map.

[pic]

Yahoo! provides a number of ways to use the pipe output. Clicking on ‘more options’ you will see the different formats that it will convert to.

[pic]

For example, right click on the “Get as KML” option. It will provide you with a KML link to the pipe.

It will look something like this:



Loading the data feed into Google Maps for Mobile

Assuming your SPOT shared page is still active and you are actively using your messenger, this link can now be used to load your last known SPOT location data into Google Maps Mobile.

[pic]

For example, on a Palm Treo with Google Maps mobile installed, select the “Find Nearby Business” menu option. In the “Search near the map center for“ field enter the KML link that you created (like the one shown above). Alternatively you can use a URL shortening service like () to produce a short URL for the Yahoo KML url above. Google Maps for mobile will now pull the data from the KML feed and display the locations.

Loading the data feed into Google Earth

Google Earth can also display the same feed. First load up google earth and then from the “Add” menu select the “Network Link…” option. Give the network link a name, paste the Yahoo! Pipe KML URL into the Link field. If you would like Google Earth to check the feed periodically you can use the refresh options to pull the data automatically, lets say every 15 minutes.

[pic]

Here is the same feed shown in Google Earth:

[pic]

Appendix A (SPOT shared message XML Schema)

 

 

   A list of messages get from the message servlet

 

 

  

   

    

     

      

       

         This is the DEVICE ESN field

       

      

      

      

      

       

         Detailed Message in TEXT

       

      

      

       

         Time Message sent in GMT time

       

      

      

      

      

      

      

     

    

   

  

 

 

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download