Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 2333 as a contributor i want to use logo of the source tool in the notebook i make #2359

Merged
Binary file added .github/assets/logos/AWS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Abstract API.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Affinity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Agicap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Airtable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Algolia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/AlphaVantage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Appwrite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Bazimo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Bitly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Boursorama.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Bubble.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Buffer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/CCXT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Canny.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Cityfalcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Clockify.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Cloud Mercato.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Creditsafe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/D-Tale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Dask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Data.gouv.fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Deepl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Draft Kings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/EM-DAT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logos/Elasticsearch.png
Binary file added .github/assets/logos/FAO.png
Binary file added .github/assets/logos/FEC.png
Binary file added .github/assets/logos/FED.png
Binary file added .github/assets/logos/FTP.png
Binary file added .github/assets/logos/Folium.png
Binary file added .github/assets/logos/Forecast.png
Binary file added .github/assets/logos/Formant.png
Binary file added .github/assets/logos/GitHub.png
Binary file added .github/assets/logos/Gmail.png
Binary file added .github/assets/logos/Google Analytics.png
Binary file added .github/assets/logos/Google Maps.png
Binary file added .github/assets/logos/Google Search.png
Binary file added .github/assets/logos/Harvest.png
Binary file added .github/assets/logos/Healthchecks.png
Binary file added .github/assets/logos/HubSpot.png
Binary file added .github/assets/logos/Hugging Face.png
Binary file added .github/assets/logos/IFTTT.png
Binary file added .github/assets/logos/IMDB.png
Binary file added .github/assets/logos/INPI.png
Binary file added .github/assets/logos/IPython.png
Binary file added .github/assets/logos/IUCN.png
Binary file added .github/assets/logos/ImagineAPI.png
Binary file added .github/assets/logos/Insee.png
Binary file added .github/assets/logos/Instagram.png
Binary file added .github/assets/logos/Integromat.png
Binary file added .github/assets/logos/Johns Hopkins.png
Binary file added .github/assets/logos/Jupyter Notebooks.png
Binary file added .github/assets/logos/Jupyter.png
Binary file added .github/assets/logos/Kaggle.png
Binary file added .github/assets/logos/Knative.png
Binary file added .github/assets/logos/LangChain.png
Binary file added .github/assets/logos/LeFigaro.png
Binary file added .github/assets/logos/LlamaIndex.png
Binary file added .github/assets/logos/Matplotlib.png
Binary file added .github/assets/logos/Medium.png
Binary file added .github/assets/logos/Metrics Store.png
Binary file added .github/assets/logos/Mixpanel.png
Binary file added .github/assets/logos/MongoDB.png
Binary file added .github/assets/logos/NASA.png
Binary file added .github/assets/logos/Naas Auth.png
Binary file added .github/assets/logos/Naas Chat Plugin.png
Binary file added .github/assets/logos/Neo.png
Binary file added .github/assets/logos/Newsapi.png
Binary file added .github/assets/logos/Notion.png
Binary file added .github/assets/logos/OS.png
Binary file added .github/assets/logos/OpenAI.png
Binary file added .github/assets/logos/OpenBB.png
Binary file added .github/assets/logos/OpenWeatherMap.png
Binary file added .github/assets/logos/OwnCloud.png
Binary file added .github/assets/logos/Pandas.png
Binary file added .github/assets/logos/Panel.png
Binary file added .github/assets/logos/Pillow.png
Binary file added .github/assets/logos/Pipedrive.png
Binary file added .github/assets/logos/Plaid.png
Binary file added .github/assets/logos/Plotly.png
Binary file added .github/assets/logos/Polars.png
Binary file added .github/assets/logos/PostgresSQL.png
Binary file added .github/assets/logos/PyCaret.png
Binary file added .github/assets/logos/Qonto.png
Binary file added .github/assets/logos/Reddit.png
Binary file added .github/assets/logos/Redshift.png
Binary file added .github/assets/logos/Remoteok.png
Binary file added .github/assets/logos/Remotive.png
Binary file added .github/assets/logos/SAP-HANA.png
Binary file added .github/assets/logos/SEON.png
Binary file added .github/assets/logos/SQLite.png
Binary file added .github/assets/logos/SWIFT.png
Binary file added .github/assets/logos/SendGrid.png
Binary file added .github/assets/logos/Sendinblue.png
Binary file added .github/assets/logos/SharePoint.png
Binary file added .github/assets/logos/Shutterstock.png
Binary file added .github/assets/logos/Slack.png
Binary file added .github/assets/logos/Snowflake.png
Binary file added .github/assets/logos/Societe.com.png
Binary file added .github/assets/logos/Spotify.png
Binary file added .github/assets/logos/Stabilty AI.png
Binary file added .github/assets/logos/Stable Diffusion.png
Binary file added .github/assets/logos/Streamlit.png
Binary file added .github/assets/logos/Stripe.png
Binary file added .github/assets/logos/Supabase.png
Binary file added .github/assets/logos/Telegram.png
Binary file added .github/assets/logos/Text.png
Binary file added .github/assets/logos/Thinkific.png
Binary file added .github/assets/logos/TikTok.png
Binary file added .github/assets/logos/Trello.png
Binary file added .github/assets/logos/Twilio.png
Binary file added .github/assets/logos/Twitter.png
Binary file added .github/assets/logos/Typeform.png
Binary file added .github/assets/logos/Vizzu.png
Binary file added .github/assets/logos/WhatsApp.png
Binary file added .github/assets/logos/WindsorAI.png
Binary file added .github/assets/logos/WorldBank.png
Binary file added .github/assets/logos/YahooFinance.png
Binary file added .github/assets/logos/YouTube.png
Binary file added .github/assets/logos/ZIP.png
Binary file added .github/assets/logos/Zapier.png
Binary file added .github/assets/logos/ZeroBounce.png
Binary file added .github/assets/logos/spaCy.png
1 change: 0 additions & 1 deletion .github/controls/check_notebooks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@
" should_display_debug = False\n",
" \n",
" for checkf in [\n",
" check_naas_logo,\n",
" check_title_match_regexp,\n",
" check_tool_tags,\n",
" check_author,\n",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,327 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "derived-intention",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"<img width=\"10%\" alt=\"Naas\" src=\"https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160\"/>"
]
},
{
"cell_type": "markdown",
"id": "broad-biotechnology",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"# Google Search - Search and Download LinkedIn logo from company names\n",
"<a href=\"https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/Google%20Search/Google_Search_Get_LinkedIn_company_url_from_name.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=Google+Search+-+Get+LinkedIn+company+url+from+name:+Error+short+description\">Bug report</a>"
]
},
{
"cell_type": "markdown",
"id": "tags_cell",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"**Tags:** #googlesearch #snippet #operations #url #linkedin #logo #image #download"
]
},
{
"cell_type": "markdown",
"id": "naas-author",
"metadata": {
"papermill": {},
"tags": [
"naas"
]
},
"source": [
"**Author:** [Florent Ravenel](https://www.linkedin.com/in/ACoAABCNSioBW3YZHc2lBHVG0E_TXYWitQkmwog/)"
]
},
{
"cell_type": "markdown",
"id": "2f5dcf6f-b648-44ee-9b59-da16dc1abd49",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"**Last update:** 2023-11-06 (Created: 2023-11-06)"
]
},
{
"cell_type": "markdown",
"id": "naas-description",
"metadata": {
"papermill": {},
"tags": [
"description"
]
},
"source": [
"**Description:** This notebook is designed to search and download the logo of a list of companies The logo that will be downloaded is the one associated with the company's LinkedIn page. In case the logo is not available on the LinkedIn company page, the notebook will not retrieve any logo."
]
},
{
"cell_type": "markdown",
"id": "input_cell",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## Input"
]
},
{
"cell_type": "markdown",
"id": "7b426a4c-db44-4b15-867b-ef0d7f52c142",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"### Import libraries"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5db19a20-c212-47ac-9869-4f28a10e083f",
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"try:\n",
" from googlesearch import search\n",
"except:\n",
" !pip install google\n",
" from googlesearch import search\n",
"import re\n",
"import naas\n",
"from naas_drivers import linkedin\n",
"import requests\n",
"import os"
]
},
{
"cell_type": "markdown",
"id": "26884c4a-fa7d-435d-ab87-ef597ccbf159",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"### 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",
"- `companies`: List of companies\n",
"\n",
"**Optional**\n",
"- `output_dir`: Output directory"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a939647a-edc3-464f-9421-ef47fd477bae",
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"# 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",
"companies = [\"Naas.ai\"]\n",
"\n",
"# Optional\n",
"output_dir = \"logos\""
]
},
{
"cell_type": "markdown",
"id": "model_cell",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## Model"
]
},
{
"cell_type": "markdown",
"id": "627c7165-9f91-43c7-a12d-b2c608fbb862",
"metadata": {},
"source": [
"### Get logos already in output directory"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "474da93f-b13f-4a7a-a726-fbcc4b949d5e",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"os.makedirs(output_dir, exist_ok=True)\n",
"logos = os.listdir(output_dir)\n",
"print(logos)"
]
},
{
"cell_type": "markdown",
"id": "output_cell",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## Output"
]
},
{
"cell_type": "markdown",
"id": "b0eec712-3f98-4706-a547-a0d57a33e6a6",
"metadata": {
"execution": {
"iopub.execute_input": "2022-03-20T14:22:19.041796Z",
"iopub.status.busy": "2022-03-20T14:22:19.041566Z",
"iopub.status.idle": "2022-03-20T14:22:19.044518Z",
"shell.execute_reply": "2022-03-20T14:22:19.043859Z",
"shell.execute_reply.started": "2022-03-20T14:22:19.041774Z"
},
"papermill": {},
"tags": []
},
"source": [
"### Search and Download logos"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cellular-wheat",
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"def get_linkedin_url(\n",
" company\n",
"):\n",
" # Init\n",
" linkedin_url = None\n",
"\n",
" # Create query\n",
" query = f\"{company}+Linkedin\"\n",
" print(\"Google query: \", query)\n",
"\n",
" # Search in Google\n",
" for i in search(query, tld=\"com\", num=10, stop=10, pause=2):\n",
" pattern = \"https:\\/\\/.+.linkedin.com\\/company\\/.([^?])+\"\n",
" result = re.search(pattern, i)\n",
"\n",
" # Return value if result is not None\n",
" if result != None:\n",
" linkedin_url = result.group(0).replace(\" \", \"\")\n",
" return linkedin_url\n",
" return linkedin_url\n",
"\n",
"def dowload_image(\n",
" image_url, \n",
" image_path\n",
"):\n",
" # Send a GET request to the image URL\n",
" response = requests.get(image_url)\n",
"\n",
" # Check if the request was successful\n",
" if response.status_code == 200:\n",
" # Get the content of the response\n",
" image_content = response.content\n",
"\n",
" # Save the image to a file\n",
" with open(image_path, \"wb\") as file:\n",
" file.write(image_content)\n",
" print(\"✅ Image downloaded successfully.\")\n",
" else:\n",
" print(f\"Failed to download image. Error: {response.text}\")\n",
"\n",
"for x in companies:\n",
" print(\"- \", x)\n",
" file_name = x + \".png\"\n",
" if file_name not in logos:\n",
" linkedin_url = get_linkedin_url(x)\n",
" print(\"Company URL:\", linkedin_url)\n",
" if linkedin_url:\n",
" df = linkedin.connect(li_at, JSESSIONID).company.get_info(linkedin_url)\n",
" logo_url = df.loc[0, \"LOGO_URL\"]\n",
" if str(logo_url) != \"None\":\n",
" file_path = os.path.join(output_dir, file_name)\n",
" dowload_image(logo_url, file_path)\n",
" else:\n",
" print(\"Logo does not exists in LinkedIn\")\n",
" else:\n",
" print(\"✅ Logo already exists\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ab4d46dc-6347-4c54-8f6b-4ea9918ef542",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
},
"naas": {
"notebook_id": "4524ee41a55c75df72f6dc0d75ada96d8305d81e20b3626f7a785d6be7431b9d",
"notebook_path": "Google Search/Google_Search_Get_LinkedIn_company_url_from_name.ipynb"
},
"papermill": {
"default_parameters": {},
"environment_variables": {},
"parameters": {},
"version": "2.3.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"tags": []
},
"source": [
"**Last update:** 2023-04-12 (Created: 2022-03-20)"
"**Last update:** 2023-11-06 (Created: 2022-03-20)"
]
},
{
Expand Down Expand Up @@ -90,7 +90,7 @@
"tags": []
},
"source": [
"### Import library"
"### Import libraries"
]
},
{
Expand All @@ -113,13 +113,13 @@
},
{
"cell_type": "markdown",
"id": "b205686b-b3d5-4a82-8209-6dc2c75f3f7d",
"id": "a6daef10-0ae2-4717-8044-b4063dce2016",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"### Variables"
"### Setup variables"
]
},
{
Expand Down Expand Up @@ -264,4 +264,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
Loading
Loading