|
|
|
|
|
|
|
|
|
|
|
|
|
from flask import Flask, session, redirect, url_for, request, render_template, jsonify, make_response, json, jsonify
from markupsafe import escape
import pymongo
from pymongo import MongoClient
import sys
from datetime import datetime
import requests
import json
import time
from flask_wtf.csrf import CSRFProtect
app = Flask(__name__)
app.secret_key = b'_5#y2Lklit"]'
csrf = CSRFProtect(app)
output_terms = {}
app.secret_key = b'_5#y2L"F4Q8]/'
@app.after_request
def add_headers(response):
response.headers.add('Access-Control-Allow-Origin', '*')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
return response
@app.route('/aplusb', methods=['GET', 'POST'])
def aplusb():
route = "/aplusb"
control = 1
number_of_terms = 5
return render_template('slug.html',term_number=number_of_terms, title='arXiv + DOAJ', route="aplusb", output="aplusb_output", control=control)
@app.route('/aplusb_output', methods=['POST'])
def aplusb_output():
return render_template('aplusb_output.html')
@app.route('/')
def hello():
return render_template('index.html')
@app.route('/signUpUser2', methods=['POST'])
def signUpUse2():
user = request.form['username'];
weight = request.form['password'];
source = request.form['source']
time.sleep(1)
result = user.find('(')
page_counter = user[result+1:]
resultb = page_counter.find(')')
page_counter = page_counter[0:resultb]
user = user[0:result]
user = user.replace(" ", "+")
url = "https://doaj.org/api/v2/search/articles/'" + user + "'?page=" + page_counter + "&pageSize=100&sort=created_date%3Adesc"
response = requests.get(url)
text_output = ""
if response.text != "none":
text_output = "score:" + weight + ":" + response.text
return json.dumps({'status':'OK','user':user, 'weight': weight,'text':response.text, 'source':source});
@app.route('/signUpUser4', methods=['POST'])
def signUpUse4():
user = request.form['username'];
weight = request.form['password'];
source = request.form['source']
user = user.replace(" ", "+")
url = "http://export.arxiv.org/api/query?search_query=ti:%22" + user + "%22&sortBy=lastUpdatedDate&sortOrder=descending&start=0&max_results=500"
response = requests.get(url)
text_output = ""
if response.text != "none":
text_output = "score:" + weight + ":" + response.text
return json.dumps({'status':'OK','user':user, 'weight': weight,'text':response.text, 'source':source});
| |
|
|
|
|
|
|
|
|
|
|
from flask import Flask, session, redirect, url_for, request, render_template, jsonify, make_response, json, jsonify
from markupsafe import escape
import pymongo
from pymongo import MongoClient
import sys
from datetime import datetime
import requests
import json
import time
from flask_wtf.csrf import CSRFProtect\n'
|
|
|
|
|
|
|
app = Flask(__name__)
csrf = CSRFProtect(app)
app.secret_key = 'b_5#y'
|
|
|
|
|
|
|
@app.after_request
def add_headers(response):
response.headers.add('Access-Control-Allow-Origin', '*')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
return response
|
|
|
|
|
@app.route('/aplusb', methods=['GET', 'POST'])
def aplusb():
return render_template('slug.html',term_number=5, title='arXiv + DOAJ', route='aplusb', output='aplusb_output')\n"
|
|
|
|
|
app.route('/aplusb_output', methods=['POST'])
aplusb_output():
render_template('aplusb_output.html')
|
|
|
|
|
app.route('/')
def hello():
return render_template('index.html')
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/signUpUser2', methods=['POST'])
def signUpUse2():
user = request.form['username'];
weight = request.form['password'];
source = request.form['source']
time.sleep(1)
result = user.find('(')
page_counter = user[result+1:]
resultb = page_counter.find(')')
page_counter = page_counter[0:resultb]
user = user[0:result]
user = user.replace(" ", "+")
url = "https://doaj.org/api/v2/search/articles/" + user + "?page=" + page_counter + "&pageSize=100&sort=created_date%3Adesc"
response = requests.get(url)
text_output = ""
if response.text != "none":
text_output = "score:" + weight + ":" + response.text
return json.dumps({'status':'OK','user':user, 'weight': weight,'text':response.text, 'source':source});
|
|
|
|
|
|
|
@app.route('/signUpUser4', methods=['POST'])
def signUpUse4():
user = request.form['username'];
weight = request.form['password'];
source = request.form['source']
user = user.replace(" ", "+")
url = "http://export.arxiv.org/api/query?search_query=ti:%22" + user + "%22&sortBy=lastUpdatedDate&sortOrder=descending&start=0&max_results=500"
response = requests.get(url)
text_output = ""
if response.text != "none":
text_output = "score:" + weight + ":" + response.text
return json.dumps({'status':'OK','user':user, 'weight': weight,'text':response.text, 'source':source});
|
|
|
|
|
|
<!doctype html>
<head>
<title>aCURE</title>
</head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
<style type="text/css" media="all">
body {
font-size: 1em;
background-color: #00000;
color:#FF2020;
font-family:Georgia, serif;
}
p {
color: red;
text-align: center;
}
.center {
margin: auto;
}
#b {
width:100%;
height:56px;
position:relative;
top:0px;
left:0px;
background-color:#a63708;
font-family:Georgia, serif;
display: flex;
align-items: center;
justify-content: center;
}
#button5 {
border:0px solid black;
display:flex;
align-items:left;
position:absolute;
left:50px;
top: 85%;
}
#footer {
position:absolute;
bottom:0;
height:40px; /* Height of the footer */
background:#ffffff;
color:#000000;
font-size: 1em;
alignment-adjust:central;
left:150px;
right:150px;
}
#footer {
clear:both;
padding: 1em;
border-top: 1px solid #133;
text-align: center;
}
</style>
<!--- creates caching --->
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta http-equiv="expires" content="0">
<html>
<body>
<div id="button5">
<button type="button" onclick=location.href="{{ url_for('aplusb')}}" class="btn btn-dark btn-sm">arXiv + DOAJ</button<
</div>
</body>
</html>
|
|
|
<!doctype html>
<head>
<title>aCURE</title>
<meta http-equiv="refresh" content="3500;url='/'" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
<style type="text/css" media="all">
body {
background-color: #F3F3F3;
color: #000000;
font-family:Georgia, serif;
}
#a {
position: absolute;
top: 0;
right: 0;
height: 80px;
width: 100%;
background-color: white;
}
#aa {
position: absolute;
top: 42px;
left: 10px;
font-family:"Arial";
background-color: white;
}
#ab {
position: absolute;
top: 50px;
left: 141px;
}
#ac {
position: absolute;
top: 42px;
right: 50px;
}
#ad {
position: relative;
top: 42px;
}
#b {
width:100%;
height:56px;
position:relative;
top:82px;
left:0;
background-color:#a63708;
font-family:Georgia, serif;
display: flex;
align-items: center;
justify-content: center;
}
#c {
width: 100%;
height: 400px;
position: absolute;
top:138px;
left:0px;
font-family:"Arial";
background-color: #F3F3F3;
}
.t1-legend{font:bold 14px Helvetica Neue,Helvetica,sans-serif;font-size:20px;color:#000000}
.t2-legend{font:14px Helvetica Neue,Helvetica,sans-serif;font-size:20px;color:#000000}
input[type=range] {
/*removes default webkit styles*/
-webkit-appearance: none;
/*fix for FF unable to apply focus style bug */
border: 1px solid white;
/*required for proper track sizing in FF*/
width: 200px;
}
input[type=range]::-webkit-slider-runnable-track {
width: 200px;
height: 5px;
background: #ddd;
border: none;
border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #000000;
margin-top: -4px;
}
input[type=range]:focus {
outline: none;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #ccc;
}
input[type=range]::-moz-range-track {
width: 200px;
height: 5px;
background: #ddd;
border: none;
border-radius: 3px;
}
input[type=range]::-moz-range-thumb {
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #000000;
}
/*hide the outline behind the border*/
input[type=range]:-moz-focusring{
outline: 1px solid white;
outline-offset: -1px;
}
input[type=range]::-ms-track {
width: 200px;
height: 5px;
/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
background: transparent;
/*leave room for the larger thumb to overflow with a transparent border */
border-color: transparent;
border-width: 6px 0;
/*remove default tick marks*/
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #777;
border-radius: 10px;
}
input[type=range]::-ms-fill-upper {
background: #ddd;
border-radius: 10px;
}
input[type=range]::-ms-thumb {
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #000000;
}
input[type=range]:focus::-ms-fill-lower {
background: #888;
}
input[type=range]:focus::-ms-fill-upper {
background: #ccc;
}
hr {
width:80%;height:1px;border-width:0;color:gray;background-color:gray;
}
</style>
<!--- creates caching -->
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta http-equiv="expires" content="0">
<script type="text/javascript" >
var number_of_terms
function loc_srange_value(value, Id) {
Id = "loc_weight"+Id;
document.getElementById(Id).innerHTML = value;
}
function resumes_qualifyb() {
if((document.Scooby11.string0.value).length < 1) {
alert("You must fill the first cell.");
document.Scooby11.string0.focus();
return;
}
id = "string" + 0;
localStorage.last_terms =""
i = 0
id = "string"+i;
wid = "sweight" + i;
weight_factor = document.getElementById(wid).value * 1
while(document.getElementById(id) && (document.getElementById(id).value).length > 0) {
weight_factor = document.getElementById(wid).value * 1
localStorage.last_terms = localStorage.last_terms + document.getElementById(id).value + "(" + weight_factor + "),";
i = i + 1
id = "string"+i;
wid = "sweight" + i;
}
terms = "[" + localStorage.last_terms + "]";
str = localStorage.last_terms
localStorage.last_terms = str.substring(0, str.length - 1)
document.Scooby11.terms.value = localStorage.last_terms
document.Scooby11.submit()
}
</script>
<html>
<head>
<body>
<div id="a" align="center" valign=top>
<div id="aa">
<button type="button" onclick=location.href="{{ url_for('hello')}}" class="btn btn-dark btn-sm">Home</button>
</div>
</div>
<div id="c" align=center valign=top>
<form method='post' name='Scooby11' action="/{{output}}" onsubmit='qualifyb();'>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="num_terms" id="num_terms" value=>
<input type="hidden" name="terms" id="terms" value="">
<table border=0 cellpadding="5" cellspacing="5">
<tr height=30>
<td colspan=2>
</tr>
<tr>
<td align=center><legend class="t1-legend">Search Strings</legend></td&t;
<td></td>
<td></td>
<td colspan=3 align=center><legend class="t1-legend">Weight</legend></td>
</tr>
{%for i in range(0, term_number)%}
<tr>
<td><input width=30 maxlength=50 id="string{{i}}" name="string{{i}}" value=""></td>
<td width=10></td>
<td align=center>
<legend class="t2-legend"<<span><div id="weight">1</div></span></legend>
</td>
<td width=10></td>
<td>
<input id="sweight{{i}}" type="range" class="custom" min="-10" max="10" step="1" value="1" onchange="srange_value(this.value,{{i}})"/>
</td>
</tr>
{%endfor%}
</table>
<table border=0>
<tr height=25>
<td></td>
</tr>
<tr>
<td height=20></td>
</tr>
<tr>
<td colspan=9 align=center> <button type="button" onclick="resumes_qualifyb()" class="btn btn-dark btn-sm" >Start Search</button></td>
</tr>
</form>
</table>
<table>
<tr height=40>
<td></td>
</tr>
</table>
</div>
</body>
</html>
|
|
<meta http-equiv="refresh" content="3500;url='/'" />
|
|
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
|
|
<style type="text/css" media="all">
body {
background-color: #F3F3F3;
color: #000000;
font-family:Georgia, serif;
}
#a {
position: absolute;
top: 0;
right: 0;
height: 80px;
width: 100%;
background-color: white;
}
#aa {
position: absolute;
top: 42px;
left: 10px;
font-family:"Arial";
background-color: white;
}
#b {
width:100%;
height:56px;
position:relative;
top:82px;
left:0;
background-color:#a63708;
font-family:Georgia, serif;
display: flex;
align-items: center;
justify-content: center;
}
#c {
width: 100%;
height: 400px;
position: absolute;
top:138px;
left:0px;
font-family:"Arial";
background-color: #F3F3F3;
}
.t1-legend{font:bold 14px Helvetica Neue,Helvetica,sans-serif;font-size:20px;color:#000000}
.t2-legend{font:14px Helvetica Neue,Helvetica,sans-serif;font-size:20px;color:#000000}
input[type=range] {
/*removes default webkit styles*/
-webkit-appearance: none;
/*fix for FF unable to apply focus style bug */
border: 1px solid white;
/*required for proper track sizing in FF*/
width: 200px;
}
input[type=range]::-webkit-slider-runnable-track {
width: 200px;
height: 5px;
background: #ddd;
border: none;
border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #000000;
margin-top: -4px;
}
input[type=range]:focus {
outline: none;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #ccc;
}
input[type=range]::-moz-range-track {
width: 200px;
height: 5px;
background: #ddd;
border: none;
border-radius: 3px;
}
input[type=range]::-moz-range-thumb {
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #000000;
}
/*hide the outline behind the border*/
input[type=range]:-moz-focusring{
outline: 1px solid white;
outline-offset: -1px;
}
input[type=range]::-ms-track {
width: 200px;
height: 5px;
/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
background: transparent;
/*leave room for the larger thumb to overflow with a transparent border */
border-color: transparent;
border-width: 6px 0;
/*remove default tick marks*/
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #777;
border-radius: 10px;
}
input[type=range]::-ms-fill-upper {
background: #ddd;
border-radius: 10px;
}
input[type=range]::-ms-thumb {
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #000000;
}
input[type=range]:focus::-ms-fill-lower {
background: #888;
}
input[type=range]:focus::-ms-fill-upper {
background: #ccc;
}
#footer {
position:absolute;
bottom:0;
height:-40px; /* Height of the footer */
background:#ffffff;
background-color: #F3F3F3;
color:#000000;
font-size: 1em;
alignment-adjust:central;
left:50px;
right:50px;
}
#footer {
clear:both;
padding: 1em;
text-align: center;
}
#footer_b {
position:absolute;
bottom:-30;
height:40px; /* Height of the footer */
background-color: #F3F3F3;
color:#000000;
font-size: 1em;
alignment-adjust:central;
left:50px;
right:50px;
font-family:Georgia, serif;
}
#footer_b {
clear:both;
padding: 1em;
text-align: center;
}
hr {
width:80%;height:1px;border-width:0;color:gray;background-color:gray;
}
</style>
|
|
|
<script type="text/javascript" >
function resumes_qualifyb() {
if((document.Scooby11.string0.value).length < 1) {
alert("You must fill the first cell.");
document.Scooby11.string0.focus();
return;
}
id = "string" + 0;
i = 0
id = "string"+i;
wid = "sweight" + i;
localStorage.last_terms = ""
while(document.getElementById(id) && (document.getElementById(id).value).length > 0) {
weight_factor = document.getElementById(wid).value * 1
localStorage.last_terms = localStorage.last_terms + document.getElementById(id).value + "(" + weight_factor + "),";
i = i + 1
id = "string"+i;
wid = "sweight" + i;
}
str = localStorage.last_terms
localStorage.last_terms = str.substring(0, str.length - 1)
document.Scooby11.terms.value = localStorage.last_terms
document.Scooby11.submit()
}
function srange_value(value, Id) {
Id = "weight"+Id;
document.getElementById(Id).innerHTML = value;
}
</script>
|
|
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title<aCURE</title>
<meta http-equiv="refresh" content="3500;url='/'" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</head>
<style type="text/css" media="all">
body {
background-color: #F3F3F3;
color: #000000;
font-family:Georgia, serif;
}
.t1-score{color:red}
a:link {
font-size:20px;
color: #000000;
font-style:normal;
font-family:Helvetica Neue,Helvetica,sans-serif;
font-weight:bold;
text-decoration: none;
}
a:visited {
font-size:20px;
color: #939393;
font-style:normal;
font-family:Helvetica Neue,Helvetica,sans-serif;
font-weight:bold;
text-decoration: none;
}
#a {
position: absolute;
top: 0;
right: 0;
height: 80px;
width: 100%;
background-color: white;
}
#ad {
position: relative;
top: 42px;
}
#aa {
position: absolute;
top: 42px;
left: 10px;
font-family:"Arial";
background-color: white;
}
#ab {
position: absolute;
top: 42px;
left: 141px;
}
#ac {
position: absolute;
top: 42px;
right: 50px;
}
#b {
width:100%;
height:56px;
position:relative;
top:82px;
left:0;
background-color:#a63708;
font-family:Georgia, serif;
display: flex;
align-items: center;
justify-content: center;
}
#c {
width: 100%;
height: 700px;
position: absolute;
top:138px;
left:0px;
font-family:Georgia, serif;
background-color: #F3F3F3;
}
.t1-legend{font:bold 20px Helvetica Neue,Helvetica,sans-serif;font-size:20px;color:#000000}
.t2-legend{font:20px Helvetica Neue,Helvetica,sans-serif;font-size:20px;color:#000000}
input[type=range] {
/*removes default webkit styles*/
-webkit-appearance: none;
/*fix for FF unable to apply focus style bug */
border: 1px solid white;
/*required for proper track sizing in FF*/
width: 200px;
}
input[type=range]::-webkit-slider-runnable-track {
width: 200px;
height: 5px;
background: #ddd;
border: none;
border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #207fef;
margin-top: -4px;
}
input[type=range]:focus {
outline: none;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #ccc;
}
input[type=range]::-moz-range-track {
width: 200px;
height: 5px;
background: #ddd;
border: none;
border-radius: 3px;
}
input[type=range]::-moz-range-thumb {
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #3498db;
}
/*hide the outline behind the border*/
input[type=range]:-moz-focusring{
outline: 1px solid white;
outline-offset: -1px;
}
input[type=range]::-ms-track {
width: 200px;
height: 5px;
/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
background: transparent;
/*leave room for the larger thumb to overflow with a transparent border */
border-color: transparent;
border-width: 6px 0;
/*remove default tick marks*/
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #777;
border-radius: 10px;
}
input[type=range]::-ms-fill-upper {
background: #ddd;
border-radius: 10px;
}
input[type=range]::-ms-thumb {
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #3498db;
}
input[type=range]:focus::-ms-fill-lower {
background: #888;
}
input[type=range]:focus::-ms-fill-upper {
background: #ccc;
}
#footer_b {
position:absolute;
bottom:-30;
height:40px; /* Height of the footer */
background-color: #F3F3F3;
color:#000000;
font-size: 1em;
alignment-adjust:central;
left:150px;
right:150px;
font-family:Georgia, serif;
}
#footer_b {
clear:both;
padding: 1em;
border-top: 1px solid #133;
text-align: center;
}
table {
border-collapse: collapse;
width: 100%;
background-color: #F3F3F3;
}
td {
padding: 30px;
text-align: left;
border-bottom: 1px solid #ddd;
}
td:hover{background-color:#f5f5f5}
td {
height: 50px;
vertical-align: top;
text-align: center;
}
th {
height: 20px;
width: 15%;
vertical-align: top;
text-align: center;
padding: 10px;
}
td:hover{background-color:#ffffff}
.t {
display: table;
width: 95%;
padding: 5px;
}
</style>
<!--- creates caching -->
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta http-equiv="expires" content="0">
<body>
<form class="form-signin" role="form">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }|" />
<input type="hidden" id="inputUsername" name="username" class="form-control" >
<input type="hidden" id="inputPassword" name="password" class="form-control">
<input type="hidden" id="inputSource" name="source" class="form-control">
<input type="hidden" id="route" name="route" class ="form_control" value="doaj">
</form>
<div id="a">
<div id="ad" align="center">
</div>
<div id="aa">
<button type="button" onclick=location.href="/" class="btn btn-dark btn-sm">Home</button>
</div>
<div id="ac">
<button type="button" onclick=location.href="/aplusb" class="btn btn-dark btn-sm">New Search</button>
</div>
</div>
<div id="b" align=center valign=top>
<font color=white size=20px<aCURE Arxiv + DOAJ Output</font<
</div>
<div id="c" align=center<
<div id="results" align=center>
</div>
<div id="footer_b" align=left&bt;
</div>
</div>
</body>
</html>
|
// page_counter is the number of times we display the information between the red strip
// and the copyright notice.
// x_count is telling us if we have more information left on this page
// anything above -1 means yes
// substring_count is not a good name. It keeps track of the number of anchors that have not been
// been re entered into the system after a record confilict.
// breakdown_count
<script>
page_counter = 0
breakdown_count = 0
x_count = 0
var substring_count = 0
function breakdown_arxiv(resp){
while (x_count > -1) {
text_response = text_response.substring(x)
y = text_response.indexOf('<id>')
text_response = text_response.substring(y+4)
y = text_response.indexOf('</id>')
url = text_response.substring(0,y)
y = text_response.indexOf('<title>')
text_response = text_response.substring(y+7)
y = text_response.indexOf('</title')
title = text_response.substring(0,y)
anchor = ' <a href="' + url + '" target="_blank">' + title + '</a>'
chipped(anchor, resp.weight)
x_count = text_response.indexOf('<entry>')
}
}
function breakdown_DOAJ(resp) {
x = text_response.indexOf('"link":')
count = 0
while (x > -1) {
text_response = text_response.substring(x+9)
x = text_response.indexOf('"http')
url = text_response.substring(x + 1)
x = url.indexOf('"}]')
url = url.substring(0,x)
x = text_response.indexOf('"title":')
text_response = text_response.substring(x+10)
x = text_response.indexOf('"},')
title = text_response.substring(0,x)
x = title.indexOf('",')
if(x > -1) {
title = title.substring(0,x)
}
anchor = ' <a href="' + url + '" target="_blank">' + title + '</a>'
// here we are checking to see if the term and anchor have been entered
// before. This prevents people from putting search terms in multiple
// times
chipped(anchor, resp.weight)
x = text_response.indexOf('"link":')
}
}
function chipped(anchor, multi) {
var requested = indexedDB.open(dbName, 2);
requested.onsuccess = function(ev) {
var db = ev.target.result;
var transaction = db.transaction(["customers"],"readwrite");
//Ask for the objectStore
var store = transaction.objectStore("customers");
multi = multi * 1
var person = {
anchor:anchor,
weight:multi
}
//Perform the add
var requesting = store.add(person);
requesting.onsuccess = function(e) {
}
requesting.onerror = function(e) {
substring_count = substring_count + 1
var db = ev.target.result;
var transaction = db.transaction(["customers"],"readwrite");
//Ask for the objectStore
var store = transaction.objectStore("customers");
console.log("Error",e.target.error.name);
var myIndex = store.index('anchor');
var getRequest = myIndex.get(anchor);
getRequest.onsuccess = function() {
const data = getRequest.result;
data.weight = data.weight + multi
const updateTitleRequest = store.put(data);
updateTitleRequest.onsuccess = function(e) {
substring_count = substring_count - 1
if(substring_count < 1) {
Result_Output()
}
}
}
getRequest.onerror = function() {
console.log("get request failed")
}
}
}
}
function Response_BreakDown(response) {
var page_output = ""
var resp = JSON.parse(response);
term = resp.user
text_response = resp.text
x_count = text_response.indexOf('<entry>')
temp = resp.text
source = resp.source
if(source == 'arxiv') {
breakdown_arxiv(resp)
}
if(source == 'DOAJ'){
breakdown_DOAJ(resp)
}
Result_Output()
}
function Result_Output(){
var requested = indexedDB.open(dbName, 2);
requested.onsuccess = function(ev) {
var db = ev.target.result;
var transaction = db.transaction(["customers"],"readwrite");
//Ask for the objectStore
var store = transaction.objectStore("customers");
var myIndex = store.index('weight',"prev");
var getAllRequest = myIndex.getAll();
getAllRequest.onsuccess = function() {
page_output = ""
breakdown_count = breakdown_count + 1
list_count = input_list.length * 4
if(breakdown_count < list_count) {
page_output = page_output + "</p><center> <h2>"+ breakdown_count + " of " + (list_count) + " completed</h2></center>"
} else {
if (substring_count == 0) {
page_output = page_output + "</p><center><h2>Search Completed</h2></center>"
}
}
page_output = page_output + "<table width=100% cellpadding=5>"
result_array = getAllRequest.result;
result_array = result_array.reverse()
out_count = 0
for (let i = 0; i < result_array.length; i++) {
if(out_count == 0) {page_output = page_output + "<tr>"}
page_output = page_output + "<td align=center width=33%>" + result_array[i].anchor + "</p><font color=red> score: " + result_array[i].weight + "</font></td>"
if(page_output == 2){
page_output = page_output + "</tr>"
}
out_count = out_count + 1
if(out_count == 3){
out_count = 0
}
if(i == 80){
break;
}
}
page_output = page_output + "</table>"
document.getElementById("results").innerHTML = ""
document.getElementById("results").innerHTML = page_output
}
}
}
var d = new Date();
var year = d.getFullYear()
document.getElementById("footer_b").innerHTML = "<center>Copyright Tom Folkes 2006 - " + year + "</center>"
const dbName = "the_name";
var req = indexedDB.deleteDatabase(dbName);
req.onsuccess = function () {
// console.log("Deleted database successfully");
};
req.onerror = function () {
// console.log("Couldn't delete database");
};
req.onblocked = function () {
// console.log("Couldn't delete database due to the operation being blocked");
};
var request = indexedDB.open(dbName, 2);
request.onerror = function(event) {
// console.log("db not opened")
};
request.onupgradeneeded = function(event) {
var db = event.target.result;
// Create an objectS and create a key anchor
var objectStore = db.createObjectStore("customers", { keyPath: "anchor" });
objectStore.createIndex("anchor", "anchor", { unique: true });
// Create an index to search customers by name. We may have duplicates
// so we can't use a unique index.
objectStore.createIndex("weight", "weight", { unique: false });
}
input_string = localStorage.last_terms
input_list = input_string.split(",")
input_list.forEach(function (item, index) {
x = item.indexOf("(")
termer = item.substring(0,x)
weight = item.substring(x+1, item.length-1)
page_counter = 1
while (page_counter < 4) {
term = termer.trim()
page = page_counter
term = term + "(" + page + ")"
document.getElementById("inputUsername").value = term
document.getElementById("inputPassword").value = weight
document.getElementById("inputSource").value = 'DOAJ'
$.ajax({
url: '/signUpUser2',
data: $('form').serialize(),
type: 'POST',
success: (response){
Response_BreakDown(response)
}
error: function(error){
console.log(error);
}
});
page_counter = page_counter + 1
}
})
input_list.forEach(function (item, index) {
x = item.indexOf("(")
term = item.substring(0,x)
weight = item.substring(x+1, item.length-1)
user = term.trim()
document.getElementById("inputUsername").value = term
document.getElementById("inputPassword").value = weight
document.getElementById("inputSource").value = 'arxiv'
$.ajax({
url: '/signUpUser4',
data: $('form').serialize(),
type: 'POST',
success:{
Response_BreakDown(response)
},
error: function(error){
console.log(error
}
});
})
function wait(ms) {
var start = Date.now(),
now = start;
while (now - start < ms) {
now = Date.now();
}
}
</script>
|
|
|
|
|
|
|
|
|
|
<form class="form-signin" role="form">
<input type="hidden" name="csrf_token" value="{ csrf_token() }" />
<input type="hidden" id="inputUsername" name="username" class="form-control" >
<input type="hidden" id="inputPassword" name="password" class="form-control">
<input type="hidden" id="inputSource" name="source" class="form-control">
<input type="hidden" id="route" name="route" class ="form_control" value="">
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dbName = "the_name";
var req = indexedDB.deleteDatabase(dbName);
req.onsuccess = function () {
// console.log("Deleted database successfully");
};
req.onerror = function () {
// console.log("Couldn't delete database");
};
req.onblocked = function () {
// console.log("Couldn't delete database due to the operation being blocked");
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var request = indexedDB.open(dbName, 2);
request.onerror = function(event) {
// console.log("db not opened")
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
request.onupgradeneeded = function(event) {
var db = event.target.result;
// Create an objects and create a key anchor
var objectStore = db.createObjectStore("customers", { keyPath: "anchor" });
objectStore.createIndex("anchor", "anchor", { unique: true });
// Create an index to search customers by name. We may have duplicates
// so we can't use a unique index.
objectStore.createIndex("weight", "weight", { unique: false });
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
input_string = localStorage.last_terms
input_list = input_string.split(",")
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
input_list.forEach(function (item, index) {
x = item.indexOf("(")
termer = item.substring(0,x)
weight = item.substring(x+1, item.length-1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (page_counter < 4) {
term = termer.trim()
page = page_counter
term = term + "(" + page + ")"
document.getElementById("inputUsername").value = term
document.getElementById("inputPassword").value = weight
document.getElementById("inputSource").value = 'DOAJ'
$.ajax({
url: '/signUpUser2',
data: $('form').serialize(),
type: 'POST',
success: (response){
Response_BreakDown(response)
}
error: function(error){
console.log(error);
}
});
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById("inputUsername").value = term
document.getElementById("inputPassword").value = weight
document.getElementById("inputSource").value = 'arxiv'
$.ajax({
url: '/signUpUser4',
data: $('form').serialize(),
type: 'POST',
success: (response){
Response_BreakDown(response)
}
error: function(error){
console.log(error)
}
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function breakdown_arxiv(resp){
while (x_count > -1) {
text_response = text_response.substring(x)
y = text_response.indexOf('<id>')
text_response = text_response.substring(y+4)
y = text_response.indexOf('</id>')
url = text_response.substring(0,y)
y = text_response.indexOf('<title>')
text_response = text_response.substring(y+7)
y = text_response.indexOf('</title')
title = text_response.substring(0,y)
anchor = ' <a href="' + url + '" target="_blank">' + title + '</a>'
chipped(anchor, resp.weight)
x_count = text_response.indexOf('<entry>')
}
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function breakdown_DOAJ(resp) {
x = text_response.indexOf('"link":')
count = 0
while (x > -1) {
text_response = text_response.substring(x+9)
x = text_response.indexOf('"http')
url = text_response.substring(x + 1)
x = url.indexOf('"}]')
url = url.substring(0,x)
x = text_response.indexOf('"title":')
text_response = text_response.substring(x+10)
x = text_response.indexOf('"},')
title = text_response.substring(0,x)
x = title.indexOf('",')
if(x > -1) {
title = title.substring(0,x)
}
anchor = ' <a href="' + url + '" target="_blank">' + title + '</a>'
// here we are checking to see if the term and anchor have been entered
// before. This prevents people from putting search terms in multiple
// times
chipped(anchor, resp.weight)
x = text_response.indexOf('"link":')
}
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function chipped(anchor, multi) {
var requested = indexedDB.open(dbName, 2);
requested.onsuccess = function(ev) {
var db = ev.target.result;
var transaction = db.transaction(["customers"],"readwrite");
//Ask for the objectStore
var store = transaction.objectStore("customers");
multi = multi * 1
var person = {
anchor:anchor,
weight:multi
}
//Perform the add
var requesting = store.add(person);
requesting.onsuccess = function(e) {
}
requesting.onerror = function(e) {
substring_count = substring_count + 1
var db = ev.target.result;
var transaction = db.transaction(["customers"],"readwrite");
//Ask for the objectStore
var store = transaction.objectStore("customers");
console.log("Error",e.target.error.name);
var myIndex = store.index('anchor');
var getRequest = myIndex.get(anchor);
getRequest.onsuccess = function() {
const data = getRequest.result;
data.weight = data.weight + multi
const updateTitleRequest = store.put(data);
updateTitleRequest.onsuccess = function(e) {
substring_count = substring_count - 1
if(substring_count < 1) {
Result_Output()
}
}
}
getRequest.onerror = function() {
console.log("get request failed")
}
}
}
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Response_BreakDown(response) {
var page_output = ""
var resp = JSON.parse(response);
term = resp.user
text_response = resp.text
x_count = text_response.indexOf('<entry>')
temp = resp.text
source = resp.source
if(source == 'arxiv') {
breakdown_arxiv(resp)
}
if(source == 'DOAJ'){
breakdown_DOAJ(resp)
}
Result_Output()
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Result_Output(){
var requested = indexedDB.open(dbName, 2);
requested.onsuccess = function(ev) {
var db = ev.target.result;
var transaction = db.transaction(["customers"],"readwrite");
//Ask for the objectStore
var store = transaction.objectStore("customers");
var myIndex = store.index('weight',"prev");
var getAllRequest = myIndex.getAll();
getAllRequest.onsuccess = function() {
page_output = ""
breakdown_count = breakdown_count + 1
list_count = input_list.length * 4
if(breakdown_count < list_count) {
page_output = page_output + "</p><center> <h2>"+ breakdown_count + " of " + (list_count) + " completed</h2></center>"
} else {
if (substring_count == 0) {
page_output = page_output + "</p><center><h2>Search Completed</h2></center>"
}
}
page_output = page_output + "<table width=100% cellpadding=5>"
result_array = getAllRequest.result;
result_array = result_array.reverse()
out_count = 0
for (let i = 0; i < result_array.length; i++) {
if(out_count == 0) {page_output = page_output + "<tr>"}
page_output = page_output + "<td align=center width=33%>" + result_array[i].anchor + "</p><font color=red> score: " + result_array[i].weight + "</font></td>"
if(page_output == 2){
page_output = page_output + "</tr>"
}
out_count = out_count + 1
if(out_count == 3){
out_count = 0
}
if(i == 80){
break;
}
}
page_output = page_output + "</table>"
document.getElementById("results").innerHTML = ""
document.getElementById("results").innerHTML = page_output
}
}
}
|
|