如果你想去了解一些新兴科技产品和创意项目,你可以会选择上Product Hunt这个网站。https://www.producthunt.com/
Product Hunt是什么?它是一个供用户分享和发现产品的网站,每周都会有上千个新产品新项目在ProductHunt上发布
它提供了平台供创业者、开发者和用户分享他们发现的新产品,并进行投票、评论和互动。

网站上的产品特别多,其实我在想,是否可以每天汇总前一天最热门的产品,然后通过telegram或者邮件在固定的时候发给我,这样我就能了解到前一天都是什么产品最热门,这些产品都是做什么的,甚至大家对他们的评价是怎样的…
那么我就用n8n,来做一个简单的工作流,来实现这么一个需求吧。
需求很简单,我想每天早上9点,汇总product hunt里投票最多的五个产品,然后把这些产品的名字、描述、票数、标签和评论,通过gmail以列表的方式发给我。
那我们开始。
首先在n8n新建一个工作流,起个名字Get top5 on Product Hunt every day
1、Schedule Trigger
第一个节点,我们设置Schedule Trigger节点,这是一个时间触发器

然后我们可以设置每天早上9点自动触发此流程

2、code

第二个节点,我们需要添加一个code节点,在这个节点,我们希望可以先获取到一个时间段,也就是前一天这个时间段。因为我们后面也希望获取到这个时间段里的产品票数。
所以在code节点里,我们通过一段简单的JS代码来实现这个逻辑

return [
{
json: {
postedAfter: new Date(new Date(Date.now()).getTime() - (1000 * 60 * 60 * 24)).toISOString(),
postedBefore: new Date(Date.now()).toISOString()
}
}
];
3、GraphQL
GraphQL是一个用于API 的查询语言。producthunt支持的接口比较特殊,就是GraphQL。
所以我们这个节点,就是通过GraphQL来获取到producthunt的top 5的产品数据。

Endpoint就是https://api.producthunt.com/v2/api/graphql
Query参数这里,我们可以这样写
query PostRanking {
posts(postedAfter: " {{ $json.postedAfter }}", order: RANKING, first: 5, postedBefore: "{{ $json.postedBefore }}") {
edges {
node {
name
tagline
description
votesCount
website
comments {
edges {
node {
body
}
}
}
}
}
}
}
这个意思就是,我们希望可以查询到前一天的,排名前5的产品的name、tagline、description、votesCount 、website、comments
ok,执行一下试试

在output里,看到是一一个数组的方式返回给了我们所有的产品信息,说明获取数据是没有问题的。
4、code
我们已经获取到了产品数据,接下来就是看怎么发送到gmail
再发之前,我们需要简单处理下数据的格式,总不能这样一堆就扔到邮件里,看起来也不方便。
所以我们就再用code节点,简单做一下样式的处理。
我们希望通过表格的方式来呈现出所以内容。

我们希望这个列表,第一列是name,第二列是tagline,第三列是description,第四列是votesCount,第五列是website,第六列是comments,并且comments用序号来分类展示,这样更清晰一些。
return items.map(item => {
const product = item.json.data.posts.edges.map(edge => edge.node);
const tableRows = product.map(prod => {
const comments = prod.comments.edges.map((comment, index) => `${index + 1}. ${comment.node.body}`).join("<br>");
return `<tr>
<td>${prod.name}</td>
<td>${prod.tagline}</td>
<td>${prod.description}</td>
<td>${prod.votesCount}</td>
<td><a href="${prod.website}">${prod.website}</a></td>
<td>${comments}</td>
</tr>`;
}).join("");
const tableHTML = `
<table border="1">
<thead>
<tr>
<th>Name</th>
<th>Tagline</th>
<th>Description</th>
<th>Votes Count</th>
<th>Website</th>
<th>Comments</th>
</tr>
</thead>
<tbody>
${tableRows}
</tbody>
</table>
`;
return {
json: {
tableHTML: tableHTML
}
};
});
来运行一下试试看

返回的是一段HTML。
5、gmail
好了,最后,我们就是把这段内容通过邮件发给我。

那么最后,我们选择gmail节点,选择send message操作

