Commit 15296ea7 authored by delanoe's avatar delanoe

[FEAT] Scrapers configuration

parent 52c43285
......@@ -22,7 +22,7 @@ urlpatterns = [ url(r'^nodes$' , nodes.NodeListResource.as_view()
# aka lexical model
, url(r'^scraping$' , scraping.Target.as_view() )
#, url(r'^scraping$' , scraping.Target.as_view() )
# Scraping : getting data from external database
# Available databases : Pubmed, IsTex, (next: CERN)
]
......@@ -3,16 +3,15 @@
{% block css %}
{% load staticfiles %}
<link rel="stylesheet" href="{% static "css/bootstrap.css" %}">
<link rel="stylesheet" href="{% static "css/morris.css" %}">
<script src="{% static "js/raphael-min.js"%}"></script>
<script type="text/javascript" src="{% static "js/morris.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/jquery/jquery.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/gargantext/garganrest.js" %}"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="{% static "js/morris.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/morris.min.js" %}"></script>
<link rel="stylesheet" href="{% static "css/morris.css" %}">
<script src="{% static "js/raphael-min.js"%}"></script>
<style type="text/css">
.ui-autocomplete {
z-index: 5000;
......@@ -316,9 +315,7 @@
}
}
// //
// Scraping functions //
// //
function getGlobalResults(value){
console.log("in getGlobalResults()")
// AJAX to django
......@@ -332,10 +329,10 @@
var theType = $("#id_type option:selected").html();
if ( theType == "Pubmed (xml format)" ) {
if(theType=="Pubmed (xml format)") {
$.ajax({
// contentType: "application/json",
url: window.location.origin+"/api/scraping?source=pubmed",
url: window.location.origin+"/tests/pubmedquery",
data: formData,
type: 'POST',
beforeSend: function(xhr) {
......@@ -373,10 +370,10 @@
}
if(theType=="ISTex") {
console.log(window.location.origin+"api/scraping?source=istex")
console.log(window.location.origin+"tests/istextquery")
$.ajax({
// contentType: "application/json",
url: window.location.origin+"/api/scraping?source=istex",
url: window.location.origin+"/tests/istextquery",
data: formData,
type: 'POST',
beforeSend: function(xhr) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment