A simple generative model of collective online behavior