def upload_file():
    if request.method == 'POST':
        # check if the post request has the file part
        text = request.form['text']
        # print(text,type(text))

        # if user does not select file, browser also
        # submit an empty part without filename
        if text == '':
            flash('Please type in ONE twitter ID.')
            return redirect(request.url)

        tweepy_info(text)
        imgToVideo(text)
        return redirect(url_for('download', filename=text))
    return render_template('index.html')
Example #2
0
def worker(i):
    while True:
        item = q.get()

        qSize = q.qsize()
        if item is None:
            print("Thread %s has finished all the works. XD" % i)
            break

        print("Thread " + str(i) + " process on 1 task" + " from current " +
              str(qSize) + " tasks......")
        #do_work(item)
        # after get all images, then get videos
        setAllImg(item)
        imgToVideo(item)

        print("Thread %s has completed the TASK <%s>. @_@" % (i, item))

        q.task_done()
def worker():
    while True:
        item = q.get()

        numb = 0
        qSize = q.qsize()
        if item is None:
            print("No item now, please put in some stuff!")
            numb = 0
            break

        numb += 1
        print("Currently process on " + str(numb) + " from current " +
              str(qSize) + " items")
        #do_work(item)
        # after get all images, then get videos
        tweepy_info(item)
        imgToVideo(item)

        print("Current worker is finished.")

        q.task_done()
def test_mainFunction():
    hashtag = "Test"
    setAllImg(hashtag)
    imgToVideo(hashtag)
    assert os.path.exists('Test.avi') == True
Example #5
0
def main():
    hashtag = "Harden"
    setAllImg(hashtag)
    imgToVideo(hashtag)
def main():
    hashtag = sys.argv[1]
    setAllImg(hashtag)
    imgToVideo(hashtag)