I was checking my old newsticker code lately and i found some anoying stuff in there, maybe i miss the logic to do it better.
basically this is the way it works:
compare the new news to a backuped version of the news on the prev. check
if its different ->
* check how much further "down" the first newsline from the old one has moved in the new data -> everything above is now
* check if the 2nd old one = the 2nd new one -> first news have been modified
* reverse the first check -> news have been deleted
but somehow i'm not fully satisfied with this way, sometimes news are posted when they only were modified and moved in position.
can anyone provide me with some additional ways to compare news (or general data) for changes ?
store articles in a backup "list" structure, and lsearch the list for the articles found when you connect to the site again... This way the order of the articles shouldn't matter.... Create a temporary "new" list from the connecting data, and lsearch that list from the other list's elements to find out what articles have been deleted.... Again, order not making a difference.
Surely the articles have an identifying feature, such as a headline, or article number that you can store in the list as well, and search against headlines/article numbers...
yeah, i thought about comparing url's only, but that would cause some problems with pages thaat dont have seperate ID's/pages/whatever for each news entry