?

Log in

No account? Create an account
entries friends calendar profile My Website Previous Previous Next Next
Dear Lazyweb, JS to get my current city - Mark Atwood
fallenpegasus
fallenpegasus
Dear Lazyweb, JS to get my current city
Dopplr can generate a "blog badge" of my Dopplr location and future trips, like so:



I want a little bit of JS that can reach into either Dopplr or Fireeagle, and give back just the name of the city I am in, so I can put in my home page something like "today, Mark is in JS_SCRIPT_REFERENCE_HERE", and it will render as something like "today, Mark is in Seattle".

Am I doomed to write it myself, or has someone else done it?

Tags: , ,

5 comments or Leave a comment
Comments
airlinepilot From: airlinepilot Date: October 2nd, 2008 12:20 am (UTC) (Link)
What are Dopplr and Fireeagle?
fallenpegasus From: fallenpegasus Date: October 2nd, 2008 12:42 am (UTC) (Link)
http://www.dopplr.com/traveller/fallenpegasus

http://fireeagle.yahoo.net/help

Basically, they are systems that let me say where I am and where I am going to be, and other people can see them, and see when they will be there too.
awfief From: awfief Date: October 2nd, 2008 12:21 am (UTC) (Link)
they don't have RSS feeds that you can gank the most recent entry from and put as a block on your site?
tcepsa From: tcepsa Date: October 2nd, 2008 02:45 pm (UTC) (Link)
Isn't there something about cross-site scripting restrictions in most major browsers that prevents JS code from one site from making xmlHttpRequest calls to other sites?

(Will look into it and get back to you ^_^)
tcepsa From: tcepsa Date: October 2nd, 2008 03:03 pm (UTC) (Link)
Hmm... the details are still fuzzy, but most of what I'm seeing looks like you aren't allowed to make that cross-site call for HTML data. There have been a few things that talk about being able to retrieve JSON-formatted data from a remote site, though, so if dopplr or fireeagle have a web API that supports that it could work. Otherwise I think your only alternative for getting something like this on your homepage is to write some JS that will request the data from a server in your homepage's domain (this assumes you have rights to put server-side scripts somewhere in the domain hosting your homepage), that server will run some kind of script to pull the page from the dopplr or fireeagle server, and then write it out as the response to the browser request.

(This is theoretical in the sense that I've never actually done it, but it's something that's relevant to another project that I am working on so if you want I can look into it more ^_^)
5 comments or Leave a comment