CodeIgniter Forums
Rss app - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Rss app (/thread-20264.html)



Rss app - El Forum - 07-03-2009

[eluser]garymardell[/eluser]
Hey, if i were to create an application that can parse rss feeds and display them, what is the best way to store that the item has been read.

I guess i will need a table to store the url of the feeds. But how would i go about marking certain feeds as read. Would i have to add the data from the feeds into the database?
Giving each item a unique id and then when viewing the feed try to get any new content and add that to the database.

I really don't know. If someone could suggest a way of making it work that would be appreciated.


Rss app - El Forum - 07-03-2009

[eluser]Evil Wizard[/eluser]
I would just store the url of the feed and a flag field to mark as read and possibly a date field too


Rss app - El Forum - 07-03-2009

[eluser]zimco[/eluser]
You might also want to consider looking at other open-source rss parsers and seeing how they did it. For instance here's a mysql db table from Tiny Tiny Rss that shows some of how they did it:

Code:
create table ttrss_user_entries (
int_id integer not null primary key auto_increment,
ref_id integer not null,
feed_id int not null,
owner_uid integer not null,
marked bool not null default 0,
published bool not null default 0,
last_read datetime,
score int not null default 0,
note text,
unread bool not null default 1,
index (ref_id),
foreign key (ref_id) references ttrss_entries(id) ON DELETE CASCADE,
index (feed_id),
foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE,
index (owner_uid),
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) TYPE=InnoDB;