
工作流描述:产品数据提取器
此工作流通过结合Webhook交互、HTML处理、基于AI的数据分析和结构化输出格式,自动化从Product Hunt提取产品数据。它旨在动态处理传入请求,并为进一步使用返回详细的JSON响应。
概述
该工作流处理通过Webhook提交的产品名称。它获取相应的Product Hunt页面,提取并分析内联脚本,并使用AI工具将数据结构化为定义良好的JSON格式。最终的JSON响应通过Webhook返回给客户端。
工作流步骤
1. Webhook监听器
节点:接收产品请求
功能:捕获包含要处理的产品名称的传入请求。
详细信息:接受HTTP请求并从查询字符串中提取产品参数,例如/?product=epigram。
2. 获取产品HTML
节点:获取产品HTML
功能:发送HTTP请求以检索指定Product Hunt页面的HTML内容。
详细信息:使用产品名称构建动态URL并获取页面数据。
3. 提取内联脚本
节点:提取内联脚本
功能:解析HTML内容以提取部分中的内联脚本。
详细信息:排除包含src属性的脚本并验证内联脚本的存在。
4. 使用LLM处理数据
节点:使用LLM处理脚本
功能:使用语言模型分析提取的脚本以识别关键产品数据。
详细信息:处理脚本以获取结构化和有意义的见解。
5. 使用Google Gemini优化数据
节点:使用Google Gemini分析脚本
功能:利用Google Gemini AI增强脚本数据分析。
详细信息:确保提取的数据精确且丰富。
6. 将产品数据格式化为JSON
节点:将产品数据格式化为JSON
功能:将处理后的数据结构化为干净的JSON格式。
详细信息:定义模式以确保输出中包含所有相关字段。
7. 向客户端发送JSON响应
节点:向客户端发送JSON响应
功能:将最终的结构化JSON响应返回给客户端。
详细信息:通过发起请求的同一Webhook发送响应。例如,。
关键特性
– 多功能用例:此工作流可用于收集Product Hunt数据以创建博客文章,或作为AI代理有效研究产品的工具。
– 动态处理:通过动态URL构建适应各种产品名称。
– AI集成:利用Gemini 1.5 8B AI模型,提供减少的延迟和根据用例的最小或零成本。
– 选择器独立性:即使Product Hunt的DOM结构发生变化也能正常工作,因为它不依赖直接DOM选择器。
– 可靠的数据输出:低温度设置(0)和精确定义的JSON模式确保准确和真实的数据提取。
– 结构化输出:确保输出JSON遵循预定义模式以保持一致性。
– 错误处理:包括验证以优雅地处理缺失或格式错误的数据。
自定义选项
限制
– 对Product Hunt的依赖:Product Hunt页面加载数据方式的重大更改可能需要修改工作流。
– 适应性:即使发生变化,由于工作流依赖AI而非直接DOM选择器,也可以更新以保持功能。
– 修改Webhook路径以适应您的应用程序。
– 调整语言模型的提示以包含其他字段。
– 根据需要扩展JSON模式以捕获更多数据字段。
预期输出
性能指标
– 响应时间:通常每个产品约6秒。
– 准确性:由于预定义的JSON模式,数据提取精度>95%。
包含指定产品详细信息的JSON对象。以下是产品Epigram的完整响应示例:
{
“id”: “861675”,
“slug”: “epigram”,
“followersCount”: 181,
“name”: “Epigram”,
“tagline”: “Open-Source, Free, and AI-Powered News in Short”,
“reviewsRating”: 0,
“logoUuid”: “735c2528-554c-467c-9dcf-745ee4b8bbdd.png”,
“postsCount”: 1,
“websiteUrl”: “https://epigram.news”,
“websiteDomain”: “epigram.news”,
“metaTitle”: “Epigram – Open-source, free, and ai-powered news in short”,
“postName”: “Epigram”,
“postTagline”: “Open-source, free, and ai-powered news in short”,
“dailyRank”: “3”,
“description”: “An open-source, AI-powered news app for busy people. Stay updated with bite-sized news, real-time updates, and in-depth analysis. Experience balanced, trustworthy reporting tailored for fast-paced lifestyles in a sleek, user-friendly interface.”,
“pricingType”: “free”,
“userName”: “Fazle Rahman”,
“userHeadline”: “Co-founder & CEO, Hashnode”,
“userUsername”: “fazlerocks”,
“userAvatarUrl”: “https://ph-avatars.imgix.net/129147/f84e1796-548b-4d6f-9dcf-745ee4b8bbdd.jpeg”,
“makerName1”: “Fazle Rahman”,
“makerHeadline1”: “Co-founder & CEO, Hashnode”,
“makerUsername1”: “fazlerocks”,
“makerAvatarUrl1”: “https://ph-avatars.imgix.net/129147/f84e1796-548b-4d6f-9dcf-745ee4b8bbdd.jpeg”,
“makerName2”: “Sandeep Panda”,
“makerHeadline2”: “Co-Founder @ Hashnode”,
“makerUsername2”: “sandeepg33k”,
“makerAvatarUrl2”: “https://ph-avatars.imgix.net/101872/80b0b618-a540-4110-a6d1-74df39675ad0.jpeg”,
“primaryLinkUrl”: “https://epigram.news/”,
“media1OriginalHeight”: 1080,
“media1OriginalWidth”: 1440,
“media1ImageUuid”: “ac426fd1-3854-4734-b43d-34a5e06347ea.gif”,
“media1MediaType”: “video”,
“media1MetadataUrl”: “https://www.loom.com/share/b1a48a9b3cac4ba89ce772a3fbcc2847?sid=75efc771-25fa-4ac0-bb1b-5e38fc447deb”,
“media1VideoId”: “b1a48a9b3cac4ba89ce772a3fbcc2847”,
“media2OriginalHeight”: 630,
“media2OriginalWidth”: 1200,
“media2ImageUuid”: “8521a6bd-7640-487b-abd6-29b9f65fee32”,
“media2MediaType”: “image”,
“media2MetadataUrl”: null,
“launchState”: “featured”,
“thumbnailImageUuid”: “735c2528-554c-467c-9dcf-745ee4b8bbdd.png”,
“link1StoreName”: “Website”,
“link1WebsiteName”: “epigram.news”,
“link2StoreName”: “Github”,
“link2WebsiteName”: “github.com”,
“latestScore”: 233,
“launchDayScore”: 233,
“userId”: “129147”,
“topic1”: “News”,
“topic2”: “Open Source”,
“topic3”: “Artificial Intelligence”,
“weeklyRank”: “24”,
“commentsCount”: 20,
“postUrl”: “https://www.producthunt.com/posts/epigram”
}
目标受众
此工作流非常适合寻求自动化从Product Hunt提取和结构化产品数据以进行分析、报告或与其他工具集成的开发人员、营销人员和数据分析师。

评论(0)