Exemplo n.º 1
0
def process():
    if 'whoa' not in request.args:
        return "lol"

    if request.args['whoa'] != SECRET:
        return "lol"

    if 'text' not in request.args or 'size' not in request.args:
        return "Missing text or font size"

    makeimage(request.args['text'], request.args['size'])
    os.system("screen -S tehpix -X stuff './viewimage.sh *.png\n'")

    return render_template("done.html")
Exemplo n.º 2
0
def main(keyword):

    # get keys
    # config = configparser.ConfigParser()
    # config.read('C:/Users/micha/Documents/Spring2019/EC500/Homework4/keys')
    # print(config.get('auth','consumer_key').split())

    consumer_key = '8cRGDF5RPNboNrR8JaswNySuC'
    consumer_secret = 'BSX2gAzfqtHDw1cyELlapdomr96qy7Y1pn3D06koT8ZOixcpsu'
    access_token = '1172138619680673794-fGznWzLf465gsVed1SwI6kPPIqHikj'
    access_secret = 'TXb8K6iZ67MHoC03z5SgwBnmeOv3tajqbZqqd3QrT8CXb'

    q = Queue()

    inputlist = keyword
    inputlist = inputlist.split(',')

    for words in inputlist:
        q.queueup(words)

    q.queuelist()
    print(q.queuelength())

    i = 0
    result = []
    filename = str(i) + "-%01d.png"
    videoname = keyword + ".avi"
    while q.queuelength() > 0:
        tweets = readtweets(q.items[0], consumer_key, consumer_secret)
        j = 0
        for tweet in tweets:
            print(tweet)
            makeimage(i, j, tweet)
            j = j + 1
            result.append(tweet)
        q.queuedown()
        q.queuelist()
        i = i + 1
        print("I am here")
        subprocess.call(
            ['ffmpeg', '-framerate', '.1', '-i', filename, videoname])

    return keyword
Exemplo n.º 3
0
#!/usr/bin/env python2
from makeimage import makeimage

stuff = [
    ("Network cables can be purchased at the canteen", 60),
    ("Stupid Questions May Incur A Fee", 90),
    (
        "Zero tolerance on illegal downloads "
        "See the Intranet for more information",
        80
    ),
    ("HAVE YOU TRIED TURNING IT OFF AND ON AGAIN?", 100),
    ("RFLAN 49", 150),
    ("TECH SUPPORT", 150),
    ("THIS IS NOT THE GAMES ADMIN DESK", 100),
]

for text, point in stuff:
    makeimage(text, point)

    print('Done {0} at {1}pt'.format(text, point))