description |
---|
Improve your KYC thanks to Linkedin connection |
{% embed url="https://www.linkedin.com" caption="" %}
{% hint style="danger" %} As of June 2021, we are starting a refactoring of the LinkedIn driver, please refer to the awesome-notebook Github page to get the latest updates. {% endhint %}
To access your LinkedIn data, you need to learn how to get your cookies.
{% hint style="info" %} To get your cookies, please follow this tutorial. {% endhint %}
from naas_drivers import linkedin
# Enter cookies information
LI_AT = 'YOUR_COOKIE_LI_AT' # EXAMPLE : AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2
JSESSIONID = 'YOUR_COOKIE_JSESSIONID' # EXAMPLE : ajax:8379907400220387585
# Enter the linkedin id or linkedin url
url = "LINKEDIN_ID" or "LINKEDIN_URL"
# Get dataframe as result
df = linkedin.connect(LI_AT, JSESSIONID).get_profil(url)
df
- FIRSTNAME : First name
- LASTNAME : Last name
- BIRTHDATE_DAY : Day of birth in format DD
- BIRTHDATE_MONTH : Month of birth in format MM
- BIRTHDATE_YEAR : Year of birth in format YYYY
- BIRTHDATE : Birthdate in format DD, MM - YYYY
- COUNTRY : Country name
- ADDRESS : Address
- LK_HEADLINE : Job description (headline)
- LK_SECTOR : Work industry
- LK_FOLLOWERS : Number of followers
- LK_PHONE : Phone number
- LK_EMAIL : Email
- LK_TWITER : Twitter account
from naas_drivers import linkedin
# Enter cookies information
LI_AT = "YOUR_COOKIE_LI_AT" # EXAMPLE AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2
JSESSIONID = "YOUR_COOKIE_JSESSIONID" # EXAMPLE ajax:8379907400220387585
# Get dataframe as result
df = linkedin.connect(LI_AT, JSESSIONID).get_messages()
df
- FIRSTNAME : First name
- LASTNAME : Last name
- OCCUPATION : Job description (headline)
- PROFILE_PUBLIC_ID : LinkedIn ID
- LAST_ACTIVITY : Last activity in format YYYY-MM-DD HH:MM:SS
- LAST_READ_AT : Last message read at in format YYYY-MM-DD HH:MM:SS
- MESSAGE_TEXT : Message content
- MESSAGE_TYPE : Message type
from naas_drivers import linkedin
# Enter cookies information
LI_AT = "YOUR_COOKIE_LI_AT" # EXAMPLE AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2
JSESSIONID = "YOUR_COOKIE_JSESSIONID" # EXAMPLE ajax:8379907400220387585
# Enter post url
url = "YOUR_POST_URL"
# Get dataframe as result
df = linkedin.connect(LI_AT, JSESSIONID).get_post_data(url)
df
- URL : Post url
- TITLE : Post text before first break
- DATE : Time since post publication
- VIEWS : Numbers of views
- COMMENTS : Numbers of comments
- LIKES : Numbers of likes
- LIKES_LIKE : Numbers of likes type "like"
- LIKES_PRAISE : Numbers of likes type "praise"
- LIKES_INTEREST : Numbers of likes type "interest"
- LIKES_APPRECIATION : Numbers of likes type "appreciation"
- LIKES_EMPATHY : Numbers of likes type "empathy"
{% hint style="warning" %} You can "connect" before any other methods and use your object in your formulas {% endhint %}
from naas_drivers import linkedin
# Enter cookies information
LI_AT = "YOUR_COOKIE_LI_AT" # EXAMPLE AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2
JSESSIONID = "YOUR_COOKIE_JSESSIONID" # EXAMPLE ajax:8379907400220387585
# Connect to Linkedin
LK = linkedin.connect(LI_AT, JSESSIONID)
# Get last 20 messages
df = LK.get_messages()