<jupyter_start><jupyter_text>LinkedIn - Get last messages  Get your cookiesTo take action on your behalf on a social network, Naas needs to connect as you. To do this, it needs your session cookie(s). This will give your Naas access to your social network account.- [Open your profile](https://www.linkedin.com/in/)- Right-click anywhere on the page and open "Inspect"- Locate the "Application" tab. Then select "Cookies" > Locate the cookie you're looking for = "li_at" and "JSESSIONID" :   Input<jupyter_code>from naas_drivers import linkedin

LI_AT = 'YOUR_COOKIE_LI_AT'  # EXAMPLE AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2
JSESSIONID = 'YOUR_COOKIE_JSESSIONID'  # EXAMPLE ajax:8379907400220387585<jupyter_output><empty_output><jupyter_text>Model & OutputGet your 20 last messages and return a dataframe.**Available columns :** - 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<jupyter_code># Get last conversations :
df = linkedin.connect(LI_AT, JSESSIONID).get_messages()
df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08675078864353312, 'fraction_numerical': 0.02050473186119874, 'mean_word_length': 5.643979057591623, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '71913', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 453, 'n_tokens_neox': 424, 'n_words': 132, 'path': 'LinkedIn/LinkedIn_get_last_messages.ipynb', 'repo_name': 'gagan3012/awesome-notebooks', 'size': '1268'}