I am having a lot of trouble with encoding character ‘/’ in order to use it in streaming twitter api with twython.
I have tried doing this in a couple of ways. First:
‘EUR/USD’.replace(’/’,’%2F’)
but the search is not returning anything.
I also tried:
urllib.quote(‘EUR/USD’, ‘’)
and while the output with print is the same (EUR%2FUSD) the search is still not returning any results.
Finally I tried double encoding:
urllib.quote(urllib.quote(‘EUR/USD’, ‘’),’’)
where I get EUR%252FUSD but still no results.
Furthermore, search does work properly on EURUSD, but only when it is preceded by the symbol $ in the tweet itself. In case the dollar sign is missing search also won’t detect the tweet.
Anyone has an idea of what might be going on here?