I've got a little problem here and I'd like some help.
My code is an infinite search on web pages for patterns that, whenever it finds something new, it writes it on a file.
However, sometimes, the info I'm scavenging is already in the file, but it's not updated and I don't want repeated entries on my file.
Therefore, I simply created a List of strings, adding each entry there and every time the code finds what it's looking for, it checks if the string is already on that list before writing to the file.
You can clearly see why this is a bad idea... Since it runs 24/7, this list will endlessly become bigger. But there is a catch. I'm 100% sure that the info I'm looking will never repeat if 15 minutes has passed.
So, what I really want is to eliminate items that are on this list for 15 minutes. I just can't think of something simple and/or elegant to do this. Or, I don't know if there is some data structure or library that can solve this for me.
That's why I'm asking here: what is the best solution to create some kind of "timed list", where items that are there for a while gets removed at the end of the iteration?
Thanks in advance.