g0v / twangry

政誌 - Angry event made in Taiwan.
http://fact.g0v.tw
Do What The F*ck You Want To Public License
51 stars 25 forks source link

Detect if json object have new update #113

Open jimyhuang opened 10 years ago

jimyhuang commented 10 years ago

We cache each word in json. We can have a simple function to detect if the event have further progress by iterate the object between old and new json.

Everytime when update json, we should copy exists json to old one. So we have 2 cache at the same time. one is event_name.json the other is event_name.json.old

In the update progress, trigger mail event to send mail for subscriber. May reference code here: https://github.com/g0v/twangry/blob/master/mod/wikipedia.js#L233