(daysAgo = 30)
| 42 | } |
| 43 | |
| 44 | function generateRandomTimestamp(daysAgo = 30) { |
| 45 | const now = Date.now(); |
| 46 | const daysAgoMs = daysAgo * 24 * 60 * 60 * 1000; |
| 47 | const randomMs = Math.random() * daysAgoMs; |
| 48 | const timestamp = new Date(now - randomMs); |
| 49 | return timestamp.toISOString(); |
| 50 | } |
| 51 | |
| 52 | function generateSessionId(videoId, timestamp, city, browser, index) { |
| 53 | const day = timestamp.slice(0, 10); |