Factor out duplicated code in update_*_blog (and make more testable).

Signed-off-by: Daira Hopwood <daira@leastauthority.com>