#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import (division, absolute_import, print_function,
                        unicode_literals)

import logging
import time
import tweepy
from config import create_api

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()


def check_mentions(api, keywords, since_id):
    logger.info("Retrieving mentions")
    new_since_id = since_id
    for tweet in tweepy.Cursor(api.mentions_timeline,
                               since_id=since_id).items():
        new_since_id = max(tweet.id, new_since_id)
        if tweet.in_reply_to_status_id is not None:
            continue
        if any(keyword in tweet.text.lower() for keyword in keywords):
            logger.info("Answering to %s", tweet.user.name)

            if not tweet.user.following:
                tweet.user.follow()

            api.update_status(
                status="Please reach us via DM",
                in_reply_to_status_id=tweet.id,
            )
    return new_since_id


def main():
    api = create_api()
    since_id = 1
    while True:
        print(since_id)
        since_id = check_mentions(api, ["help", "support"], since_id)
        logger.info("Waiting...")
        time.sleep(60)


if __name__ == '__main__':
    main()

21fa55dd8853682fbb70b6c4c0a2e1fae7bfea1f
<mask token>


def check_mentions(api, keywords, since_id):
    logger.info('Retrieving mentions')
    new_since_id = since_id
    for tweet in tweepy.Cursor(api.mentions_timeline, since_id=since_id).items(
        ):
        new_since_id = max(tweet.id, new_since_id)
        if tweet.in_reply_to_status_id is not None:
            continue
        if any(keyword in tweet.text.lower() for keyword in keywords):
            logger.info('Answering to %s', tweet.user.name)
            if not tweet.user.following:
                tweet.user.follow()
            api.update_status(status='Please reach us via DM',
                in_reply_to_status_id=tweet.id)
    return new_since_id


def main():
    api = create_api()
    since_id = 1
    while True:
        print(since_id)
        since_id = check_mentions(api, ['help', 'support'], since_id)
        logger.info('Waiting...')
        time.sleep(60)


<mask token>

<mask token>
logging.basicConfig(level=logging.INFO)
<mask token>


def check_mentions(api, keywords, since_id):
    logger.info('Retrieving mentions')
    new_since_id = since_id
    for tweet in tweepy.Cursor(api.mentions_timeline, since_id=since_id).items(
        ):
        new_since_id = max(tweet.id, new_since_id)
        if tweet.in_reply_to_status_id is not None:
            continue
        if any(keyword in tweet.text.lower() for keyword in keywords):
            logger.info('Answering to %s', tweet.user.name)
            if not tweet.user.following:
                tweet.user.follow()
            api.update_status(status='Please reach us via DM',
                in_reply_to_status_id=tweet.id)
    return new_since_id


def main():
    api = create_api()
    since_id = 1
    while True:
        print(since_id)
        since_id = check_mentions(api, ['help', 'support'], since_id)
        logger.info('Waiting...')
        time.sleep(60)


if __name__ == '__main__':
    main()

<mask token>
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()


def check_mentions(api, keywords, since_id):
    logger.info('Retrieving mentions')
    new_since_id = since_id
    for tweet in tweepy.Cursor(api.mentions_timeline, since_id=since_id).items(
        ):
        new_since_id = max(tweet.id, new_since_id)
        if tweet.in_reply_to_status_id is not None:
            continue
        if any(keyword in tweet.text.lower() for keyword in keywords):
            logger.info('Answering to %s', tweet.user.name)
            if not tweet.user.following:
                tweet.user.follow()
            api.update_status(status='Please reach us via DM',
                in_reply_to_status_id=tweet.id)
    return new_since_id


def main():
    api = create_api()
    since_id = 1
    while True:
        print(since_id)
        since_id = check_mentions(api, ['help', 'support'], since_id)
        logger.info('Waiting...')
        time.sleep(60)


if __name__ == '__main__':
    main()

from __future__ import division, absolute_import, print_function, unicode_literals
import logging
import time
import tweepy
from config import create_api
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()


def check_mentions(api, keywords, since_id):
    logger.info('Retrieving mentions')
    new_since_id = since_id
    for tweet in tweepy.Cursor(api.mentions_timeline, since_id=since_id).items(
        ):
        new_since_id = max(tweet.id, new_since_id)
        if tweet.in_reply_to_status_id is not None:
            continue
        if any(keyword in tweet.text.lower() for keyword in keywords):
            logger.info('Answering to %s', tweet.user.name)
            if not tweet.user.following:
                tweet.user.follow()
            api.update_status(status='Please reach us via DM',
                in_reply_to_status_id=tweet.id)
    return new_since_id


def main():
    api = create_api()
    since_id = 1
    while True:
        print(since_id)
        since_id = check_mentions(api, ['help', 'support'], since_id)
        logger.info('Waiting...')
        time.sleep(60)


if __name__ == '__main__':
    main()

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import (division, absolute_import, print_function,
                        unicode_literals)

import logging
import time
import tweepy
from config import create_api

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()


def check_mentions(api, keywords, since_id):
    logger.info("Retrieving mentions")
    new_since_id = since_id
    for tweet in tweepy.Cursor(api.mentions_timeline,
                               since_id=since_id).items():
        new_since_id = max(tweet.id, new_since_id)
        if tweet.in_reply_to_status_id is not None:
            continue
        if any(keyword in tweet.text.lower() for keyword in keywords):
            logger.info("Answering to %s", tweet.user.name)

            if not tweet.user.following:
                tweet.user.follow()

            api.update_status(
                status="Please reach us via DM",
                in_reply_to_status_id=tweet.id,
            )
    return new_since_id


def main():
    api = create_api()
    since_id = 1
    while True:
        print(since_id)
        since_id = check_mentions(api, ["help", "support"], since_id)
        logger.info("Waiting...")
        time.sleep(60)


if __name__ == '__main__':
    main()
