• 欢迎访问db1024网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏db1024吧

一个基于Go的Telegram RSS Bot机器人,支持应用内阅读预览

主机教程 Liam 1年前 (2019-07-06) 775次浏览 27个评论 扫描二维码
文章目录[隐藏]

说明:很久前博主介绍过一个Telegram RSS机器人→传送门,用起来还不错,就是安装对新手不太友好,这里就再介绍一个基于GoTelegram RSS Bot,安装很快,也支持直接在Telegram应用内预览订阅文章,很方便,也是博主用过最好用的一个Telegram RSS机器人,这里就说下使用方法。

截图

一个基于Go的Telegram RSS Bot机器人,支持应用内阅读预览

功能

  • 支持Telegram应用内Instant View
  • 默认10分钟抓取一次。
  • 支持为GroupChannel订阅RSS消息。

准备工作

Github地址:https://github.com/indes/flowerss-bot

1、申请Bot Token
打开Telegram,搜索@BotFather,发送/newbot ,申请一个Bot,申请完成后,会发给你一个Bot Token

2、申请Telegraph Token

curl https://api.telegra.ph/createAccount?short_name=moerats&author_name=moerats&author_url=https://www.moerats.com

返回的JSONaccess_token字段值即为Telegraph Token

Docker安装

1、安装Docker

#CentOS 6 rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum update -y yum -y install docker-io service docker start chkconfig docker on  #CentOS 7、Debian、Ubuntu curl -sSL https://get.docker.com/ | sh systemctl start docker systemctl enable docker 

2、运行镜像

#填入bot_token和telegraph_token参数后运行即可 docker run --restart=always --name flowerss -d -v /flowerssdata:/var/flowerss indes/flowerss-bot -b bot_token -t telegraph_token

Docker默认使用SQLite数据库,且文件存放在/flowerssdata文件夹。

手动安装

1、安装golang
这里直接使用最新版的go二进制安装,不然后面编译会因版本问题出错。

wget https://dl.google.com/go/go1.12.6.linux-amd64.tar.gz #解压 tar -C /usr/local -xzf go1.12.6.linux-amd64.tar.gz #生效 echo 'export PATH=$PATH:/usr/local/go/bin' >>/etc/profile source /etc/profile

2、安装依赖

#Debian、Ubuntu系统 apt install make gcc git -y  #CentOS系统 yum install make gcc git -y 

3、运行机器人

#拉取源码 git clone https://github.com/indes/flowerss-bot cd flowerss-bot #编译 make build #新建配置文件 nano config.yml

参数说明大致如下:

#Telegram Bot Token,必填 bot_token: XXX #Telegraph Token,用于转存原文到Telegraph,也就是即时查看功能,选填     telegraph_toke: xxxx #用于国内等无法连接Telegram API的情况,国外忽略 socks5: 127.0.0.1:1080 #RSS源扫描间隔(分钟),选填 update_interval: 10 #使用Mysql数据库,默认使用SQLite mysql:   host: 123.123.132.132   port: 3306   user: moerats   password: moerats   database: moerats   ##这里博主默认使用的SQLite,扫描间隔为5分钟,所以使用到的参数如下: bot_token: XXX telegraph_toke: xxxx update_interval: 5

最后启动:

./flowerss-bot & 

使用

使用命令:

/sub [url] 订阅(url 为可选) /unsub [url] 取消订阅(url 为可选) /list 查看当前订阅 /set 设置订阅 /help 帮助 

Channel订阅使用方法:

1、将Bot添加为Channel管理员 2、发送相关命令给Bot  #Channel订阅支持的命令 /sub @ChannelID [url] 订阅 /unsub @ChannelID [url] 取消订阅 /list @ChannelID 查看当前订阅 

ChannelID只有设置为Public Channel才有。如果是Private Channel,可以暂时设置为Public,订阅完成后改为Private,不影响Bot推送消息。

例如要给t.me/moerats频道订阅RSS更新:

1、将Bot添加到moerats频道管理员列表中 2、给Bot发送/sub @moerats https://www.moerats.com/feed/ 命令 

最后作者更新也很频繁,有心的可以去给个star鼓励下作者,说不定可以开发更多好用的功能。


