Be careful when hitting the ATND API.
http://d.hatena.ne.jp/fuyumi3/20120322/1332387731
As I wrote here, for example, if you want to specify multiple event ids, you can write parameters separated by commas, such as "event_id = 12345,12346,12456".
So, of course, when you actually stream this, urllib.urlencode is done, but this API specification is that, escape the comma If event_id = 12345% 2C12346% 2C12456, it will not be recognized correctly. You have to send it with a comma as it is. / (^ O ^) \ Nante Kottai
As a workaround, urllib has a property called always_safe, which contains strings to exclude from escaping.
python
import urllib
print urllib.always_safe
# => ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-
So if you add a comma to this guy
python
urllib.always_safe += ','
print urllib.always_safe
# => ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-,
Recommended Posts