Lucubrator uses the Core Location frameworks introduced in Mac OS X 10.6 Snow Leopard to detect your current location using the same technique used by the iPod.
If you have not disabled Location Services, you have AirPort turned on, you are connected to the Internet, and you are in range of a WiFi hotspot that is in the Skyhook database, Lucubrator will find you.
When it does, click the Show on Map button to show your location in Google Maps. If you’re in a major city, you’re probably in luck.
Otherwise, you might have to add your local hotspots to the Skyhook database yourself. We’ve had reports of success from Boston, Hamburg, Paris and Sydney.
To use Lucubrator, simply launch it. It warns you if you have disabled Location Services, AirPort is not turned on, or AirPort is not connected, and the system asks for permission to use your current location.
Then it automatically starts searching. If it does not detect a WiFi hotspot in the Skyhook database, it reports the date and time of the last attempt about once every 40 seconds and keeps searching until you click Stop or quit.
If it does detect a known WiFi hotspot, it reports the details of your location and stops searching. To see your location in your Web browser on Google Maps, just press Show on Map.
Click Start to begin searching again. Hold down the Option key at any time to turn the Start button into a Test button, to report a pre-configured location for test purposes even when you’re out of range of any known hotspot.
The disk image contains the Lucubrator application and its source code in an Xcode 3.2 project. In addition to demonstrating the use of the Core Location frameworks, it contains several other interesting features.
For example, it uses the new Snow Leopard CoreWLAN framework to detect whether AirPort is currently powered on and connected.
In addition, it uses the new Snow Leopard blocks feature and +[NSEvent addLocalMonitorForEventsMatchingMask:handler:] to detect when the user presses or releases the Option key.
NOTE: Lucubrator is licensed under the Creative Commons Attribution License, version 3.0.