def _post_activity(self, activity, unserialize=True):
<EOL>feed_url = "<STR_LIT>".format(<EOL>proto=self._pump.protocol,<EOL>server=self._pump.client.server,<EOL>username=self._pump.client.nickname<EOL>)<EOL>data = self._pump.request(feed_url, method="<STR_LIT:POST>", data=activity)<EOL>if not data:<EOL><INDENT>return False<EOL><DEDENT>if "<STR_LIT:error>" in data:<EOL><INDENT>raise PumpException(data["<STR_LIT:error>"])<EOL><DEDENT>if unserialize:<EOL><INDENT>if "<STR_LIT:target>" in data:<EOL><INDENT>self.unserialize(data["<STR_LIT:target>"])<EOL><DEDENT>else:<EOL><INDENT>if "<STR_LIT>" not in data["<STR_LIT:object>"]:<EOL><INDENT>data["<STR_LIT:object>"]["<STR_LIT>"] = data["<STR_LIT>"]<EOL><DEDENT>for key in ["<STR_LIT:to>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>if key not in data["<STR_LIT:object>"] and key in data:<EOL><INDENT>data["<STR_LIT:object>"][key] = data[key]<EOL><DEDENT><DEDENT>self.unserialize(data["<STR_LIT:object>"])<EOL><DEDENT><DEDENT>return True<EOL>
Posts a activity to feed