-
Notifications
You must be signed in to change notification settings - Fork 0
/
ResearchUniversalGetListRankingsDomain.js
108 lines (103 loc) · 2.09 KB
/
ResearchUniversalGetListRankingsDomain.js
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
function getResearchUniversalGetListRankingsDomainSchema() {
return {
id: "ResearchUniversalGetListRankingsDomain",
alias: "Research Universal List Rankings Domain",
columns: [
{
id: "keyword",
alias: "keyword",
dataType: tableau.dataTypeEnum.string
},
{
id: "position",
alias: "position",
dataType: tableau.dataTypeEnum.int
},
{
id: "page",
alias: "page",
dataType: tableau.dataTypeEnum.int
},
{
id: "traffic_monthly",
alias: "traffic_monthly",
dataType: tableau.dataTypeEnum.float
},
{
id: "cpc",
alias: "cpc",
dataType: tableau.dataTypeEnum.float
},
{
id: "type",
alias: "type",
dataType: tableau.dataTypeEnum.string
},
{
id: "competition",
alias: "competition",
dataType: tableau.dataTypeEnum.float
}
,
{
id: "search_volume_monthly",
alias: "search_volume_monthly",
dataType: tableau.dataTypeEnum.float
}
,
{
id: "title",
alias: "title",
dataType: tableau.dataTypeEnum.string
}
,
{
id: "url",
alias: "url",
dataType: tableau.dataTypeEnum.string
},
{
id: "search",
alias: "search",
dataType: tableau.dataTypeEnum.string
}
]
};
}
function transformResearchUniversalGetListRankingsDomainData(data){
var collectedData = [];
var el = data.response;
tableau.log(el);
if (el.length > 0){
data.response.map(function(el){
collectedData.push({
"keyword": el.keyword,
"position": el.position,
"page": el.page,
"traffic_monthly": el.traffic_monthly,
"cpc": el.cpc,
"type": el.type,
"competition": el.competition,
"search_volume_monthly": el.search_volume_monthly,
"title": el.title,
"url": el.url,
"search": el.search
});
});
}else{
collectedData.push({
"keyword": 'n/a',
"position": 'n/a',
"page": 'n/a',
"traffic_monthly": 'n/a',
"cpc": 'n/a',
"type": 'n/a',
"competition": 'n/a',
"search_volume_monthly": 'n/a',
"title": 'n/a',
"url": 'n/a',
"search": 'n/a'
});
}
return collectedData;
}