Need Consumer and Producer with duplicate filter python
<p>I have a script which send requests to social media site by doing following:</p>

<p>It first scrapes the friends of the account inserted.
It then continues to scrape all friends of the accounts found forever (Similar to how search engine crawlers work).
Add them to a consumer queue which then adds them as a friend or send them a message.
All this in 10-30 threads. 
I am currently using Queue and it is not checking if the accounts it finds were duplicate of previously found account. That is my problem. Before changing the source code of Queue module. Is there any similar module with duplicate filtering built in.</p>

<p>Python also includes a data type for sets. A set is an unordered collection with no duplicate elements. 
Note: to create an empty set you have to use </p>

<pre><code>set()
</code></pre>

<p>There is an ordered set recipe for this which is referred to from the Python 2 Documentation <a href="http://code.activestate.com/recipes/576694/" rel="nofollow">http://code.activestate.com/recipes/576694/</a></p>

<p>This runs on Py2.6 or later and 3.0 or later without any modifications. The interface is almost exactly the same as a normal set, except that initialisation should be done with a list.</p>

<pre><code>OrderedSet([1, 2, 3])
</code></pre>

python