Dynamics of public opinions in an online and offline social network