theowenyoung/blog

How to automatically send messages to TG robots

Closed this issue · 6 comments

https://github.com/theowenyoung/blog/tree/main/scripts/cronbin

How does this project push a message to the TG robot after it runs successfully?

Thank you!

In addition, I have another requirement, can I automatically log in when visiting the website?

For example, log in to a mailbox or a forum that does not require verification.

How does this project push a message to the TG robot after it runs successfully?

sorry, now you can't do it, but it's easy to add this function, you can add it by yourself.

In addition, I have another requirement, can I automatically log in when visiting the website?
yes, you can add cookie in the curl command.

yes, you can add cookie in the curl command.

How should it be written the curl command ? Can you give an example?

Is it possible to log in with a username + password without the aid of cookies, and can this feature be added to the panel?

Are you Chinese?

How should it be written the curl command ? Can you give an example?

it depends on your target site, for example:

curl -b "session=123456; user_id=789" https://example.com/api/data

Is it possible to log in with a username + password without the aid of cookies, and can this feature be added to the panel?

it depends on your target site, if your target support username+password, you can use :

 curl -u username:password https://example.com/api/secure

Are you Chinese?

yes.

我还费半天劲翻译成英文来回复。直接发中文好了

非常感谢你的解答,自动登录的问题我已明白了。

关于tg推送,虽然你可能觉得简单,两个参数tgid和tgtoken我都有,但我确实不知道怎么改。近期是否有更新代码的计划呢?或者给我一点提示,这代码应该加在哪里?怎么加?我希望的是自动访问或登录网站失败的情况下,给tg机器人推送信息

不好意思回复晚了,telegram bot大概是这样配置:

curl --location 'https://api.telegram.org/bot1351044089:xxxxxxxxxxxxxxx/sendMessage' \
--header 'Content-Type: application/json' \
--data '{
    "chat_id":"-100000000000",
    "text":"{{message}}"
}'

请替换你的密钥,并且想办法获取 chat_id

收到,感谢你的解答