TIL: Attach a PDF to a WordPress Post using Ruby

Apparently there is more than one way to encode binary data. When encoding data to be passed to an XMLRPC service, use the XMLRPC library vs. the Base64 library. I stumbled upon this solution reviewing Zach Feldman’s RubyPress project on GitHub.

ruby bits = XMLRPC::Base64.new(File.read('/path/to/joes/file.pdf'))

Latest Noise

All The Noise