bambang
bambang

Reputation: 27

Twitter Search Tweets API - Different Users But Returns Same Tweets

I'm trying to create images streams from social media hashtag. When i try to using Twitter, there's a problem when getting tweets images. I already succeed displaying the images but there's a lot of duplicate tweets! The reason is there's a few users who tweet same tweet, and i think they all are bot because when i stalk their profile they all got same tweets.

Here is the example : http://t.co/NMX3B68eBT http://t.co/xDeBSS7GRr http://t.co/VmmNezY8Qg

Here is the query :

$response = $twitter->get('search/tweets.json?q=%23holifestival -filter:retweets filter:media&count=20');

How do i fix the duplicate tweets like this? is it possible? if it's isn't, is there any workaround? please help me.

thanks

Upvotes: 1

Views: 598

Answers (1)

Terence Eden
Terence Eden

Reputation: 14304

You really only have two options.

  1. Compare the text (ignore the URL) and see if it matches a previous tweet. If it does; discard it.
  2. Compare the images. After downloading the image, compare it to other images you've downloaded (either filesize or MD5 hash). If it matches, discard it.

One of Twitter's problems is that multiple spam accounts can be used to repeatedly broadcast identical content. Other than examining the content, there's no way in the API to filter it.

Upvotes: 1

Related Questions