Git Product home page Git Product logo

Comments (4)

zgq354 avatar zgq354 commented on July 28, 2024

RSS本身相当于阅读器帮你每隔一段时间检查一下订阅源,看有没有更新,然后把更新的内容存起来,weibo-rss 本身做的事情只是是对某人最近发的几条微博的数据和RSS的格式的一个转换,期间为了减小请求量还会做一定的缓存。

你的理解没问题,程序通过 express 的 router 处理接收到的请求来驱动读取数据的,定时更新主要还是通过阅读器定期发来的请求来实现。

靠程序主动去抓取的话这个并不太现实。实时获取的可能性不大,需要做到实时的话只能减小请求之间的间隔,然而请求频率不能太高,给他人的服务器造成并发的压力过大的话肯定是被ban的,对于我们这种小众的需求算是致命打击吧,所以要克制住~

from weibo-rss.

DerekTso avatar DerekTso commented on July 28, 2024

有点明白了。也就是说,weibo-rss或者其它类似的工具,它们做的只是将一个网页的请求数据抓取下来,整理成为RSS Feed (in xml format),RSS阅读器会自己trigger下一次的更新请求,然后生成新的feed。

另外,huggin/heroku好像可以设置每次抓取的时间间隔。

from weibo-rss.

zgq354 avatar zgq354 commented on July 28, 2024

对,RSS 实质上只是一个网站内容展现的一种开放格式啦,人类可读的内容的格式很灵活,但这种灵活对于机器来说需要判断的情况将变得非常复杂,所以就有了类似RSS的统一格式的标准,阅读器、IFTTT之类的工具,会定时去访问这个Feed,与之前拿到的数据相比较,才判断有没有更新,就像我们定期打开某个网站看看它有没有更新新内容一样,这个项目扮演的角色正是一个格式的转换。

关于抓取时间间隔的话,主要是转换器为了减少请求量,每次生成的XML会设置一个缓存,在缓存过期之前,就算阅读器发出的检查请求频率很高,也只是触发缓存,不会发出新的请求到信息源的服务器上,所以这里的时间间隔只是一个限度,如果本身阅读器抓取的频率很低,那程序发出请求的频率也基本上是和阅读器的设置是一致的。

from weibo-rss.

DerekTso avatar DerekTso commented on July 28, 2024

解惑了!再次感谢!

from weibo-rss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.