new data added
This commit is contained in:
+272
-110
@@ -2,7 +2,7 @@
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"execution_count": 32,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@@ -11,7 +11,7 @@
|
||||
"True"
|
||||
]
|
||||
},
|
||||
"execution_count": 12,
|
||||
"execution_count": 32,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@@ -25,6 +25,8 @@
|
||||
"from tavily import TavilyClient\n",
|
||||
"from langchain_core.prompts.prompt import PromptTemplate\n",
|
||||
"from langchain_core.output_parsers import StrOutputParser, JsonOutputParser\n",
|
||||
"import concurrent.futures\n",
|
||||
"import json\n",
|
||||
"from loguru import logger\n",
|
||||
"load_dotenv()"
|
||||
]
|
||||
@@ -147,46 +149,18 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"execution_count": 21,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"prompt = \"\"\"\n",
|
||||
" Give me a list of the names of the all the beauty and skincare influencers in USA\n",
|
||||
" Give me a list of the names of the all the top and popular beauty and skincare influencers in USA. People that are known across the internet. I only need their names. Give me all that's available as much as possible. \n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# prompt = \"\"\"\n",
|
||||
"# I'm a business owner in search for influencers to promote my brand.\\n\n",
|
||||
"# My brand falls under this category : \"Beauty & Skincare\" \\n.\n",
|
||||
"# I need your help with getting information for at least the top 30 influencers in Alabama in the USA. \\n\n",
|
||||
"# These are the informations I need regarding each of them: \\n\n",
|
||||
"# 1. Name \\n\n",
|
||||
"# 2. Contact info \\n\n",
|
||||
"# 4. Facebook username\\n\n",
|
||||
"# 5. Instagram username \\n\n",
|
||||
"# 6. Tiktok username \\n\n",
|
||||
"# 7. Youtube username \\n\n",
|
||||
"# 8. Facebook followers \\n\n",
|
||||
"# 9. Instagram followers \\n\n",
|
||||
"# 10 Tiktok followers \\n\n",
|
||||
"# 11. Youtube subscribers \\n \n",
|
||||
"# For cases where you don't know or have the details, just return Null. \\n\n",
|
||||
"# Make sure you return a structured response only. Don't add extra informations. \\n \n",
|
||||
"# I want all the information regarding each of the influencers noted properly. \\n\n",
|
||||
"# Please do this carefully and correctly. \n",
|
||||
"# \"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"execution_count": 22,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@@ -194,7 +168,7 @@
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\n",
|
||||
" Give me a list of the names of the all the beauty and skincare influencers in USA\n",
|
||||
" Give me a list of the names of the all the top and popular beauty and skincare influencers in USA. People that are known across the internet. I only need their names. Give me all that's available as much as possible. \n",
|
||||
"\n"
|
||||
]
|
||||
}
|
||||
@@ -205,67 +179,47 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"execution_count": 23,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Given the extensive list of influencers across various sources, here is a combined list of beauty and skincare influencers mentioned in the provided search results:\n",
|
||||
"Here is a comprehensive list of popular beauty and skincare influencers in the USA, based on the provided sources:\n",
|
||||
"\n",
|
||||
"### From Modash (Top 20 American Beauty Influencers on Instagram)\n",
|
||||
"1. Alexis Tyler (@iamalexistyler)\n",
|
||||
"2. LaShay (@k_bella3)\n",
|
||||
"3. G.H.❤️ RN,BSN👩🏽⚕️ (@_therealparis)\n",
|
||||
"4. Ashanti Camille | HTX Fashion & Lifestyle\n",
|
||||
"5. MaLeaн\n",
|
||||
"6. C J (@hoodspolitic_)\n",
|
||||
"7. 💕🐎COUNTRY BEAUTY🐎💕 (@_escapewithsyd)\n",
|
||||
"8. Beauty Therapist (@ambitiousamb__)\n",
|
||||
"9. Faye Davis (@mz_fae88)\n",
|
||||
"10. Media Queen 👑 (@what_shayna_say)\n",
|
||||
"11. Tee 🤍 | Natural Hair + UGC (@theblushway)\n",
|
||||
"12. (And 8 more influencers listed on the page, but not detailed here due to space constraints)\n",
|
||||
"1. **Caroline Hirons**\n",
|
||||
"2. **Hyram Yarbro**\n",
|
||||
"3. **Shalini Kutti**\n",
|
||||
"4. **Amy Serrano**\n",
|
||||
"5. **Cecilia**\n",
|
||||
"6. **Ozy**\n",
|
||||
"7. **Divina Wong**\n",
|
||||
"8. **Shreya Jain**\n",
|
||||
"9. **Debasree Banerjee**\n",
|
||||
"10. **Shalini Srivastava**\n",
|
||||
"11. **Ankita Chaturvedi**\n",
|
||||
"12. **Adrianna Kalisz**\n",
|
||||
"13. **Bethany Mota**\n",
|
||||
"14. **Zoe Elizabeth Sugg (Zoella)**\n",
|
||||
"15. **Rachel Levin**\n",
|
||||
"16. **Nikkie De Jager**\n",
|
||||
"17. **Eva Gutowski**\n",
|
||||
"18. **Marzia Bisognin**\n",
|
||||
"19. **Jeffree Star**\n",
|
||||
"20. **Carli Bybel**\n",
|
||||
"21. **Mindy McKnight**\n",
|
||||
"22. **Promise Phan**\n",
|
||||
"23. **Jessica Lyn**\n",
|
||||
"24. **Cordelia (Phyrra)**\n",
|
||||
"25. **Jennifer Mathews**\n",
|
||||
"26. **Sunny Subramanian**\n",
|
||||
"27. **Vicky Farrell**\n",
|
||||
"28. **Mariel**\n",
|
||||
"29. **Danielle**\n",
|
||||
"30. **Kasey S**\n",
|
||||
"\n",
|
||||
"### From Feedspot (Top 50 Cruelty Free Beauty Influencers in 2024)\n",
|
||||
"1. Jessica Lyn (@veganbeautyaddict)\n",
|
||||
"2. Cordelia (@phyrra)\n",
|
||||
"3. Jennifer Mathews\n",
|
||||
"4. Sunny Subramanian\n",
|
||||
"5. Vicky (@kabukirune)\n",
|
||||
"6. Bella Fiori\n",
|
||||
"7. Suzana Rose\n",
|
||||
"8. Tashina\n",
|
||||
"9. Mariel (@marielveganbeauty)\n",
|
||||
"10. Danielle (@crueltyfreeveganbeauty)\n",
|
||||
"11. Kasey S (@skinandvelvet)\n",
|
||||
"12. Project Pan (@themakeupfairy_)\n",
|
||||
"13. Caitie Anisman-Reiner (@naturallabeauty)\n",
|
||||
"14. Krisztina Williams (@krisztinawilliams)\n",
|
||||
"15. Dreesa (@flightqueen7)\n",
|
||||
"16. Marissa Jean (@glambyrissaj)\n",
|
||||
"17. Hailee Jones (@haileejonesmua)\n",
|
||||
"18. Kate Audrey (@kateaudreyartistry)\n",
|
||||
"19. Becky Louise (@bottled.blue)\n",
|
||||
"20. (And 30 more influencers listed on the page, but not detailed here due to space constraints)\n",
|
||||
"\n",
|
||||
"### From Amber (Top 20 Beauty Influencers You Must Follow on TikTok)\n",
|
||||
"1. Nikkia Joy\n",
|
||||
"2. Makeup by Analiza\n",
|
||||
"3. Sanny\n",
|
||||
"4. BJ Bushra\n",
|
||||
"5. sarahli\n",
|
||||
"6. Sasha_British\n",
|
||||
"7. chass\n",
|
||||
"8. Ruby Malik\n",
|
||||
"9. Makeup A Murder, INC.\n",
|
||||
"10. (And 10 more influencers listed on the page, but not detailed here due to space constraints)\n",
|
||||
"\n",
|
||||
"### Note:\n",
|
||||
"- The list from Modash and Feedspot focuses on Instagram influencers, while the list from Amber focuses on TikTok influencers.\n",
|
||||
"- The full list of influencers from each source is extensive and includes many more names than those listed here.\n",
|
||||
"- This compilation aims to provide a broad overview of beauty and skincare influencers in the USA, but it is not exhaustive due to the vast number of influencers across various platforms.\n"
|
||||
"Note: This list includes both macro and micro influencers, as well as those who specialize in various aspects of beauty and skincare.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -276,33 +230,33 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"execution_count": 17,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Based on the provided search result, here are the available details for Faye Davis:\n",
|
||||
"Based on the provided search result and general knowledge, here are the available details for Chriselle Lim:\n",
|
||||
"\n",
|
||||
"1. **Name**: Faye Davis\n",
|
||||
"2. **Contact info**: Available on Modash, but requires a login or trial to access.\n",
|
||||
"3. **Facebook username**: Not provided in the search results.\n",
|
||||
"4. **Instagram username**: @mz_fae88.\n",
|
||||
"5. **TikTok username**: Not provided in the search results.\n",
|
||||
"6. **YouTube username**: Not provided in the search results.\n",
|
||||
"7. **Facebook followers**: Not provided in the search results.\n",
|
||||
"8. **Instagram followers**: 12.3k.\n",
|
||||
"9. **TikTok followers**: Not provided in the search results.\n",
|
||||
"10. **YouTube subscribers**: Not provided in the search results.\n",
|
||||
"1. **Name**: Chriselle Lim\n",
|
||||
"2. **Contact Info**: Not provided in the search result.\n",
|
||||
"4. **Facebook Username**: Not specified in the search result.\n",
|
||||
"5. **Instagram Username**: TheChriselleFactor (though not directly mentioned in the provided link, it is commonly known and can be inferred from her website name, TheChriselleFactor.com)\n",
|
||||
"6. **TikTok Username**: Not specified in the search result.\n",
|
||||
"7. **YouTube Username**: Not specified in the search result, but it is also TheChriselleFactor based on general knowledge.\n",
|
||||
"8. **Facebook Followers**: Not specified in the search result.\n",
|
||||
"9. **Instagram Followers**: Not specified in the search result.\n",
|
||||
"10. **TikTok Followers**: Not specified in the search result.\n",
|
||||
"11. **YouTube Subscribers**: Not specified in the search result.\n",
|
||||
"\n",
|
||||
"The information available is limited to what is provided in the search result from Modash, focusing on Instagram influencers. For additional details, you would need to access more comprehensive data or contact Faye Davis directly.\n"
|
||||
"For more detailed and up-to-date information, visiting Chriselle Lim's official social media profiles or her website would be necessary.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"prompt = \"\"\"\n",
|
||||
" Give me a the following social details of Faye Davis, a beauty and skincare influencer: \\n\n",
|
||||
" Give me a the following social details of Chriselle Lim, a beauty and skincare influencer: \\n\n",
|
||||
" 1. Name \\n\n",
|
||||
" 2. Contact info \\n\n",
|
||||
" 4. Facebook username\\n\n",
|
||||
@@ -318,6 +272,61 @@
|
||||
"print(result)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 27,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def extract_names(influencer_names:str) -> dict:\n",
|
||||
" logger.info(f\"Formatting Influencer Data\")\n",
|
||||
" initiator_prompt = PromptTemplate(\n",
|
||||
" template=\"\"\"<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n",
|
||||
" You are a Influencer Data Extractor AI Agent tasked with extracting information from a search result\\n\n",
|
||||
" You are provided with three informations: \\n\n",
|
||||
" 1. Search result of influencers names\n",
|
||||
" \n",
|
||||
" Your job is to extract all the influencers names\\n\n",
|
||||
" Make sure to extract all the names there \\n\n",
|
||||
" You are to return this as a JSON output. The key should be 'names' in the JSON \\n\n",
|
||||
" Do not add to the search result, just return the JSON data of all the influencer names as expected.\\n\n",
|
||||
"\n",
|
||||
" <|eot_id|><|start_header_id|>user<|end_header_id|>\n",
|
||||
" INFLUENCER_NAMEs: {influencer_names}\\n\n",
|
||||
" \n",
|
||||
" <|eot_id|><|start_header_id|>assistant<|end_header_id|>\"\"\",\n",
|
||||
" input_variables=[\"influencer_names\"],\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
" initiator_router = initiator_prompt | llm | JsonOutputParser()\n",
|
||||
" output = initiator_router.invoke({\"influencer_names\":influencer_names})\n",
|
||||
" return output"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 28,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[32m2024-10-25 22:48:23.827\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{'names': ['Caroline Hirons', 'Hyram Yarbro', 'Shalini Kutti', 'Amy Serrano', 'Cecilia', 'Ozy', 'Divina Wong', 'Shreya Jain', 'Debasree Banerjee', 'Shalini Srivastava', 'Ankita Chaturvedi', 'Adrianna Kalisz', 'Bethany Mota', 'Zoe Elizabeth Sugg (Zoella)', 'Rachel Levin', 'Nikkie De Jager', 'Eva Gutowski', 'Marzia Bisognin', 'Jeffree Star', 'Carli Bybel', 'Mindy McKnight', 'Promise Phan', 'Jessica Lyn', 'Cordelia (Phyrra)', 'Jennifer Mathews', 'Sunny Subramanian', 'Vicky Farrell', 'Mariel', 'Danielle', 'Kasey S']}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(extract_names(result))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
@@ -334,31 +343,184 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 29,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
"source": [
|
||||
"product_categories = [\n",
|
||||
" \"Beauty & Skincare\",\n",
|
||||
" \"Fashion & Lifestyle\",\n",
|
||||
" \"Health & Fitness\",\n",
|
||||
" \"Travel & Adventure\",\n",
|
||||
" \"Food & Beverage\",\n",
|
||||
" \"Technology & Gadgets\",\n",
|
||||
" \"Gaming & Esports\",\n",
|
||||
" \"Parenting & Family\",\n",
|
||||
" \"Finance & Business\",\n",
|
||||
" \"Wellness & Mental Health\",\n",
|
||||
" \"Automotive & Motorsports\",\n",
|
||||
" \"Entertainment & Pop Culture\",\n",
|
||||
" \"Photography & Visual Arts\",\n",
|
||||
" \"Education & Learning\",\n",
|
||||
" \"Environmental & Sustainability\"\n",
|
||||
"]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 30,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
"source": [
|
||||
"def get_category_influencers(product_category: str):\n",
|
||||
" logger.info(\"Search for influencers names\")\n",
|
||||
" names_prompt = f\"Give me a list of the names of the all the top and popular {product_category} influencers in USA. People that are known across the internet. I only need their names. Give me all that's available as much as possible.\"\n",
|
||||
" search_names = perplexity_data(names_prompt)\n",
|
||||
" logger.info(\"Extracting influencers names\")\n",
|
||||
" influencers_names = extract_names(search_names)\n",
|
||||
" return influencers_names\n",
|
||||
" "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 31,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[32m2024-10-25 22:57:56.687\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 22:58:25.819\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 22:58:25.820\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{'names': ['Stefana Avara', 'Adrian Leung', 'Jennifer Tavernier', 'Mason Mahoney', 'Brenton Ross Simmons', 'Kayla Itsines', 'Jesse James West', 'Charlee Atkins', 'Vicky Justiz', 'Alexia Clark', 'Jacqueline Hooton', 'Marra Bentley', 'Sara Preston', 'Jenn Labonte', 'Shannon', 'Melissa Neill', 'Donna Tryba', 'Christine Dwyer', 'Sol Gilbert', 'Jessica Cooke', 'Sabrina Brenton', 'Marilynn Roth', 'Pam Dodd', 'Varalakshmi Yanamandra', 'Marc Ryan', 'Dani', 'Danielle Shugg', 'Isilda', 'Ishani Vellodi Reddy', 'Michelle Lewin', 'Tammy Hembrow', 'Anllela Sagra', 'Jen Selter', 'Emily Skye', 'Natalie Jill', 'Chalene Johnson', 'Yasmin Kadiri', 'Heidi Powell', 'Chris Powell', 'Jillian Michaels', 'Bob Harper', 'Tony Horton', 'Shaun T']}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(get_category_influencers(product_category=\"Health & Fitness\"))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 33,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
"source": [
|
||||
"# This is the function to get influencers for all product categories using multithreading concurrency\n",
|
||||
"def get_all_names(product_categories: list):\n",
|
||||
" all_influencers = {}\n",
|
||||
"\n",
|
||||
" # Using ThreadPoolExecutor for multithreading concurrency\n",
|
||||
" with concurrent.futures.ThreadPoolExecutor() as executor:\n",
|
||||
" # Create a dictionary where futures map to their category name\n",
|
||||
" future_to_category = {executor.submit(get_category_influencers, category): category for category in product_categories}\n",
|
||||
"\n",
|
||||
" for future in concurrent.futures.as_completed(future_to_category):\n",
|
||||
" category = future_to_category[future]\n",
|
||||
" try:\n",
|
||||
" influencers = future.result() # Get result of the completed future\n",
|
||||
" all_influencers[category] = influencers\n",
|
||||
" except Exception as exc:\n",
|
||||
" logger.error(f\"{category} generated an exception: {exc}\")\n",
|
||||
" \n",
|
||||
" return all_influencers"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 34,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[32m2024-10-25 23:12:53.262\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.265\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.271\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.278\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.280\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.283\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.286\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.290\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.296\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.301\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.305\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.308\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.321\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.325\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:12:53.327\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mSearch for influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:10.466\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:10.469\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:11.429\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:11.430\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:13.266\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:13.267\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:13.441\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:13.442\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:14.085\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:14.086\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:17.804\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:17.805\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:17.908\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:17.909\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:18.736\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:18.736\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:19.140\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:19.141\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:19.423\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:19.424\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:19.627\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:19.628\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:20.475\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:20.476\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:23.157\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:23.158\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:24.891\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:13:24.891\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:14:34.208\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mget_category_influencers\u001b[0m:\u001b[36m5\u001b[0m - \u001b[1mExtracting influencers names\u001b[0m\n",
|
||||
"\u001b[32m2024-10-25 23:14:34.209\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36m__main__\u001b[0m:\u001b[36mextract_names\u001b[0m:\u001b[36m2\u001b[0m - \u001b[1mFormatting Influencer Data\u001b[0m\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Fetch all influencer names concurrently\n",
|
||||
"all_influencers_data = get_all_names(product_categories)\n",
|
||||
"\n",
|
||||
"# Convert the result to JSON format\n",
|
||||
"all_influencers_json = json.dumps(all_influencers_data, indent=4)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Data saved to influencers_names_data.json\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Save the JSON data to a file\n",
|
||||
"output_file = 'influencers_names_data.json'\n",
|
||||
"with open(output_file, 'w') as file:\n",
|
||||
" file.write(all_influencers_json)\n",
|
||||
"\n",
|
||||
"# Optionally, print the saved file path\n",
|
||||
"print(f\"Data saved to {output_file}\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
|
||||
Reference in New Issue
Block a user