That's odd...it works for me. What kind of errors does it give you? Does the script die, or does it just not fetch the jokes?
Actually, you don't need to escape the @ if the address is in single quotes. Oh...you mean in the here-docs? Yeah, that needs to be escaped.