ericrasmussen / postmonkey Goto Github PK
View Code? Open in Web Editor NEWMailChimp API wrapper for Python
License: Other
MailChimp API wrapper for Python
License: Other
In [17]: p.listSubscribe(id=lists['data'][0]['id'], email_address='[email protected]')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/../eggs/Django-1.4-py2.7.egg/django/core/management/commands/shell.pyc in <module>()
----> 1 p.listSubscribe(id=lists['data'][0]['id'], email_address='[email protected]')
/../eggs/postmonkey-1.0a2-py2.7.egg/postmonkey/__init__.pyc in _make_method_call(self, methodname, **kwargs)
90 raise PostRequestError(e)
91
---> 92 decoded = self._deserialize_response(resp.text)
93 return decoded
94
/../eggs/postmonkey-1.0a2-py2.7.egg/postmonkey/__init__.pyc in _deserialize_response(self, text)
123 raise DeserializationError(text)
124
--> 125 self._fail_if_mailchimp_exc(deserialized)
126
127 return deserialized
/../eggs/postmonkey-1.0a2-py2.7.egg/postmonkey/__init__.pyc in _fail_if_mailchimp_exc(self, response)
133 error returned by MailChimp.
134 """
--> 135 if 'code' in response and 'error' in response:
136 raise MailChimpException(response['code'], response['error'])
137
TypeError: argument of type 'bool' is not iterable
When trying to subscribe email with '+' character, getting exception:
Traceback (most recent call last):
File "postmonkey/__init__.py", line 92, in _make_method_call
decoded = self._deserialize_response(resp.text)
File "postmonkey/__init__.py", line 125, in _deserialize_response
self._fail_if_mailchimp_exc(deserialized)
File "postmonkey/__init__.py", line 140, in _fail_if_mailchimp_exc
raise MailChimpException(response['code'], response['error'])
MailChimpException: MailChimp error code 502: "Invalid Email Address: test 01@te
st.com"
Please note, that '+' character is just replaced with space, which is obviously invalid.
The same thing happens when trying to get e.g. lists for email with '+' character.
How does one handle merge vars with this? Mailchimp API is kind of silly in that the merge vars has to be sent not as a dictionary, but as separate keywords, and one can't send the following as a keyword argument due to [ and ].
merge_vars[FNAME] = "FOOBAR"
instead of merge_vars = {"FNAME": "FOOBAR"}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.