erik0
V2EX  ›  Python

抓取网站转成 RSS 的问题

By erik0 at 2015 年 5 月 4 日 · 4379 次点击

伪电工写了一个简单的程序将新闻类网站转成RSS,有一点问题:
1.目前是定时抓取,每次都会解析一遍首页和各文章网页,很多都是重复劳动。如何简单有效地判断某文章是否已经抓取过,从而避免重复抓取?
2.生成的RSS需要包含所有的文章吗,还是只要包括最新的几条就行?如果是后者,那么RSS阅读器是否可能漏掉一些老文章。
3.有什么更好的方法能实现即时推送到手机?除了RSS以外。
谢谢!

3 条回复  •  2015-05-05 17:51:26 +08:00
whatisnew
   1
whatisnew  
   2015 年 5 月 4 日
1. 做一个 ping server
2. 你不可能把所有文章都抓取了
3. 即时推送是另外一个话题。
erik0
   2
erik0  
OP
   2015 年 5 月 5 日
@whatisnew 谢谢解答,还有些问题:
1. ping server是什么?能给一些clue吗
2. 我就是想只抓取最新的文章,那么生成的rss也只需包含最新项目吗?
3. 那就暂时不考虑吧
whatisnew
   3
whatisnew  
   2015 年 5 月 5 日   ❤️ 1
@erik0 PING SERVER 是 rss 有更新时,通知你的 ping 你的服务器,但是一般人都不要 ping 你
推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
© 2026 V2EX · 24ms · 3.9.8.5