 # Configuration:
 #   DWEET_THING
 #   DWEET_KEY
+#   DWEET_AUTOSAVE
 #
 # Author:
 #   MrSaints

                robot.brain.save()
            else if dweet.this is 'failed'
                return robot.logger.error dweet.because

            robot.brain.setAutoSave true
            status.connected = true
            status.lastSaved = dweet.with[0].created

            if dweet.with isnt 404
                content = decodeChildren dweet.with[0].content


DWEET_THING = process.env.DWEET_THING
DWEET_KEY = process.env.DWEET_KEY
DWEET_AUTOSAVE = process.env.DWEET_AUTOSAVE or 1800

toBase64 = (json) ->
    new Buffer(JSON.stringify(json)).toString 'base64'
