如何用n8n自动化流程,每天发送当天的天文图片到telegram频道

今天试试用n8n实现一个好玩的流程,每天发送当天的天文图片到telegram频道。

这是一个使用NASA节点将当天的每日天文图片发送到Telegram频道的工作流。

而且实现起来非常的简单。

我们来看看具体如何配置。

1、Schedule Trigger节点

首先在第一个节点配置Schedule Trigger,可以选择触发工作流的时间,比如在每天的0点触发工作流。

2、NASA节点

n8n里面提供了NASA的节点,我们直接选择就可以。

在action里面,我们选择“Get the astronomy picture of the day”的操作。

NASA节点从NASA API获取当天的天文图片。

获取图片之前我们需要注册一个NASA的账号,来获取到API key

直接用邮箱注册获取即可,NASA API地址:https://api.nasa.gov/

然后我们在节点的连接这里,黏贴获取到的key

然后选择是否要download图片

这个节点的配置就完成了。

我们可以点击运行试试看效果

看到是已经正常的output出的图片。

点击view来看一下

还是挺有意思的~

3、telegram

最后,我们希望通过telegram bot,把这个图片发到对应的频道。

首先添加一个telegram节点,选择send a photo message

(1)我们先去telegram创建个机器人

如何配置?

①在Telegram中搜索“BotFather”,然后单击“开始”

②在BotFathe输入 /newbot的指令,即新建一个bot

③输入机器人的名称(以后可以更改)

④获得了bot的token,这个token保留好

到此机器人就创建好了。

(2)在n8n的telegram节点里进行配置

①连接telegram

这里把你创建好的bot的token黏贴到这里来

②chat id

chat id如何获取:给机器人发条消息,然后打开链接:https://api.telegram.org/bottoken/getUpdates,注意token这里要换成你机器人的实际token

打开链接之后,红框里的id ,就是chat id了

把这个id值黏贴到文本框里即可

③在photo的字段这里,我们把nasa节点output出来的hdurl拖拽到这里。

最后我们运行一下这个流程试试

看到在我们的telegram bot里,已经收到了这条信息

是不是挺有意思的?

22人评论了“如何用n8n自动化流程,每天发送当天的天文图片到telegram频道”

  1. Slot tại xn88 có biểu tượng động và hiệu ứng rung (trên điện thoại) – tăng cảm giác chân thực và phấn khích khi trúng thưởng lớn. TONY02-27

  2. Votre pharmacie ouvre 24h/24 sur internet. Trouvez ce qu’il vous faut parmi des milliers de produits de sante. Paiement securise et livraison en point relais ou chez vous. La sante sans les contraintes.colchicine

  3. Join the millions friendly strapping on fanduel casino Florida – the #1 real in dough casino app in America.
    Pick up your $1000 OPERATE IT AGAIN hand-out and refashion every twirl, хэнд and roll into legitimate coin of the realm rewards.
    Firm payouts, gigantic jackpots, and habitual effect – download FanDuel Casino in these times and start playing like a pro today!

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注

滚动至顶部