@classmethod
def run(self):
    'default method'
    sess = Session()
    sender = self.req_obj.get('sender', '')
    if sender:
        email = sender.split('/')[0]
    profile = sess.query(Profile).filter((Profile.email == email)).one()
    cron = CronTab(getuser())
    DAYS = {'sunday': 'SUN', 'monday': 'MON', 'tuesday': 'TUE', 'wednesday': 'WED', 'thursday': 'THU', 'friday': 'FRI', 'saturday': 'SAT'}
    req = self.request.replace('remind me every', '', 1)
    m = re.search('\\s+?(by|with|to|of)\\s+message\\s+?(.+)', req)
    if (m and m.group(2)):
        msg = m.group(2)
    else:
        m = re.search('\\s+?(by|with|to|of)\\s+?(.+)', req)
        if (m and m.group(2)):
            msg = m.group(2)
        else:
            msg = 'This a reminder. Unfortunatelly I could not parse your message,                         but I guess you can remember what you wanted to do.'
    job = cron.new(command=('/usr/bin/python %s/core/cron/cronjob.py --uuid=%s                         --cmd="send jabber message" --arguments="%s"' % (ROBOT_DIR, profile.uuid, msg.replace('"', ''))))
    skip_other = False
    if req.strip().startswith('month'):
        job.minute.on(0)
        job.hour.on(0)
        job.dom.on(1)
        skip_other = True
    if req.strip().startswith('week'):
        job.minute.on(0)
        job.hour.on(0)
        job.dow.on(0)
        skip_other = True
    if req.strip().startswith('year'):
        job.dom.on(0)
        job.month.on(0)
        skip_other = True
    dow = False
    for (dw, cron_day) in DAYS.items():
        if req.strip().lower().startswith(dw):
            dow = True
            break
    if dow:
        job.dow.on(cron_day.upper())
        r = re.split(('^' + dw), req.strip(), flags=re.IGNORECASE)
        if (r and (len(r) == 2)):
            req = r.pop()
        if req.strip().startswith('at '):
            time = re.search("[^0-9](\\d{1,2})\\so'clock", req)
            if (time and time.group(1)):
                job.minute.on(0)
                job.hour.on(time.group(1))
                skip_other = True
            if (not skip_other):
                time = re.search('[^0-9](\\d{1,2}):(\\d{2})[^0-9]', req)
                if (time and time.group(1) and time.group(2)):
                    job.minute.on(time.group(2))
                    job.hour.on(time.group(1))
                    skip_other = True
            if ((not skip_other) and req.strip().startswith('hourly')):
                job.minute.on(0)
                skip_other = True
        elif (not skip_other):
            time = re.search('\\s?from\\s(\\d{1,2}):(\\d{2})\\sto\\s(\\d{1,2}):(\\d{2})[^0-9]+', req)
            if (time and time.group(1)):
                job.hour.during(time.group(1), time.group(3))
                job.minute.during(time.group(2), time.group(4)).every(5)
                skip_other = True
        elif (not skip_other):
            job.minute.on(0)
            job.hour.on(10)
            skip_other = True
    if ((not skip_other) and req.strip().startswith('day')):
        req = req.replace('day', '', 1)
        if req.strip().startswith('at '):
            time = re.search("[^0-9](\\d{1,2})\\so'clock", req)
            if (time and time.group(1)):
                job.minute.on(0)
                job.hour.on(time.group(1))
                skip_other = True
            if (not skip_other):
                time = re.search('[^0-9](\\d{1,2}):(\\d{2})[^0-9]', req)
                if (time and time.group(1) and time.group(2)):
                    job.minute.on(time.group(2))
                    job.hour.on(time.group(1))
                    skip_other = True
            if ((not skip_other) and req.strip().startswith('hourly')):
                job.minute.on(0)
                skip_other = True
        if ((not skip_other) and req.strip().startswith('every')):
            req = req.replace('every', '', 1)
            hour = re.search('\\s?(\\d+)\\s+(hour|hours|hs|h)', req)
            if (hour and hour.group(1)):
                job.hour.every(hour.group(1))
                skip_other = True
            else:
                hour = re.search('^\\s?([a-zA-Z]+?)\\s(hours|hour)', req)
                if (hour and hour.group(1)):
                    h = text2int(hour.group(1))
                    job.hour.every(h)
                    job.minute.on(0)
                    skip_other = True
        elif ((not skip_other) and req.strip().startswith('from')):
            time = re.search('^from\\s(\\d{1,2}):(\\d{2})\\sto\\s(\\d{1,2}):(\\d{2})[^0-9]+', req.strip())
            if (time and time.group(1)):
                job.hour.during(time.group(1), time.group(3))
                job.minute.during(time.group(2), time.group(4)).every(5)
                skip_other = True
        elif (not skip_other):
            job.minute.on(0)
            job.hour.on(10)
            skip_other = True
            print(job)
        else:
            pass
    if ((not skip_other) and req.strip().startswith('with message')):
        job.minute.on(0)
        job.hour.on(10)
        skip_other = True
    if ((not skip_other) and req.strip().startswith('hour')):
        job.minute.on(0)
        skip_other = True
    if ((not skip_other) and req.strip().startswith('minute')):
        job.minute.every(1)
        skip_other = True
    if (not skip_other):
        hour = re.search('^(\\d+)\\s+(hour|hours|hs|h)', req.strip())
        if (hour and hour.group(1)):
            job.hour.every(hour.group(1))
            skip_other = True
        else:
            hour = re.search('^([a-zA-Z]+?)\\s(hours|hour)', req.strip())
            if (hour and hour.group(1)):
                h = text2int(hour.group(1))
                job.hour.every(h)
                job.minute.on(0)
                skip_other = True
    if (not skip_other):
        day = re.search('^(\\d+)\\s+(days|day|d)', req.strip())
        if (day and day.group(1)):
            req = req.replace(day.group(0), '', 1)
            if req.strip().startswith('at '):
                req = req.replace('at', '', 1)
                time = re.search("^(\\d{1,2})\\so'clock", req.strip())
                if (time and time.group(1)):
                    job.dow.every(day.group(1))
                    job.minute.on(0)
                    job.hour.on(time.group(1))
                    skip_other = True
                if ((not skip_other) and req.strip().startswith('hourly')):
                    job.minute.on(0)
                    job.dow.every(day.group(1))
                    skip_other = True
                if (not skip_other):
                    time = re.search('^(\\d{1,2}):(\\d{2})[^0-9]', req.strip())
                    if (time and time.group(1) and time.group(2)):
                        job.dom.every(day.group(1))
                        job.minute.on(time.group(2))
                        job.hour.on(time.group(1))
                        skip_other = True
            if ((not skip_other) and req.strip().startswith('from')):
                req = req.replace('from', '', 1)
                time = re.search('^(\\d{1,2}):(\\d{2})\\sto\\s(\\d{1,2}):(\\d{2})[^0-9]+?', req.strip())
                if (time and time.group(1)):
                    job.hour.during(time.group(1), time.group(3))
                    job.dom.every(day.group(1))
                    job.minute.during(time.group(2), time.group(4)).every(5)
                    skip_other = True
        elif (not skip_other):
            day = re.search('^\\s?([a-zA-Z]+?)\\s(days|day)', req)
            if (day and day.group(1)):
                d = text2int(day.group(1))
                req = req.replace(day.group(0), '', 1)
                if ((not skip_other) and req.strip().startswith('from')):
                    time = re.search('^from\\s(\\d{1,2}):(\\d{2})\\sto\\s(\\d{1,2}):(\\d{2})[^0-9]+?', req.strip())
                    if (time and time.group(1)):
                        job.hour.during(time.group(1), time.group(3))
                        job.dom.every(d)
                        req = req.replace(day.group(0), '', 1)
                        req = req.replace(time.group(0), '', 1)
                        if req.strip().startswith('every'):
                            mins = re.search('^every\\s(\\d{1,2})[^0-9]+?(min|minute|minutes)', req.strip())
                            if (mins and mins.group(0)):
                                job.minute.during(time.group(2), time.group(4)).every(mins.group(1))
                                skip_other = True
                            else:
                                mins = re.search('^every\\s([^0-9\\s]+)\\s?(min|minute|minutes)', req.strip())
                                if (mins and mins.group(1)):
                                    m = text2int(mins.group(1))
                                    job.minute.during(time.group(2), time.group(4)).every(m)
                                    skip_other = True
                                else:
                                    raise
                        else:
                            job.minute.during(time.group(2), time.group(4)).every(5)
                            skip_other = True
                else:
                    job.dom.every(d)
                    job.minute.on(0)
                    job.hour.on(10)
                    skip_other = True
        else:
            print(req)
            raise
    if (not skip_other):
        min = re.search('\\s?(\\d+)\\s+(minutes|min|minute|m)', req)
        if (min and min.group(1)):
            job.minute.every(min.group(1))
        else:
            min = re.search('^\\s?([a-zA-Z]+?)\\s(minutes|min|mins)', req)
            if (min and min.group(1)):
                m = text2int(min.group(1))
                job.minute.every(m)
    cron.write()
    logger.info(('adding cronjob %s' % cron.render()))
    response = ('ok, cronjob added %s' % job.render())
    if (self.req_from == 'jabber'):
        todo = {'text': response, 'jmsg': response, 'type': 'response'}
        self.response = todo
    if (self.req_from == 'julius'):
        from core.broadcast import say, bang
        bang()
        todo = {'say': response, 'text': response, 'type': 'response'}
        self.response = say(self.request.replace('say', '').upper())
    return self.response
