Track not matching '.onion' URLs

streaming
python
api

#1

Hi,

I’m currently writing a Python script to harvest Tor .onion URLs that people are tweeting. I’m using the streaming API with the track field set to .onion.

However in my testing this is only matching and sending me tweets if the text of the tweet contains .onion despite the documentation stating that track should check for matches in text, expanded_url and display_url.

I tested this by tweeting “zqktlwi4fecvo6ri.onion .onion” the second “.onion” which isn’t in the URL casues a match and the tweet is delivered to my script. When I parse out the display_url & expanded_url fields they contain the full .onion URL (zqktlwi4fecvo6ri.onion).

Am I being stupid or missing something here? As far as I understand the track feature should check for matches in the expanded_urls field.

EDIT: Code

Cheers
Michael