I have incoming data, which I store in a variable
connection = ContextIO::Connection.new(key, secret)
messages = connection.all_messages(:account => account, :limit => 100, :since => (Time.now - 3000.day ))
foo = JSON.parse(messages)['data']
A JSON text must at least contain two octets!
messages. It is probably empty, unset or consists of a single digit (like
4), which is not valid JSON, but accepted by many JSON implementations.