This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Detecting news (rename, delete, and so on)

Old posts that have not been replied to for several years.
Locked
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Detecting news (rename, delete, and so on)

Post by GodOfSuicide »

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 ?
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

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.
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

this would just work for added / deleted news, but not for modified posts.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

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...
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

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
Locked