在这里的配置,我们都需要注意下:
- Credential to connect with:需要连接到我们的gmail账户,这里我们用OAuth2的方式来连接,具体连接方式这里就不介绍了。如果有问题后续我专门写一个操作指引
- Resource:选择message
- Operation:选择send
- To:选择发送给谁,那么这里我就写我自己的邮件地址。
- Subject:也就是你收到邮件的标题。
- Email Type:选择HTML
- Message:在邮件里,我们具体要展示什么。 这里就是直接选择上一步我们获取到的tableHTML
好了,设置完了,我们运行下试试。

output里,看到是已经成功的执行了一个邮件任务。
我们去到邮箱里来看看
看到是已经收到了一条

点击进去,我们就可以看到top5的产品列表了,也挺清晰。

最后,我们开启这个工作流,运行即可。
这就是简单的一个获取产品信息的工作流,我们可以每天看看最近火热的都是什么产品,大家的评价都是如何,非常的高效。
其实可以更进一步,比如根据这些评论,我们可以再通过AI,来帮我们解读下产品的评论,看看大家正面和负面的评价,或者是需求,还是非常有价值的。



Pingback: n8n如何添加AI节点?在自动化流程中融入AI能力 - 吨师傅工具箱
Your article helped me a lot, is there any more related content? Thanks!
88vi treating me right! Great streaming options, especially for live sports. Definitely worth a look 88vi.
Hey, checked out 289winlogin – pretty straightforward, got me logged in quick! No BS, just what I needed. Solid! Check it out here: 289winlogin
Your article helped me a lot, is there any more related content? Thanks! https://accounts.binance.com/el/register?ref=DB40ITMB
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Spinning the reels at win55club tonight! Games seem lively and the payouts are promising, fingers crossed I get lucky! Feeling good vibes, so far so good. See what all the fuss is about over at win55club.
Trying out New8 platform. Everything looks very modern and slick! Will report back how it performs. Consider new8 if you want a change of scenery over at new8
Z999? Yeah, I stumbled across it the other day. It’s alright, has some interesting stuff. Worth a browse if you’re killing time and looking for something new. Take a gander: z999
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
betmgm Florida betmgm-play betmgm Iowa
Transform your downtime into profitable and enjoyable sessions. In ignation casino, automated promotions deliver surprises regularly. Expect the unexpected and win!
Explore earning avenues and entertaining endlessness. In ignation casino online, fair audits trust. Explore and enrich!
Sign up at the electrifying world of online gaming where endless fun awaits. Bovada Online Casino offers top video poker and deposit matches for all players. With Bovada, enjoy exciting wins and secure, reliable entertainment every day!
Dive deep into Big Bass Bonanza for massive wins! Free spins Big Bass Bonanza bonus buy retrigger with growing multipliers — up to 10x!
Your article helped me a lot, is there any more related content? Thanks! https://accounts.binance.info/en-NG/register-person?ref=YY80CKRN
82jiliphlogin, eh? Gave it a shot and the login was smooth. Nothing super fancy, but it works. Give it a try if you’re curious. 82jiliphlogin
8casinocomapp… Decent enough app for a quick flutter. Nothing outstanding, but it does the job. Quick deposits, relatively easy withdrawals. Check it out for yourself: 8casinocomapp
Bet786? Alright, let’s be real; it’s another betting site. BUT! They do have competitive odds on certain sports. Shop around and see if it works for you! More info: bet786
Gates of Olympus throws conventional slots out the window. Anywhere-wins + random ?500 multipliers create moments of pure disbelief. Play gates of olympus and live the myth.
Sugar-coated mega-wins incoming! sugar rush 5000x is all about tumbling symbols, multiplier collection and pure joy. Spin and let the candies fall!
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article. https://accounts.binance.info/ro/register-person?ref=HX1JLA6Z
No deposit, all thrills—luckylandslotsx delivers! Sign up and receive 7,777 Gold Coins plus 10 free Sweeps Coins. Spin away and turn your wins into redeemable cash!
Crash, Tower, Limbo, Plinko — stake crypto casino Originals keep players coming back every day. Try them free first.
Start strong and win bigger at betmgm online casino. New players get 100% deposit match up to $1,000 and $25 free play. Live casino, slots, and jackpots — all in one place.
DraftKings exclusive games Casino lights up your screen. New welcome pack: 500 spins for $5 + up to $1K lossback. From slots to live—dominate!