<filename>getRumors.py<gh_stars>0
# coding: UTF-8
import connetctMySQL


def getRumors(start, end, limit):
    connection = connetctMySQL.connectMySQL()
    with connection.cursor() as cursor:
        sql = (
            "SELECT id, content FROM rumors WHERE created_at BETWEEN %s AND %s LIMIT %s")
        cursor.execute(sql, (start, end, limit))
        contents = cursor.fetchall()
        connection.close()
        return contents


def getClick(start, end, limit):
    connection = connetctMySQL.connectMySQL()
    with connection.cursor() as cursor:
        sql = (
            "SELECT id, line_user_id, reply_rumor FROM line_conversations WHERE reply_action = 'click-detail-link' AND timestamp BETWEEN %s AND %s LIMIT %s")
        cursor.execute(sql, (start, end, limit))
        contents = cursor.fetchall()
        connection.close()
        return contents
