So.. I saw the homepage of Tijs Teulings and got inspired with his ‘my current location’ thingy. As you can see on the map, it uses an Iphone (I guess).
Now..this is the way to create something like that:
- Install the Navizon application on your Iphone. Using installer.
- Create the needed account for it.
- Start Navizon and set ‘Appear Visible’ to ON.
- Login to your Navizon account at:
http://my.navizon.com/Webapps/UserAdmin/index.aspx - Go to: Display the location of users in my group in Browser.
And press: Publish location to public URL. - Copy the XML URL to your clipboard.
Now the only thing you have to do is grab the coordinates out of this XML-feed and put them in a map. I’ve supplied some Ruby code to do this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # Navizon::Tracker wrapper in Ruby by Joost Hietbrink (joost@joopp.com) # See: http://blog.joopp.com/2008/05/21/track-yourself-and-your-stolen-iphone/ module Navizon class Tracker attr_accessor :url, :user, :resul # Usage: # tracker = Navizon::Tracker.new('1F51235E5F58') def initialize(user) @user = user @url = "http://my.navizon.com/Webapps/UserAdmin/UserService.asmx/GetUserLocation?user=#{user}" end def track! xml_data = Net::HTTP.get_response(URI.parse(@url)).body @result = XmlSimple.xml_in(xml_data, { 'ForceArray' => false }) end require 'xmlsimple' # Returns location as array [lat, lng] def location @result ||= self.track! location = @result['UserInfo']['Location'] [location['Latitude'].to_f, location['Longitude'].to_f] end # Returns Ruby time of result def timestamp @result ||= self.track! Time.parse(@result['UserInfo']['Location']['Timestamp']) end end end |
When on Rails, put this in lib/navizon.rb. And install the xml-simple gem.
Now to put it on your site just use the Google Maps API, or Yahoo or Microsoft or just all of them (mapstraction). Get the location by using the following in your controller action:
1 2 | # Returns a [lat, lng] array @location = Navizon::Tracker.new('1D52195EFFFF').location |
Of course you should replace the ‘1d52…FFFF’ part with the part in the XML URL you still have on your clipboard (right ;))
Have fun!
Subscribe to our RSS feed
Hi Joost, i do indeed use an iphone and navizon for much the same setup only using PHP. which i just noticed has an error which i am now obliged to fix i guess
Hey this is awesome, but there’s a MUCH EASIER way now - you should check out iRedHanded… It tracks your location too, but uses far less battery life (it knows when you’re moving and when you’re not and only activates when you’re moving), plus it lets you remote-wipe your iPhone including all your sensitive data: personal photos, messages, SMS, application settings, site passwords and logged in sessions, all that stuff! It also makes annoying noises (even if switched to silent mode) in case it’s just behind the couch.
If it’s genuinely stolen you can annoy the thief with noises “I’m stolen” spoken alerts, and popup messages (even if the phone is switched to silent)… Lastly you can spy on the thief and see what numbers they called, texts they sent and received, Wifi networks and IP addresses they connected from, the number of the new SIM card they inserted- enough info to keep a detective happy and bust them pretty quick! I used it recently when I left my iPhone in the back of a cab and didn’t know which cab company to call
i got my phone stolen and ill pay some1 for tracking it down
If you have your imei number for your phone its documented on the paperwork that came with the phone. The police have the ability to contact the Telephone company and find out whos sim card has been used in the phone. However if the phone is blocked or locked out of the network the thief will likely smash or throw out the phone so this would not be recommended.
My husbands phone got stolen, but it was a gift to him by his dad and step mum. do u think i can ring apple or sumone to track them down? i desperatly wanna get it back for him.
i lost my iphone 3g 16GB .. i have all the bills , IME no. and ta serial no. pls help me to trace my phone .. i heartly beg u