This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
token = "API_KEY" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch("http://127.0.0.1:5000/getSummary", { | |
"body": JSON.stringify({"url":"https://owasp.org/www-community/attacks/csrf"}), | |
"method": "POST", | |
"headers":{ | |
"Content-Type": "application/json" | |
} | |
}).then(response=> response.body). then(rb => { | |
const reader = rb.getReader(); | |
return new ReadableStream({ | |
start(controller) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from flask import Flask, request, jsonify, Response | |
import nlpcloud | |
from flask_cors import CORS, cross_origin | |
import trafilatura | |
from dotenv import load_dotenv | |
import os | |
app = Flask(__name__) | |
CORS(app, support_credentials=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flask | |
flask-cors | |
trafilatura | |
nlpcloud | |
python-dotenv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flask | |
flask-cors | |
nlpcloud | |
trafilatura |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta charset="utf-8"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gen_frames(): # generate frame by frame from camera | |
while True: | |
# Capture frame by frame | |
success, frame = camera.read() | |
if not success: | |
break | |
else: | |
gray_img= cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) | |
faces_detected = face_haar_cascade.detectMultiScale(gray_img, 1.32, 5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from apscheduler.schedulers.blocking import BlockingScheduler | |
from run import sendMail | |
sched = BlockingScheduler() | |
@sched.scheduled_job('interval', minutes=1) | |
def timed_job(): | |
print('This job is run every one minute.') | |
sendMail() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clock: python clock.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from apscheduler.schedulers.blocking import BlockingScheduler | |
from run import sendMail | |
sched = BlockingScheduler() | |
@sched.scheduled_job('cron', day_of_week='mon-fri', hour=8) | |
def scheduled_job(): | |
print('This job is run every weekday at 8 AM.') | |
sendMail() | |
sched.start() |
NewerOlder