开发者

Updating a rss-feed continuously

开发者 https://www.devze.com 2022-12-17 14:39 出处:网络
I\'m creating a bot in PHP that continuously updates an RSS-feed and开发者_运维技巧 gathers information.

I'm creating a bot in PHP that continuously updates an RSS-feed and开发者_运维技巧 gathers information. Every loop takes around 0.1 sec but sometimes it takes up to 9 sec to finish the cycle.

Why does this happen and is there a way around the problem? I need the bot to be as fast as possible as I'm trying to beat another bot that has the same purpose as mine.


I believe you're using the wrong tool for the job, if you need low latency push-updates you should go with XMPP, Comet or the like.

But if you have to go with RSS, is there any possibility that you keep the connection open instead of closing it?


Why not run a background task on your machine? Using crontabon linux for example. That task parses your RSS feeds and writes the data to either a database or stores the parsed data into some kind of file format such as XML or JSON.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号