Fetching Extended Profile Information
Although the earlier exercises in this chapter were interesting,
sooner rather than later, you’ll want to begin using the LinkedIn APIs to
mine the full richness of the data that’s available to you. As you’d
expect, there’s a basic developer opt-in process where you register to get
authorization credentials; you’ll want to visit http://developer.linkedin.com and read up on the full
details, but Figure 6-5 demonstrates the
broad strokes. Once you have credentials, the overall process is similar
to that of any other social network that requires you to do the OAuth
dance to access APIs: you request API credentials, get back a token and
secret, and then use these values to ultimately get the coveted access
token that can be used when sending requests. Of course, most of the gory
details will be abstracted away since we’ll be using the linkedin
Python module to do most of the tedious
work for us. Just easy_install
python-linkedin
.
Figure 6-5. Basic steps involved in getting LinkedIn API credentials: from http://developer.linkedin.com, pick “Your Stuff”→“API Keys” (top), then create a new app (middle), and finally set up your app parameters and take note of your API key and secret (bottom)
Once the linkedin
package is installed, the following
script (Example 6-12) is a working template that you can use to get logged in and start accessing your professional ...
Get Mining the Social Web now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.