I have a personal project for caching some rss channels locally on my NAS (using the built-in web server and working with the cron) so that I don’t miss “messages” when my desktop computer is turned off.
So far I have a simple php script setup that stores the cache for a single channel in a MySQL database. I will expand this to include several channels and skip them, but for now I just want to make sure that what I want to do is possible. Since SimplePie clears the cache when it expires, I thought about creating a copy of the cache_data and items tables for use as an archive — if I copy all the new entries to new tables, then it would not matter if SimplePie clear its own cache tables because I already have a copy of the elements.
Now I need to create the rss / xml output file, and I am wondering if SimplePie can be used for this. I see two possibilities:
- Get SimplePie to use the archive tables as the expiration cache location so that nothing is deleted.
- Read the data from the "arc" tables yourself and use SimplePie to process the data and build the rss channel.
I looked through the documentation of SimplePie and through SimplePie.inc to find out if I can find anything to point me in the right direction, but this is my first real php project, and SimplePie contains quite a lot of complex looking code. Any suggestions or pointers would be greatly appreciated :)
source
share