parent
5b281f2c34
commit
23d0679d13
@ -0,0 +1,24 @@
|
||||
|
||||
from distutils.util import strtobool
|
||||
from flask import Blueprint, request, make_response
|
||||
from flask_login import login_required
|
||||
import os
|
||||
import logging
|
||||
from changedetectionio.store import ChangeDetectionStore
|
||||
|
||||
|
||||
|
||||
def construct_blueprint(datastore: ChangeDetectionStore):
|
||||
|
||||
browser_steps_blueprint = Blueprint('browser_steps', __name__, template_folder="templates")
|
||||
|
||||
@login_required
|
||||
@browser_steps_blueprint.route("/extract-regex", methods=['POST'])
|
||||
def browsersteps_ui_update():
|
||||
import time
|
||||
|
||||
return {123123123: 'yup'}
|
||||
|
||||
return browser_steps_blueprint
|
||||
|
||||
|
@ -0,0 +1,40 @@
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#extract').click(function (e) {
|
||||
download_csv_file();
|
||||
});
|
||||
|
||||
//create CSV file data in an array
|
||||
var csvFileData = [
|
||||
['Alan Walker', 'Singer'],
|
||||
['Cristiano Ronaldo', 'Footballer'],
|
||||
['Saina Nehwal', 'Badminton Player'],
|
||||
['Arijit Singh', 'Singer'],
|
||||
['Terence Lewis', 'Dancer']
|
||||
];
|
||||
|
||||
//create a user-defined function to download CSV file
|
||||
function download_csv_file() {
|
||||
|
||||
//define the heading for each row of the data
|
||||
var csv = 'Name,Profession\n';
|
||||
|
||||
//merge the data with CSV
|
||||
csvFileData.forEach(function (row) {
|
||||
csv += row.join(',');
|
||||
csv += "\n";
|
||||
});
|
||||
|
||||
//display the created CSV data on the web browser
|
||||
document.write(csv);
|
||||
|
||||
|
||||
var hiddenElement = document.createElement('a');
|
||||
hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csv);
|
||||
hiddenElement.target = '_blank';
|
||||
//provide the name for the CSV file to be downloaded
|
||||
hiddenElement.download = 'Famous Personalities.csv';
|
||||
hiddenElement.click();
|
||||
}
|
||||
|
||||
});
|
Loading…
Reference in new issue