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() ...@@ -22,7 +22,7 @@ urlpatterns = [ url(r'^nodes$' , nodes.NodeListResource.as_view()
# aka lexical model # aka lexical model
, url(r'^scraping$' , scraping.Target.as_view() ) #, url(r'^scraping$' , scraping.Target.as_view() )
# Scraping : getting data from external database # Scraping : getting data from external database
# Available databases : Pubmed, IsTex, (next: CERN) # Available databases : Pubmed, IsTex, (next: CERN)
] ]
...@@ -3,16 +3,15 @@ ...@@ -3,16 +3,15 @@
{% block css %} {% block css %}
{% load staticfiles %} {% load staticfiles %}
<link rel="stylesheet" href="{% static "css/bootstrap.css" %}"> <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/jquery/jquery.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/gargantext/garganrest.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"> <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"> <style type="text/css">
.ui-autocomplete { .ui-autocomplete {
z-index: 5000; z-index: 5000;
...@@ -204,7 +203,7 @@ ...@@ -204,7 +203,7 @@
<div id="pubmedcrawl" style="visibility: hidden;"> <div id="pubmedcrawl" style="visibility: hidden;">
Do you have a file already? &nbsp; Do you have a file already? &nbsp;
<input type="radio" id="file_yes" name="file1" onclick="FileOrNotFile(this.value);" class="file1" value="true" checked>Yes </input> <input type="radio" id="file_yes" name="file1" onclick="FileOrNotFile(this.value);" class="file1" value="true" checked>Yes </input>
<input type="radio" id="file_no" name="file1" onclick="FileOrNotFile(this.value);" class="file1" value="false">No </input> <input type="radio" id="file_no" name="file1" onclick="FileOrNotFile(this.value);" class="file1" value="false">No </input>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -316,9 +315,7 @@ ...@@ -316,9 +315,7 @@
} }
} }
// //
// Scraping functions //
// //
function getGlobalResults(value){ function getGlobalResults(value){
console.log("in getGlobalResults()") console.log("in getGlobalResults()")
// AJAX to django // AJAX to django
...@@ -332,10 +329,10 @@ ...@@ -332,10 +329,10 @@
var theType = $("#id_type option:selected").html(); var theType = $("#id_type option:selected").html();
if ( theType == "Pubmed (xml format)" ) { if(theType=="Pubmed (xml format)") {
$.ajax({ $.ajax({
// contentType: "application/json", // contentType: "application/json",
url: window.location.origin+"/api/scraping?source=pubmed", url: window.location.origin+"/tests/pubmedquery",
data: formData, data: formData,
type: 'POST', type: 'POST',
beforeSend: function(xhr) { beforeSend: function(xhr) {
...@@ -373,10 +370,10 @@ ...@@ -373,10 +370,10 @@
} }
if(theType=="ISTex") { if(theType=="ISTex") {
console.log(window.location.origin+"api/scraping?source=istex") console.log(window.location.origin+"tests/istextquery")
$.ajax({ $.ajax({
// contentType: "application/json", // contentType: "application/json",
url: window.location.origin+"/api/scraping?source=istex", url: window.location.origin+"/tests/istextquery",
data: formData, data: formData,
type: 'POST', type: 'POST',
beforeSend: function(xhr) { 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