There are several triggers you can use for sending timeline updates:
- Location updates
- User actions (share/custom/reply)
- Some "external" trigger coming from your service
But there is one use-case (that I think is rather useful) that isn't covered by those triggers: User triggers an action and you want to send them a series of timeline cards/updates on a certain schedule.
Anything timer related falls into this category ("This card will self-destroy in 10 seconds") and I can think of several examples where this can be useful.
"Egg-timers" with intermediate updates about the current time. For example you could do a Tooth-brush app that sends a quick notification every 30 seconds for 2-3 minutes (or whatever the recommend brushing time is currently) so you remember to switch brushing areas.
Flash cards/quizzes where you only have a certain time to think before the answer is displayed.
Some more ideas that were haunting my mind last night which I can't remember any more...
App Engine offers a very nice service which seems to be perfect for those use-cases, task queues: https://developers.google.com/appengine/docs/python/taskqueue/
The layout is really simple. You have your notification endpoint that is called from the Mirror API when the user triggers an action. In this endpoint you create a series of tasks to update/create/delete timeline items. In the sample code I only handle update/create but you can extend the tasks to match your specific needs.
And the TaskWorker endpoint is then called from the Task Queue with the data you provided and does the actual timeline manipulations.