Skip to content

Commit

Permalink
Merge pull request #2373 from jupyter-naas/2372-linkedin-get-stats-fr…
Browse files Browse the repository at this point in the history
…om-post-error-retrieve-repost

fix: 2372 linkedin get stats from post error retrieve repost
  • Loading branch information
FlorentLvr authored Nov 13, 2023
2 parents 23911f3 + 61682cc commit 6e37ec5
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 96 deletions.
Binary file modified .github/assets/logos/Google Analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions LinkedIn/LinkedIn_Generate_leads_from_posts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"tags": []
},
"source": [
"**Last update:** 2023-05-29 (Created: 2022-01-09)"
"**Last update:** 2022-01-09 (Created: 2022-01-09)"
]
},
{
Expand Down Expand Up @@ -808,4 +808,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"tags": []
},
"source": [
"# LinkedIn - Get comments from post\n",
"# LinkedIn - Get post comments profiles\n",
"<a href=\"https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/LinkedIn/LinkedIn_Get_comments_from_post.ipynb\" target=\"_parent\"><img src=\"https://naasai-public.s3.eu-west-3.amazonaws.com/Open_in_Naas_Lab.svg\"/></a><br><br><a href=\"https://bit.ly/3JyWIk6\">Give Feedback</a> | <a href=\"https://github.com/jupyter-naas/awesome-notebooks/issues/new?assignees=&labels=bug&template=bug_report.md&title=LinkedIn+-+Get+comments+from+post:+Error+short+description\">Bug report</a>"
]
},
Expand Down Expand Up @@ -60,7 +60,7 @@
"tags": []
},
"source": [
"**Last update:** 2023-08-26 (Created: 2021-06-17)"
"**Last update:** 2023-11-13 (Created: 2021-06-17)"
]
},
{
Expand All @@ -73,9 +73,7 @@
]
},
"source": [
"**Description:** \"This notebook is designed to extract comments from a specific LinkedIn post and organize the data into a structured format. It generates a DataFrame with various details about each comment and the user who posted it.\n",
"\n",
"The DataFrame includes the following columns:\n",
"**Description:** This notebook is designed to extract comments and information about the profiles of people who have commented a specific post on LinkedIn. The data returned is structured in a DataFrame that includes the following columns:\n",
"\n",
"- `PROFILE_ID`: The unique identifier associated with the LinkedIn profile of the user who posted the comment.\n",
"- `PROFILE_URL`: The URL leading to the LinkedIn profile of the user who posted the comment.\n",
Expand Down Expand Up @@ -165,7 +163,7 @@
"[Learn how to get your cookies on LinkedIn](https://www.notion.so/LinkedIn-driver-Get-your-cookies-d20a8e7e508e42af8a5b52e33f3dba75)\n",
"- `li_at`: Cookie used to authenticate Members and API clients.\n",
"- `JSESSIONID`: Cookie used for Cross Site Request Forgery (CSRF) protection and URL signature validation.\n",
"- `post_url`: This variable represents the LinkedIn profile URL."
"- `linkedin_url`: This variable represents the LinkedIn post URL."
]
},
{
Expand All @@ -180,7 +178,7 @@
"source": [
"li_at = naas.secret.get(\"LINKEDIN_LI_AT\") or \"YOUR_LINKEDIN_LI_AT\" #example: AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2\n",
"JSESSIONID = naas.secret.get(\"LINKEDIN_JSESSIONID\") or \"YOUR_LINKEDIN_JSESSIONID\" #example: ajax:8379907400220387585\n",
"post_url = \"\" "
"linkedin_url = \"\" "
]
},
{
Expand Down Expand Up @@ -222,7 +220,7 @@
},
"outputs": [],
"source": [
"df = linkedin.connect(li_at, JSESSIONID).post.get_comments(post_url)\n",
"df = linkedin.connect(li_at, JSESSIONID).post.get_comments(linkedin_url)\n",
"print(\"Comments:\", len(df))\n",
"df.head(1)"
]
Expand Down Expand Up @@ -301,4 +299,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"tags": []
},
"source": [
"# LinkedIn - Get likes from post\n",
"# LinkedIn - Get post likes profiles\n",
"<a href=\"https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/LinkedIn/LinkedIn_Get_likes_from_post.ipynb\" target=\"_parent\"><img src=\"https://naasai-public.s3.eu-west-3.amazonaws.com/Open_in_Naas_Lab.svg\"/></a><br><br><a href=\"https://bit.ly/3JyWIk6\">Give Feedback</a> | <a href=\"https://github.com/jupyter-naas/awesome-notebooks/issues/new?assignees=&labels=bug&template=bug_report.md&title=LinkedIn+-+Get+likes+from+post:+Error+short+description\">Bug report</a>"
]
},
Expand Down Expand Up @@ -60,7 +60,7 @@
"tags": []
},
"source": [
"**Last update:** 2023-08-26 (Created: 2021-06-17)"
"**Last update:** 2023-11-13 (Created: 2021-06-17)"
]
},
{
Expand All @@ -73,7 +73,7 @@
]
},
"source": [
"**Description:** \"This notebook is engineered to compile a list of profiles that have liked a specific LinkedIn post, and it organizes the data into a structured and easily digestible format. It creates a DataFrame that encompasses the following columns:\n",
"**Description:** This notebook retrieves information about the profiles of people who have liked a specific post on LinkedIn. This feature provides insights into the individuals who have engaged with a post, allowing users to view their profiles and potentially connect with them or engage in further conversations. The data is structured in a DataFrame with the following columns:\n",
"\n",
"- `PROFILE_ID`: The unique identifier for each LinkedIn profile.\n",
"- `PROFILE_URL`: The URL of the individual's LinkedIn profile.\n",
Expand All @@ -87,9 +87,7 @@
"- `PROFILE_TYPE`: The type of LinkedIn profile (e.g., individual, company).\n",
"- `REACTION_TYPE`: The type of reaction (like, love, insightful, etc.) the user has given to the post.\n",
"- `POST_URL`: The URL of the LinkedIn post that received the reaction.\n",
"- `DATE_EXTRACT`: The timestamp of when the reaction data was extracted.\n",
"\n",
"This notebook serves as a valuable tool for social media analysis, providing insights into user engagement on LinkedIn posts.\""
"- `DATE_EXTRACT`: The timestamp of when the reaction data was extracted."
]
},
{
Expand Down Expand Up @@ -158,7 +156,7 @@
"[Learn how to get your cookies on LinkedIn](https://www.notion.so/LinkedIn-driver-Get-your-cookies-d20a8e7e508e42af8a5b52e33f3dba75)\n",
"- `li_at`: Cookie used to authenticate Members and API clients.\n",
"- `JSESSIONID`: Cookie used for Cross Site Request Forgery (CSRF) protection and URL signature validation.\n",
"- `post_url`: This variable represents the LinkedIn profile URL."
"- `linkedin_url`: This variable represents the LinkedIn post URL."
]
},
{
Expand All @@ -173,7 +171,7 @@
"source": [
"li_at = naas.secret.get(\"LINKEDIN_LI_AT\") or \"YOUR_LINKEDIN_LI_AT\" #example: AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2\n",
"JSESSIONID = naas.secret.get(\"LINKEDIN_JSESSIONID\") or \"YOUR_LINKEDIN_JSESSIONID\" #example: ajax:8379907400220387585\n",
"post_url = \"\" "
"linkedin_url = \"\" "
]
},
{
Expand Down Expand Up @@ -202,7 +200,7 @@
"tags": []
},
"source": [
"### Get likes from post URL"
"### Get post likes"
]
},
{
Expand All @@ -215,7 +213,7 @@
},
"outputs": [],
"source": [
"df = linkedin.connect(li_at, JSESSIONID).post.get_likes(post_url)\n",
"df = linkedin.connect(li_at, JSESSIONID).post.get_likes(linkedin_url)\n",
"print(\"Likes:\", len(df))\n",
"df.head(1)"
]
Expand Down Expand Up @@ -294,4 +292,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"tags": []
},
"source": [
"**Last update:** 2023-05-29 (Created: 2022-01-27)"
"**Last update:** 2023-11-13 (Created: 2022-01-27)"
]
},
{
Expand Down Expand Up @@ -127,57 +127,41 @@
"outputs": [],
"source": [
"from naas_drivers import linkedin\n",
"import plotly.express as px"
"import plotly.express as px\n",
"import naas"
]
},
{
"cell_type": "markdown",
"id": "hairy-breathing",
"id": "77cd5957-cede-4fb2-998e-a0e668c0e543",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"### Get your cookies\n",
"<a href='https://www.notion.so/LinkedIn-driver-Get-your-cookies-d20a8e7e508e42af8a5b52e33f3dba75'>How to get your cookies ?</a>"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "amended-optics",
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"LI_AT = \"YOUR_COOKIE_LI_AT\" # EXAMPLE AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2\n",
"JSESSIONID = \"YOUR_COOKIE_JSESSIONID\" # EXAMPLE ajax:8379907400220387585"
]
},
{
"cell_type": "markdown",
"id": "upper-allergy",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"### Enter post URL"
"### Setup variables\n",
"**Mandatory**\n",
"\n",
"[Learn how to get your cookies on LinkedIn](https://www.notion.so/LinkedIn-driver-Get-your-cookies-d20a8e7e508e42af8a5b52e33f3dba75)\n",
"- `li_at`: Cookie used to authenticate Members and API clients.\n",
"- `JSESSIONID`: Cookie used for Cross Site Request Forgery (CSRF) protection and URL signature validation.\n",
"- `linkedin_url`: LinkedIn post URL"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "noted-observer",
"id": "4cc42457-533c-4293-8f91-0a955daeee2b",
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"POST_URL = \"POST_URL\""
"# Mandatory\n",
"li_at = naas.secret.get(\"LINKEDIN_LI_AT\") or \"YOUR_LINKEDIN_LI_AT\" #example: AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2\n",
"JSESSIONID = naas.secret.get(\"LINKEDIN_JSESSIONID\") or \"YOUR_LINKEDIN_JSESSIONID\" #example: ajax:8379907400220387585\n",
"linkedin_url = \"\""
]
},
{
Expand All @@ -199,7 +183,7 @@
"tags": []
},
"source": [
"### Get poll results from post"
"### Get poll results"
]
},
{
Expand All @@ -212,7 +196,7 @@
},
"outputs": [],
"source": [
"df = linkedin.connect(LI_AT, JSESSIONID).post.get_polls(POST_URL)\n",
"df = linkedin.connect(JSESSIONID, JSESSIONID).post.get_polls(linkedin_url)\n",
"print(\"📝 Nb of poll results\", len(df))\n",
"df.head(5)"
]
Expand Down Expand Up @@ -360,4 +344,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
Loading

0 comments on commit 6e37ec5

Please sign in to comment.