Predicting collective online behaviour