-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathidbsocialdata.ado
40 lines (31 loc) · 1.06 KB
/
idbsocialdata.ado
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
*******************************************************************************
*
*! v 0.1 by SCLData
* API end point to HTTPS
*******************************************************************************
program def idbsocialdata, rclass
version 9.0
syntax [,countries(string) ///
categories(string) ///
indicators(string) ///
yearstart(string) ///
yearend(string)]
local baseurl = "https://scl.datamig.org/data?"
if ("`indicators'"!="") {
local baseurl = "`baseurl'" + "&indicators=" + "`indicators'"
}
if ("`countries'"!="") {
local baseurl = "`baseurl'" + "&countries=" + "`countries'"
}
if ("`categories'"!="") {
local baseurl = "`baseurl'" + "&categories=" + "`categories'"
}
if ("`yearstart'"!="") {
local baseurl = "`baseurl'" + "&yearstart=" + "`yearstart'"
}
if ("`yearend'"!="") {
local baseurl = "`baseurl'" + "&yearend=" + "`yearend'"
}
local baseurl = "`baseurl'" + "&format=csv"
import delimited "`baseurl'"
end