Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Commit

Permalink
Small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kalinchernev committed Jan 14, 2017
1 parent 464f594 commit e056f7b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 43 deletions.
36 changes: 14 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,32 @@ Learn more about [EU Open Data Portal](http://data.europa.eu/euodp/en/data)
```javascript
var odp = require('odp');

// Get a list of all datasets:
odp.getDatasets().then((data) => {
console.log(data);
});
// Get list of all datasets.
odp.getDatasets().then((data) => console.log(data))

// Get a range of the whole list of datasets:
odp.getDatasets({query:{limit: 100, offset: 1}}).then((data) => {
console.log(data);
});
// Get a range of the list of datasets:
odp.getDatasets({query: {limit: 100, offset: 1}})
.then((data) => console.log(data))

// Get all tags:
odp.getTags().then((data) => {
console.log(data);
});
odp.getTags().then(data => console.log(data))

// Search for a tag with an id, show all fields of the result set:
// Search through tags:
odp.getTags({
query: {
vocabulary_id: 'some_id',
all_fields: true
}
}).then((data) => {
console.log(data);
});
}
})
.then((data) => console.log(data))

// Get details about a dataset:
odp.getDataset({body:{id:'dgt-translation-memory'}}).then((data) => {
console.log(data);
});
odp.getDataset({body: {id: 'dgt-translation-memory'}})
.then((data) => console.log(data))

// Search for a dataset:
odp.datasetSearch({body: {q: "forest"}}).then((data) => {
console.log(data);
});
odp.datasetSearch({body: {q: 'forest'}})
.then((data) => console.log(data))

```

Expand Down
30 changes: 11 additions & 19 deletions examples/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,28 @@
var odp = require('../lib/odp')

// Get list of all datasets.
odp.getDatasets().then((data) => {
console.log(data)
})
odp.getDatasets().then((data) => console.log(data))

// Get a range of the list of datasets:
odp.getDatasets({query: {limit: 100, offset: 1}}).then((data) => {
console.log(data)
})
odp.getDatasets({query: {limit: 100, offset: 1}})
.then((data) => console.log(data))

// Get all tags:
odp.getTags().then((data) => {
console.log(data)
})
odp.getTags().then(data => console.log(data))

// Search through tags:
odp.getTags({
query: {
vocabulary_id: 'some_id',
all_fields: true
}
}).then((data) => {
console.log(data)
})
}
})
.then((data) => console.log(data))

// Get details about a dataset:
odp.getDataset({body: {id: 'dgt-translation-memory'}}).then((data) => {
console.log(data)
})
odp.getDataset({body: {id: 'dgt-translation-memory'}})
.then((data) => console.log(data))

// Search for a dataset:
odp.datasetSearch({body: {q: 'forest'}}).then((data) => {
console.log(data)
})
odp.datasetSearch({body: {q: 'forest'}})
.then((data) => console.log(data))
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
"license": "MIT",
"devDependencies": {
"chai": "^3.5.0",
"eslint": "^3.7.0",
"eslint": "^3.12.0",
"mocha": "^3.1.0"
},
"dependencies": {
"random-useragent": "^0.3.0",
"random-useragent": "^0.3.1",
"request": "^2.75.0"
}
}

0 comments on commit e056f7b

Please sign in to comment.