Bespoke software, and a simple RSS aggregator

栏目: IT技术 · 发布时间: 4年前

内容简介:This week I built myself an RSSaggregator. There are a couple of websites that are written by friends, or are of high enough quality that I want to read everything published on them, not just the things that are popular enough make their way to me via Hack

This week I built myself an RSSaggregator. There are a couple of websites that are written by friends, or are of high enough quality that I want to read everything published on them, not just the things that are popular enough make their way to me via Hacker News or similar.

I had fun building it, and I think its design is interesting, so let’s take a look at how it works. I’ll also use it as an example to talk about the sort of bespoke software that I’ve really been enjoying writing recently.

How the RSS aggregator works

Bespoke software, and a simple RSS aggregator

This is what it looks like. It’s a webpage, hosted atnews.routley.io, which contains links to the last 30 days worth of posts from each of the blogs I subscribe to.

The website and the code which generates it are stored in a single GitHub repo , and it works by gluing together a couple of GitHub features.

Generating the web page

I wrote a simple Go script , which stores a list of RSS feeds I subscribe to. When the script is run, it:

docs/index.html

Serving the webpage

Github Pages is enabled for the repo. It serves the contents of the docs directory (which just contains the index.html file) on my custom domainnews.routley.io.

Updating the webpage

I created a GitHub Action which:

index.html

This action is triggered by a cron, and runs every hour. When the updated index.html is pushed to the repo, GitHub Pages automatically updates the website.

Bespoke software

Historically, I would have built this as a CLI tool, so other people could use it to generate their own RSS aggregators. This adds a number of things I’d need to think about. For example I’d need to:

  • Define a way to let people specify feeds to pull posts from. This would probably be a config file with a pre-defined syntax, which we’d need to read and parse.
  • Let the user specify the name of the file to output HTML to in case they don’t want to use GitHub Pages.
  • Let users specify their own CSS, rather than hard coding it into the HTML template.
  • Store the code which generates the RSS aggregator to be in a separate repo from the repo which stores and serves my RSS aggregator, so users can clone or fork it without getting things specific to my aggregator.
  • Update the script to read multiple feeds concurrently, so it remains fast for users who subscribe to large numbers of feeds.

None of these are particularly difficult to add, but each adds to the total complexity of the project. In my day job as a software engineer, I write a lot of code which is ‘used’ by other people - sometimes directly, but also indirectly when they read it, make changes to it and keep it running in production. Writing code that other people use requires extra work. Sometimes it’s nice to step back from it and write code that’s just for yourself.


以上所述就是小编给大家介绍的《Bespoke software, and a simple RSS aggregator》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

机器与人:埃森哲论新人工智能

机器与人:埃森哲论新人工智能

【美】保罗•多尔蒂 詹姆斯•威尔逊 / 赵亚男 / 中信出版社 / 2018-10-1 / 49.00元

自人工智能问世以来,人们普遍持有人机对立的观点,且无时无刻不在害怕自己的工作会被人工智能取代。作者认为,是时候抛开这些无谓的担忧了,因为人类社会正走向一个与机器共融共生的时代。 未来的新型工作模式是什么?未来有哪些工作不会被人工智能取代?人工智能时代重要的生存技能是什么?本书围绕这三大核心问题做了透彻的分析。作者带我们见识了置于业务流程背景之下的人工智能,阐述了其在不同职能部门中起到的推动作......一起来看看 《机器与人:埃森哲论新人工智能》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

MD5 加密
MD5 加密

MD5 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具