-
Notifications
You must be signed in to change notification settings - Fork 0
/
Explore.js
131 lines (128 loc) · 6.33 KB
/
Explore.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
const axios = require('axios');
const JsonData = require("./DummyData");
const uuid = require('./GetUUID.js');
const timeinc = require('./TimeIncrementer.js');
//uuid()
var sendExploreEvent = function(event_url, device_id, user_id, guest_user_profile_id, log_time){
return new Promise((resolve, reject) => {
var postData= {data:JSON.parse(JsonData.empty)}
postData.data.log_id = uuid.create_UUID();
postData.data.device_id = device_id;
postData.data.user_profile_id = user_id;
postData.data.guest_user_profile_id = guest_user_profile_id;
postData.data.country = "IN";
postData.data.ip = "168.212.226.204";
// postData.data.log_time = new Date().getTime();;
postData.data.log_time = log_time;
postData.data.user_details.avatar_url = "";
postData.data.meta_data = "false";
postData.data.user_details.is_guest = "true";
postData.data.device_details.device_type = "One Plus 9";
postData.data.device_details.os = "android";
postData.data.device_details.platform = "Android";
postData.data.ui_variant = "1";
postData.data.psid = uuid.create_UUID();
postData.data.csid = uuid.create_UUID();
postData.data.ssid = uuid.create_UUID();
postData.data.adjust_event_id = "";
postData.data.event_id = "eventid";
postData.data.event_category = "Explore";
postData.data.event_type = "Page View Event";
postData.data.event_name = "Explore Page";
postData.data.data.social_media_platform = "Facebook";
postData.data.event_description = "";
postData.data.app_version = "0.1.1";
axios.post(event_url, postData).then(function (response) {
console.log("1 req");
console.log(postData);
postData.data.log_id = uuid.create_UUID();
postData.data.log_time = timeinc.IncreaseTime(postData.data.log_time);
postData.data.ssid = uuid.create_UUID();
postData.data.event_type = "CTA";
postData.data.event_name = "View Profile";
axios.post(event_url, postData).then(()=>{
console.log("2 req");
console.log(postData);
postData.data.log_id = uuid.create_UUID();
postData.data.log_time = timeinc.IncreaseTime(postData.data.log_time);
postData.data.ssid = uuid.create_UUID();
postData.data.event_type = "CTA";
postData.data.event_name = "More - Profiles";
axios.post(event_url, postData).then(()=>{
console.log("3 req");
console.log(postData);
postData.data.log_id = uuid.create_UUID();
postData.data.log_time = timeinc.IncreaseTime(postData.data.log_time);
postData.data.ssid = uuid.create_UUID();
postData.data.event_type = "Page View Event";
postData.data.event_name = "Profile List";
axios.post(event_url, postData).then(()=>{
console.log("4 req");
console.log(postData);
postData.data.log_id = uuid.create_UUID();
postData.data.log_time = timeinc.IncreaseTime(postData.data.log_time);
postData.data.ssid = uuid.create_UUID();
postData.data.event_type = "CTA";
postData.data.event_name = "Back";
axios.post(event_url, postData).then(()=>{
console.log("5 req");
console.log(postData);
postData.data.log_id = uuid.create_UUID();
postData.data.log_time = timeinc.IncreaseTime(postData.data.log_time);
postData.data.ssid = uuid.create_UUID();
postData.data.meta_data = "true";
postData.data.event_type = "CTA";
postData.data.event_name = "View Experience";
axios.post(event_url, postData).then(()=>{
console.log("6 req");
console.log(postData);
postData.data.log_id = uuid.create_UUID();
postData.data.log_time = timeinc.IncreaseTime(postData.data.log_time);
postData.data.ssid = uuid.create_UUID();
postData.data.event_type = "CTA";
postData.data.event_name = "More - Trending Experiences";
axios.post(event_url, postData).then(()=>{
console.log("7 req");
console.log(postData);
postData.data.log_id = uuid.create_UUID();
postData.data.log_time = timeinc.IncreaseTime(postData.data.log_time);
postData.data.ssid = uuid.create_UUID();
postData.data.event_type = "Page View Event";
postData.data.event_name = "Trending Experiences";
axios.post(event_url, postData).then(()=>{
console.log("8 req");
console.log(postData);
postData.data.log_id = uuid.create_UUID();
postData.data.log_time = timeinc.IncreaseTime(postData.data.log_time);
postData.data.ssid = uuid.create_UUID();
postData.data.event_type = "CTA";
postData.data.event_name = "More - Hashtag Experiences";
axios.post(event_url, postData).then(()=>{
console.log("9 req");
console.log(postData);
postData.data.log_id = uuid.create_UUID();
postData.data.log_time = timeinc.IncreaseTime(postData.data.log_time);
postData.data.ssid = uuid.create_UUID();
postData.data.event_type = "Page View Event";
postData.data.event_name = "Hashtag - Experiences";
axios.post(event_url, postData).then(()=>{
console.log("10 req");
console.log(postData);
resolve();
})
})
})
})
})
})
})
})
})
})
.catch(function (error) {
console.log(error.data);
reject(err);
});
});
};
module.exports = {sendExploreEvent}