Leaving aside ethical issues, a commercial library is available that can do this for you: http://www.octazen.com/product_abimporter.php
The library is available for PHP, .NET, Java, Ruby, and ColdFusion. It supports importing contacts from many different services (including all the main ones).
It costs only about $ 100 per license, works fine and (using the Java version) requires only one line of code to import contacts from any of the supported services:
List<Contact> contacts = SimpleAddressBookImporter.fetchContacts(emailAddress, password)
They have another library that can import friends lists from social networks, although I have not tried this one.
Dónal source share