Commit e1fed489 authored by delanoe's avatar delanoe

[FIX] stashes changes.

parent 68b1707b
...@@ -2,26 +2,26 @@ from django.conf.urls import url ...@@ -2,26 +2,26 @@ from django.conf.urls import url
from . import nodes from . import nodes
from . import ngramlists from . import ngramlists
from . import scraping
urlpatterns = [ url(r'^nodes$' , nodes.NodeListResource.as_view())
, url(r'^nodes/(\d+)$' , nodes.NodeResource.as_view() )
, url(r'^nodes/(\d+)/facets$' , nodes.CorpusFacet.as_view() )
, url(r'^nodes/(\d+)/having$' , nodes.NodeListHaving.as_view() )
urlpatterns = [ # get a list of ngram_ids or ngram_infos by list_id
url(r'^nodes$' , nodes.NodeListResource.as_view()), # url(r'^ngramlists/(\d+)$', ngramlists.List.as_view()),
url(r'^nodes/(\d+)$' , nodes.NodeResource.as_view()),
url(r'^nodes/(\d+)/facets$' , nodes.CorpusFacet.as_view()), , url(r'^ngramlists/family$' , ngramlists.ListFamily.as_view())
url(r'^nodes/(\d+)/having$' , nodes.NodeListHaving.as_view()), # entire combination of lists from a corpus
# (or any combination of lists that go together :
# - a mainlist
# - an optional stoplist
# - an optional maplist
# - an optional grouplist
# aka lexical model
# add or remove ngram from a list , url(r'^scraping$' , scraping.Target.as_view() )
# ex: add <=> PUT ngramlists/change?list=42&ngrams=1,2 # Scraping : getting data from external database
# rm <=> DEL ngramlists/change?list=42&ngrams=1,2 # Available databases : Pubmed, IsTex, (next: CERN)
url(r'^ngramlists/change$', ngramlists.ListChange.as_view()), ]
# get entire combination of lists from a corpus
# (or any combination of lists that go together :
# - a mainlist
# - an optional stoplist
# - an optional maplist
# - an optional grouplist)
url(r'^ngramlists/family$', ngramlists.ListFamily.as_view()),
]
...@@ -316,7 +316,9 @@ ...@@ -316,7 +316,9 @@
} }
} }
// //
// Scraping functions //
// //
function getGlobalResults(value){ function getGlobalResults(value){
console.log("in getGlobalResults()") console.log("in getGlobalResults()")
// AJAX to django // AJAX to django
...@@ -330,10 +332,10 @@ ...@@ -330,10 +332,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+"/scrappers/pubmed/query", url: window.location.origin+"/api/scraping?source=pubmed",
data: formData, data: formData,
type: 'POST', type: 'POST',
beforeSend: function(xhr) { beforeSend: function(xhr) {
...@@ -371,10 +373,10 @@ ...@@ -371,10 +373,10 @@
} }
if(theType=="ISTex") { if(theType=="ISTex") {
console.log(window.location.origin+"tests/istextquery") console.log(window.location.origin+"api/scraping?source=istex")
$.ajax({ $.ajax({
// contentType: "application/json", // contentType: "application/json",
url: window.location.origin+"/tests/istextquery", url: window.location.origin+"/api/scraping?source=istex",
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