V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
erik0
V2EX  ›  Python

抓取网站转成 RSS 的问题

  •  
  •   erik0 · 2015-05-04 23:06:35 +08:00 · 3232 次点击
    这是一个创建于 3282 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    3 条回复    2015-05-05 17:51:26 +08:00
    whatisnew
        1
    whatisnew  
       2015-05-04 23:28:11 +08:00
    1. 做一个 ping server
    2. 你不可能把所有文章都抓取了
    3. 即时推送是另外一个话题。
    erik0
        2
    erik0  
    OP
       2015-05-05 13:21:05 +08:00
    @whatisnew 谢谢解答,还有些问题:
    1. ping server是什么?能给一些clue吗
    2. 我就是想只抓取最新的文章,那么生成的rss也只需包含最新项目吗?
    3. 那就暂时不考虑吧
    whatisnew
        3
    whatisnew  
       2015-05-05 17:51:26 +08:00   ❤️ 1
    @erik0 PING SERVER 是 rss 有更新时,通知你的 ping 你的服务器,但是一般人都不要 ping 你
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1085 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:37 · PVG 02:37 · LAX 11:37 · JFK 14:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.