History as a giant data set: how analysing the past could help save the future