-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathResearchContentGetListTopUrls.js
147 lines (141 loc) · 3.32 KB
/
ResearchContentGetListTopUrls.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
function getResearchContentGetListTopUrlsSchema() {
return {
id: "ResearchContentGetListTopUrls",
alias: "Research Content Get List Top Urls",
columns: [
{
id: "url",
alias: "url",
dataType: tableau.dataTypeEnum.string
},
{
id: "keyword_count",
alias: "keyword_count",
dataType: tableau.dataTypeEnum.float
},
{
id: "avg_position",
alias: "ø position",
dataType: tableau.dataTypeEnum.float
},
{
id: "search_volume_total",
alias: "∑ search volume",
dataType: tableau.dataTypeEnum.float
},
{
id: "avg_cpc",
alias: "ø cpc",
dataType: tableau.dataTypeEnum.float
},
{
id: "traffic_index_total",
alias: "∑ traffic index",
dataType: tableau.dataTypeEnum.float
},
{
id: "traffic_potential_total",
alias: "∑ traffic potential total",
dataType: tableau.dataTypeEnum.float
},
{
id: "traffic_index_delta",
alias: "Δ traffic index",
dataType: tableau.dataTypeEnum.float
},
{
id: "seo_value",
alias: "seo_value",
dataType: tableau.dataTypeEnum.float
},
{
id: "seo_value_potential",
alias: "seo value potential",
dataType: tableau.dataTypeEnum.float
},
{
id: "seo_value_delta",
alias: "Δ seo value",
dataType: tableau.dataTypeEnum.float
},
{
id: "title",
alias: "title",
dataType: tableau.dataTypeEnum.string
},
{
id: "social_sum",
alias: "∑ social media",
dataType: tableau.dataTypeEnum.float
},
{
id: "social_fbsh",
alias: "social facebook",
dataType: tableau.dataTypeEnum.float
},
{
id: "social_gp",
alias: "social google plus",
dataType: tableau.dataTypeEnum.float
},
{
id: "backlinks",
alias: "backlinks",
dataType: tableau.dataTypeEnum.float
},
{
id: "refdoms",
alias: "referred domains",
dataType: tableau.dataTypeEnum.float
}
]
};
}
function transformResearchContentGetListTopUrlsData(data){
var collectedData = [];
var el = data.response;
if (el.length > 0){
data.response.map(function(el){
collectedData.push({
"url": el.url,
"keyword_count": el.keyword_count,
"avg_position": el.avg_position,
"search_volume_total": el.search_volume_total,
"avg_cpc": el.avg_cpc,
"traffic_index_total": el.traffic_index_total,
"traffic_potential_total": el.traffic_potential_total,
"traffic_index_delta": el.traffic_index_delta,
"seo_value": el.seo_value,
"seo_value_potential": el.seo_value_potential,
"seo_value_delta": el.seo_value_delta,
"title": el.title,
"social_sum": el.social_sum,
"social_fbsh": el.social_fbsh,
"social_gp": el.social_gp,
"backlinks": el.backlinks,
"refdoms": el.refdoms
});
});
} else{
collectedData.push({
"url": "n/a",
"keyword_count": "n/a",
"avg_position": "n/a",
"search_volume_total": "n/a",
"avg_cpc": "n/a",
"traffic_index_total": "n/a",
"traffic_potential_total": "n/a",
"traffic_index_delta": "n/a",
"seo_value": "n/a",
"seo_value_potential": "n/a",
"seo_value_delta": "n/a",
"title": "n/a",
"social_sum": "n/a",
"social_fbsh": "n/a",
"social_gp": "n/a",
"backlinks": "n/a",
"refdoms": "n/a"
});
}
return collectedData;
}