default method
@classmethod
def run(self):
    
    sess = Session()
    sender = self.req_obj.get('sender', )
    if sender:
        email = sender.split('/')[0]
    profile = sess.query(Profile).filter((Profile.email == email)).one()
    cron = CronTab(getuser())
    DAYS = {'sunday': 'SUN', 'monday': 'MON', 'tuesday': 'TUE', 'wednesday': 'WED', 'thursday': 'THU', 'friday': 'FRI', 'saturday': 'SAT'}
    req = self.request.replace('remind me every', , 1)
    m = re.search('\\s+?(by|with|to|of)\\s+message\\s+?(.+)', req)
    if (m and m.group(2)):
        msg = m.group(2)
    else:
        m = re.search('\\s+?(by|with|to|of)\\s+?(.+)', req)
        if (m and m.group(2)):
            msg = m.group(2)
        else:
            msg = 'This a reminder. Unfortunatelly I could not parse your message,                         but I guess you can remember what you wanted to do.'
    job = cron.new(command=('/usr/bin/python %s/core/cron/cronjob.py --uuid=%s                         --cmd="send jabber message" --arguments="%s"' % (ROBOT_DIR, profile.uuid, msg.replace('"', ))))
    skip_other = False
    if req.strip().startswith('month'):
        job.minute.on(0)
        job.hour.on(0)
        job.dom.on(1)
        skip_other = True
    if req.strip().startswith('week'):
        job.minute.on(0)
        job.hour.on(0)
        job.dow.on(0)
        skip_other = True
    if req.strip().startswith('year'):
        job.dom.on(0)
        job.month.on(0)
        skip_other = True
    dow = False
    for (dw, cron_day) in DAYS.items():
        if req.strip().lower().startswith(dw):
            dow = True
            break
    if dow:
        job.dow.on(cron_day.upper())
        r = re.split(('^' + dw), req.strip(), flags=re.IGNORECASE)
        if (r and (len(r) == 2)):
            req = r.pop()
        if req.strip().startswith('at '):
            time = re.search("[^0-9](\\d{1,2})\\so'clock", req)
            if (time and time.group(1)):
                job.minute.on(0)
                job.hour.on(time.group(1))
                skip_other = True
            if (not skip_other):
                time = re.search('[^0-9](\\d{1,2}):(\\d{2})[^0-9]', req)
                if (time and time.group(1) and time.group(2)):
                    job.minute.on(time.group(2))
                    job.hour.on(time.group(1))
                    skip_other = True
            if ((not skip_other) and req.strip().startswith('hourly')):
                job.minute.on(0)
                skip_other = True
        elif (not skip_other):
            time = re.search('\\s?from\\s(\\d{1,2}):(\\d{2})\\sto\\s(\\d{1,2}):(\\d{2})[^0-9]+', req)
            if (time and time.group(1)):
                job.hour.during(time.group(1), time.group(3))
                job.minute.during(time.group(2), time.group(4)).every(5)
                skip_other = True
        elif (not skip_other):
            job.minute.on(0)
            job.hour.on(10)
            skip_other = True
    if ((not skip_other) and req.strip().startswith('day')):
        req = req.replace('day', , 1)
        if req.strip().startswith('at '):
            time = re.search("[^0-9](\\d{1,2})\\so'clock", req)
            if (time and time.group(1)):
                job.minute.on(0)
                job.hour.on(time.group(1))
                skip_other = True
            if (not skip_other):
                time = re.search('[^0-9](\\d{1,2}):(\\d{2})[^0-9]', req)
                if (time and time.group(1) and time.group(2)):
                    job.minute.on(time.group(2))
                    job.hour.on(time.group(1))
                    skip_other = True
            if ((not skip_other) and req.strip().startswith('hourly')):
                job.minute.on(0)
                skip_other = True
        if ((not skip_other) and req.strip().startswith('every')):
            req = req.replace('every', , 1)
            hour = re.search('\\s?(\\d+)\\s+(hour|hours|hs|h)', req)
            if (hour and hour.group(1)):
                job.hour.every(hour.group(1))
                skip_other = True
            else:
                hour = re.search('^\\s?([a-zA-Z]+?)\\s(hours|hour)', req)
                if (hour and hour.group(1)):
                    h = text2int(hour.group(1))
                    job.hour.every(h)
                    job.minute.on(0)
                    skip_other = True
        elif ((not skip_other) and req.strip().startswith('from')):
            time = re.search('^from\\s(\\d{1,2}):(\\d{2})\\sto\\s(\\d{1,2}):(\\d{2})[^0-9]+', req.strip())
            if (time and time.group(1)):
                job.hour.during(time.group(1), time.group(3))
                job.minute.during(time.group(2), time.group(4)).every(5)
                skip_other = True
        elif (not skip_other):
            job.minute.on(0)
            job.hour.on(10)
            skip_other = True
            print(job)
        else:
            pass
    if ((not skip_other) and req.strip().startswith('with message')):
        job.minute.on(0)
        job.hour.on(10)
        skip_other = True
    if ((not skip_other) and req.strip().startswith('hour')):
        job.minute.on(0)
        skip_other = True
    if ((not skip_other) and req.strip().startswith('minute')):
        job.minute.every(1)
        skip_other = True
    if (not skip_other):
        hour = re.search('^(\\d+)\\s+(hour|hours|hs|h)', req.strip())
        if (hour and hour.group(1)):
            job.hour.every(hour.group(1))
            skip_other = True
        else:
            hour = re.search('^([a-zA-Z]+?)\\s(hours|hour)', req.strip())
            if (hour and hour.group(1)):
                h = text2int(hour.group(1))
                job.hour.every(h)
                job.minute.on(0)
                skip_other = True
    if (not skip_other):
        day = re.search('^(\\d+)\\s+(days|day|d)', req.strip())
        if (day and day.group(1)):
            req = req.replace(day.group(0), , 1)
            if req.strip().startswith('at '):
                req = req.replace('at', , 1)
                time = re.search("^(\\d{1,2})\\so'clock", req.strip())
                if (time and time.group(1)):
                    job.dow.every(day.group(1))
                    job.minute.on(0)
                    job.hour.on(time.group(1))
                    skip_other = True
                if ((not skip_other) and req.strip().startswith('hourly')):
                    job.minute.on(0)
                    job.dow.every(day.group(1))
                    skip_other = True
                if (not skip_other):
                    time = re.search('^(\\d{1,2}):(\\d{2})[^0-9]', req.strip())
                    if (time and time.group(1) and time.group(2)):
                        job.dom.every(day.group(1))
                        job.minute.on(time.group(2))
                        job.hour.on(time.group(1))
                        skip_other = True
            if ((not skip_other) and req.strip().startswith('from')):
                req = req.replace('from', , 1)
                time = re.search('^(\\d{1,2}):(\\d{2})\\sto\\s(\\d{1,2}):(\\d{2})[^0-9]+?', req.strip())
                if (time and time.group(1)):
                    job.hour.during(time.group(1), time.group(3))
                    job.dom.every(day.group(1))
                    job.minute.during(time.group(2), time.group(4)).every(5)
                    skip_other = True
        elif (not skip_other):
            day = re.search('^\\s?([a-zA-Z]+?)\\s(days|day)', req)
            if (day and day.group(1)):
                d = text2int(day.group(1))
                req = req.replace(day.group(0), , 1)
                if ((not skip_other) and req.strip().startswith('from')):
                    time = re.search('^from\\s(\\d{1,2}):(\\d{2})\\sto\\s(\\d{1,2}):(\\d{2})[^0-9]+?', req.strip())
                    if (time and time.group(1)):
                        job.hour.during(time.group(1), time.group(3))
                        job.dom.every(d)
                        req = req.replace(day.group(0), , 1)
                        req = req.replace(time.group(0), , 1)
                        if req.strip().startswith('every'):
                            mins = re.search('^every\\s(\\d{1,2})[^0-9]+?(min|minute|minutes)', req.strip())
                            if (mins and mins.group(0)):
                                job.minute.during(time.group(2), time.group(4)).every(mins.group(1))
                                skip_other = True
                            else:
                                mins = re.search('^every\\s([^0-9\\s]+)\\s?(min|minute|minutes)', req.strip())
                                if (mins and mins.group(1)):
                                    m = text2int(mins.group(1))
                                    job.minute.during(time.group(2), time.group(4)).every(m)
                                    skip_other = True
                                else:
                                    raise
                        else:
                            job.minute.during(time.group(2), time.group(4)).every(5)
                            skip_other = True
                else:
                    job.dom.every(d)
                    job.minute.on(0)
                    job.hour.on(10)
                    skip_other = True
        else:
            print(req)
            raise
    if (not skip_other):
        min = re.search('\\s?(\\d+)\\s+(minutes|min|minute|m)', req)
        if (min and min.group(1)):
            job.minute.every(min.group(1))
        else:
            min = re.search('^\\s?([a-zA-Z]+?)\\s(minutes|min|mins)', req)
            if (min and min.group(1)):
                m = text2int(min.group(1))
                job.minute.every(m)
    cron.write()
    logger.info(('adding cronjob %s' % cron.render()))
    response = ('ok, cronjob added %s' % job.render())
    if (self.req_from == 'jabber'):
        todo = {'text': response, 'jmsg': response, 'type': 'response'}
        self.response = todo
    if (self.req_from == 'julius'):
        from core.broadcast import say, bang
        bang()
        todo = {'say': response, 'text': response, 'type': 'response'}
        self.response = say(self.request.replace('say', ).upper())
    return self.response