• Topic
  • Discussion
  • VOS.VirtCartConfigLinkedIn(Last) -- Owiki? , 2018-04-13 12:05:53 Edit owiki 2018-04-13 12:05:53

    LinkedIn Cartridge - Configuration Guidelines and Implementation Notes

    Introduction

    The Sponger cartridge for LinkedIn is written to the LinkedIn REST API. In order to use this API, the cartridge must be configured with a LinkedIn API key. To obtain an API key, register the Sponger as a LinkedIn application. Any application name can be used, for example 'Sponger_{your-virtuoso-host}'. However the OAuth redirect URL must point to the /linkedin_oauth virtual path defined when the Cartridges VAD is installed, e.g. http://{your-virtuoso-host:port}/linkedin_oauth/linkedin_access_token.vsp.

    Registering the Sponger as a LinkedIn Application

    Before you can obtain access tokens for the cartridge, you first need to register the Sponger as a LinkedIn application.

    1. Register the Sponger using the LinkedIn Developer Network Application.



    2. Click "Add New Application".
    3. Specify company name, application name and application description:



    4. Next specify JavaScript? API Domain with value http:// e.g. e.g., http://uriburner.com and specify application type and use. Additionally set live status:



    5. Specify contact email and phone.
    6. Specify OAuth Redirect URL. As noted above, the OAuth redirect URL must point to the /linkedin_oauth virtual path defined when the cartridges VAD is installed, e.g. http://{your-virtuoso-host:port}/linkedin_oauth/linkedin_access_token.vsp:



    7. Click "Add Application".
    8. As result a notification for successfully created application should be displayed:



    9. To complete the process click "Done".
    10. You have successfully registered your Sponger instance as a LinkedIn application and you have been granted an API key:



    11. Now go to your local Conductor at http://your-virtuoso-host:port/conductor
    12. Go to Linked Data -> Sponger -> Extractor Cartridges:



    13. Find "LinkedIn" and click on its link in order to edit its properties:



    14. Enter the API key and Secret Key noted in the cartridge's "Options" field as values for options consumer_key and consumer_secret. Set option consumer_name to match the registered application name:



      • Note: you can also set accept_lang. This entry in the cartridge options is not created by default. LinkedIn? alters the language of some output fields. Its choice of locale is based on the geographic location of the server. By setting the accept_lang option, you can allow LinkedIn?'s choice of locale to be overridden. For ex:

        accept_lang=en-us

    15. Click 'Update" to save the "Options" settings.
    16. Note: A shortcut for Granting an Access Token ( as described in the next section) is by placing the OAuth Redirect URL for ex.: http://example.com/linkedin_oauth/linkedin_access_token.vsp> directly in an browser address bar:



      1. Click "Ok, I'll Allow it":



    Granting an Access Token

    The LinkedIn user whose profile is to be fetched should first grant an OAuth access token. This can be done through the LinkedIn button displayed by http://{your-virtuoso-host:port}/sponger:

    1. Go to http://{your-virtuoso-host:port}/sponger :



    2. Click the LinkedIn button



    3. Click the "Ok, I'll Allow it" button.
    4. As result a notification for successful OAuth access token generation should be displayed:



    Although it is not mandatory that each user grants an access token, at least one must have been granted via the registered Sponger instance so that requests to the LinkedIn REST API can be signed and LinkedIn can authenticate the caller. Thus one user's access token can be used to fetch another LinkedIn member's profile. However, a LinkedIn user's connections and posts are only included in the the profile being fetched if the access token used was granted specifically to that user. Even if this is the case, LinkedIn prevents browsing of connections, i.e. starting with one member and descending through her connections, then through the connections of a connection etc.

    View the Retrieved Data

    The cartridge is configured to trigger on URI pattern http://.*.linkedin.com/.*. It is assumed that a LinkedIn user's public profile URL will be used as the starting point for sponging their profile: http://uriburner.com/about/html/{your-LinkedIn?-public-profile-url}. For example:

    1. Access http://uriburner.com/about/html/http://www.linkedin.com/in/kidehen :




    2. Click the primary topic value link "Kingsley Uyi Idehen":




    Alternative Follow-Your-Nose friendly view

    We can take a look at the /fct variant of the primaryTopic object page:

    1. Click the Facets link from the footer section "Alternative Linked Data Views" of the page from above:
    2. Click "Next" to view the rest of the Attributes and their Values:








    3. Click "Last" to view the last page of Attributes and their Values:






    Related