Created
June 10, 2011 12:15
-
-
Save feedhenry-gists/1018725 to your computer and use it in GitHub Desktop.
Mash Hash Cache DomashUp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doMashUp() { | |
var mashup = []; | |
// Add some test placemarks so cache can be invalidated if required | |
//mashup.push({type: 'test', title: 'Test 1', lat: 57.5, lon: -7.5}); | |
//mashup.push({type: 'test', title: 'Test 2', lat: 57, lon: -7}); | |
//mashup.push({type: 'test', title: 'Test 3', lat: 57.3, lon: -7.3}); | |
// Get placemarks from flickr | |
var flickr = getFlickrData(); | |
// Iterate over the results, adding them to the mashup | |
for (var fi = 0, fl = flickr.length; fi < fl; fi++) { | |
var entry = flickr[fi]; | |
mashup.push({ | |
type: 'flickr', | |
title: entry.title, | |
lat: entry.latitude, | |
lon: entry.longitude | |
}); | |
} | |
// Get placemarks from Yahoo Local Search | |
var yahoo = getYahooData(); | |
// Iterate over the results, adding them to the mashup | |
for (var yi = 0, yl = yahoo.length; yi < yl; yi++) { | |
var entry = yahoo[yi]; | |
mashup.push({ | |
type: 'yahoo', | |
title: entry.Title, | |
lat: entry.Latitude, | |
lon: entry.Longitude | |
}); | |
} | |
return mashup; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment