Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Fetch value lists from EDDI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AU - Web og Digital
Fetch value lists from EDDI
Commits
d03a1f35
Commit
d03a1f35
authored
9 years ago
by
Søren Madsen
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Drop existing filters before inserting new
[TASK] Add readme
parent
289863dc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+11
-0
11 additions, 0 deletions
README.md
getvaluefromEDDI.js
+6
-0
6 additions, 0 deletions
getvaluefromEDDI.js
with
17 additions
and
0 deletions
README.md
0 → 100644
+
11
−
0
View file @
d03a1f35
This script expects you to have a MongoDB instance running on port 3001
It also expects you to be on an AU trusted network
It requires the following npm_modules:
*
npm install "request"
*
npm install "mongodb"
### To run, simply type the following in a console:
`node getvaluefromEDDI.js`
This diff is collapsed.
Click to expand it.
getvaluefromEDDI.js
+
6
−
0
View file @
d03a1f35
...
@@ -8,6 +8,11 @@ var mongoUrl = "mongodb://localhost:3001/meteor";
...
@@ -8,6 +8,11 @@ var mongoUrl = "mongodb://localhost:3001/meteor";
var
params
=
[
"
ects
"
,
"
period
"
,
"
year
"
,
"
season
"
,
"
courseLevel
"
,
"
faculty
"
,
"
courseLanguage
"
,
"
department
"
,
"
location
"
,
"
programme
"
,
"
courseType
"
];
var
params
=
[
"
ects
"
,
"
period
"
,
"
year
"
,
"
season
"
,
"
courseLevel
"
,
"
faculty
"
,
"
courseLanguage
"
,
"
department
"
,
"
location
"
,
"
programme
"
,
"
courseType
"
];
var
lang
=
[
"
da
"
,
"
en
"
];
var
lang
=
[
"
da
"
,
"
en
"
];
mongo
.
connect
(
mongoUrl
,
function
(
err
,
db
)
{
db
.
collection
(
"
filters
"
).
drop
();
db
.
close
();
});
lang
.
forEach
(
function
(
lang
)
{
lang
.
forEach
(
function
(
lang
)
{
params
.
forEach
(
function
(
param
)
{
params
.
forEach
(
function
(
param
)
{
var
url
=
"
http://eddia1p1.adm.au.dk:7001/EDDI/webservices/CourseCatalogService2.cfc?method=getValueList&list=
"
+
param
+
"
&lang=
"
+
lang
;
var
url
=
"
http://eddia1p1.adm.au.dk:7001/EDDI/webservices/CourseCatalogService2.cfc?method=getValueList&list=
"
+
param
+
"
&lang=
"
+
lang
;
...
@@ -27,6 +32,7 @@ lang.forEach(function (lang) {
...
@@ -27,6 +32,7 @@ lang.forEach(function (lang) {
obj
[
"
list
"
]
=
arr
;
obj
[
"
list
"
]
=
arr
;
mongo
.
connect
(
mongoUrl
,
function
(
err
,
db
)
{
mongo
.
connect
(
mongoUrl
,
function
(
err
,
db
)
{
//db.collection("filters").drop();
db
.
collection
(
"
filters
"
).
insert
(
obj
,
function
(
err
,
docs
)
{
db
.
collection
(
"
filters
"
).
insert
(
obj
,
function
(
err
,
docs
)
{
db
.
close
();
db
.
close
();
});
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment