-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtracker.py
More file actions
44 lines (36 loc) · 918 Bytes
/
tracker.py
File metadata and controls
44 lines (36 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from threading import Thread
import re
import random
import time
import requests
import websockets
import json
import sqlite3
import threading
import os
import configparser
import sys
from datetime import datetime
import jsonpickle
from flask import Flask
# Create the first app, this just gives me hello world.
# I have no idea what I'm doing part 1:
app = Flask(__name__)
# Is this even needed?
threads = []
lock = threading.Lock()
threadlimiter = threading.BoundedSemaphore(10)
# Hello
@app.route('/')
def hello():
return 'Hello, World!'
# Get some stuff resembling WERK. That's right, go back to work I know you're not on break.
@app.route('/get-work')
async def get_work():
item = ('none',)
conn = sqlite3.connect('database.db')
db = conn.cursor()
db.execute('SELECT url FROM link_urls WHERE status="None" LIMIT 10')
result = db.fetchall()
conn.close()
return str(result)