db1024 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:一个基于Go的Telegram RSS Bot机器人,支持应用内阅读预览
喜欢 (0)
关于作者:
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(27)个小伙伴在吐槽
  1. Hello there, just became aware of your blog through Google, and found that it is really informative. I am gonna watch out for brussels. I'll be grateful if you continue this in future. A lot of people will be benefited from your writing. Cheers!
    web hosting sites2020-09-05 20:22 回复 Linux | Chrome 65.0.3325.181
  2. There's definately a lot to find out about this topic. I really like all the points you've made.
    webhosting2020-09-01 01:23 回复 Mac OS X | Firefox浏览器 61.0
  3. I seriously love your website.. Great colors & theme. Did you make this web site yourself? Please reply back as I'm planning to create my own personal blog and would like to find out where you got this from or just what the theme is named. Thank you!
    black mass2020-08-31 10:33 回复 Mac OS X | Chrome 51.0.2704.84
  4. I think that what you wrote was very logical. But, think on this, suppose you added a little content? I am not saying your information is not solid., but what if you added a title to possibly get people's attention? I mean 一个基于Go的Telegram RSS Bot机器人,支持应用内阅读预览 db1024 db1024 is a little vanilla. You could peek at Yahoo's home page and note how they create post titles to grab viewers to open the links. You might add a related video or a related picture or two to get readers excited about everything've got to say. In my opinion, it might make your blog a little bit more interesting.
    black mass2020-08-28 20:16 回复 Linux | Firefox浏览器 56.0
  5. It's nearly impossible to find educated people about this topic, but you sound like you know what you're talking about! Thanks
    cheap flights2020-08-28 04:36 回复 Mac OS X | Safari浏览器 601.1.27
  6. Really no matter if someone doesn't be aware of afterward its up to other users that they will help, so here it occurs.
    cheap flights2020-08-28 03:39 回复 Linux | Chrome 68.0.3398.0
  7. Its such as you learn my mind! You seem to grasp so much approximately this, like you wrote the guide in it or something. I believe that you could do with some % to drive the message house a little bit, however instead of that, that is excellent blog. An excellent read. I will definitely be back. 31muvXS cheap flights
    cheap flights2020-08-25 06:48 回复 Mac OS X | Chrome 63.0.3239.84
  8. great submit, very informative. I'm wondering why the opposite experts of this sector don't understand this. You should continue your writing. I am sure, you've a great readers' base already! cheap flights yynxznuh
    cheap flights2020-08-25 03:18 回复 Windows 7 | 360浏览器 SE
  9. This is a topic that's near to my heart... Take care! Where are your contact details though?
    cheap flights2020-08-24 20:03 回复 Windows 7 | Internet Explorer 9.0
  10. Hi there, all is going nicely here and ofcourse every one is sharing data, that's in fact fine, keep up writing.
    web hosting providers2020-08-14 21:41 回复 Windows 7 | 360浏览器 SE
  11. Hi there, I wish for to subscribe for this blog to get hottest updates, therefore where can i do it please help.
    web hosting service2020-08-10 06:17 回复 Mac OS X | Chrome 63.0.3239.84
  12. Hi there, I enjoy reading through your article. I wanted to write a little comment to support you.
    web hosting providers2020-08-07 22:25 回复 Linux | Firefox浏览器 52.9
  13. Asking questions are genuinely good thing if you are not understanding something completely, however this piece of writing provides nice understanding even.
    best web hosting sites2020-08-06 22:52 回复 Linux | Firefox浏览器 52.9
  14. I know this web site presents quality depending content and extra stuff, is there any other site which gives these data in quality?
    web hosting company2020-08-05 23:53 回复 Linux | Chrome 65.0.3325.181
  15. I'm gone to convey my little brother, that he should also pay a visit this blog on regular basis to get updated from hottest gossip.
    travelocity flights2020-07-31 09:04 回复 Linux | Firefox浏览器 56.0.4
  16. Heya i'm for the first time here. I came across this board and I in finding It really helpful & it helped me out much. I am hoping to offer one thing again and aid others such as you helped me. adreamoftrains best web hosting
    adreamoftrains best hosting2020-07-30 21:52 回复 Linux | Firefox浏览器 59.0
  17. When I originally commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get several e-mails with the same comment. Is there any way you can remove people from that service? Thanks a lot!
    web host2020-07-27 06:13 回复 Linux | Firefox浏览器 60.0.1
  18. This is a topic which is close to my heart... Take care! Exactly where are your contact details though?
    best website hosting2020-07-26 08:08 回复 Linux | Chrome 53.0.2834.76
  19. Hello! Do you know if they make any plugins to protect against hackers? I'm kinda paranoid about losing everything I've worked hard on. Any suggestions?
    web hosting services2020-07-25 14:13 回复 Linux | Chrome 65.0.3325.183
  20. I was able to find good info from your articles.
    web hosting service2020-07-23 08:43 回复 Windows 7 | Opera 9.80
  21. Incredible! This blog looks just like my old one! It's on a entirely different subject but it has pretty much the same page layout and design. Excellent choice of colors!
    best web hosting2020-07-22 09:03 回复 Linux | Chrome 61.0.3116.0
  22. Hello there! I know this is kinda off topic however , I'd figured I'd ask. Would you be interested in exchanging links or maybe guest writing a blog post or vice-versa? My blog goes over a lot of the same topics as yours and I think we could greatly benefit from each other. If you happen to be interested feel free to shoot me an e-mail. I look forward to hearing from you! Superb blog by the way!
    web hosting services2020-07-18 07:45 回复 Linux | Chrome 59.0.3071.86
  23. Hi! Someone in my Myspace group shared this site with us so I came to give it a look. I'm definitely enjoying the information. I'm bookmarking and will be tweeting this to my followers! Outstanding blog and outstanding design.
    best website hosting2020-07-16 19:51 回复 Linux | Chrome 66.0.3359.181
  24. I know this web site gives quality dependent articles or reviews and additional stuff, is there any other web page which gives these data in quality?
    cbd oil that works 20202020-06-29 18:32 回复 Linux | Firefox浏览器 59.0
  25. I'm more than happy to find this web site. I need to to thank you for ones time for this particularly fantastic read!! I definitely enjoyed every bit of it and I have you book-marked to check out new information on your web site.
    cbd oil that works 20202020-06-28 05:24 回复 Windows 8.1 | Chrome 63.0.3239.132
  26. Its such as you read my thoughts! You appear to know a lot about this, such as you wrote the e-book in it or something. I feel that you can do with some % to pressure the message home a little bit, however other than that, that is wonderful blog. A fantastic read. I will certainly be back.
    cbd oil that works 20202020-06-27 22:34 回复 Linux | Chrome 66.0.3359.170
  27. I always spent my half an hour to read this website's articles or reviews all the time along with a mug of coffee.
    g rsacwgxy2020-06-22 11:09 回复 Linux | Chrome 66.0.3349.0