This script works with network-manager and wicd to emulate that same behavior. It’s fairly straightforward – it’s actually a modification of the script I use to get my external IP and interface for conky. It should also work just fine on OSX, as it’s a bash script.
Note that I use midori for the web browser – it’s light, and has just enough functionality to get past all the different variations of “click to accept” screens that I’ve seen to date.
NOTE FOR WICD USERS: Run it as a startup script – wicd starts as a service before X starts, and you need to call a graphical browser for many of the login screens.
The script should be embedded below if you’re reading this on the site, or you can find it at this gist here: https://gist.github.com/uriel1998/6942365