Social data from online social networks is expanding rapidly as the number of users and articles posted increases, making public opinion analysis a greater challenge. Real-time topic detection is a key part of public opinion analysis. The complex data processing involved in traditional clustering and text categorization can lead to time delays in topic detection. In this paper we construct similar networks and detect topics from similar communities that reduces the processing overhead in obtaining real-time topics. The similar communities consist of users with high similarity between them. We collect public topics from the microposts of delegates selected from each similar community. Selecting delegates can reduce the processing time of large amounts of redundant data during topic detection. Obtaining public opinion keywords in real time allows organizations to respond to public opinion security incidents in real time. Experiments showed that our scheme can find public topics faster and more effectively than two traditional algorithms.