1const apiURL = "https://" + language + ".artmediaagency.com/api.php" ; 2const template = document.createElement("template") ; 3template.innerHTML = ` 4<!-- We do not track your IP or any personal data⦠only your usage of the website in order for us to improve your experience of AMA. --> 5` ; 6 7class AMAWebTracker extends HTMLElement { 8 constructor() { 9 super() ; 10 const shadow = this.attachShadow({ mode: 'closed' }) ; 11 shadow.append(template.content.cloneNode(true)) ; 12 13 this.properties = {} ; 14 this.properties.session = null ; 15 this.properties.page = null ; 16 this.properties.start = Date.now() ; 17 18 //this.properties.language = (navigator.language || navigator.userLanguage).substr(0,2) ; 19 this.properties.language = language ; 20 this.properties.os = AMAWebTracker.oss.find(e => e.regex.test(window.navigator.userAgent))?.name ; 21 this.properties.browser = AMAWebTracker.browsers.find(e => e.regex.test(window.navigator.userAgent))?.name ; 22 this.properties.country = AMAWebTracker.countries[Intl.DateTimeFormat().resolvedOptions().timeZone.split("/").at(-1)] ; 23 24 setInterval(_ => this.stillOnPage(this), 10000) ; 25 } 26 27 static get observedAttributes() { return ["page"] ; } 28 29 connectedCallback() { 30 31 } 32 33 attributeChangedCallback(name, oldValue, newValue) { 34 this.properties[name] = newValue ; 35 36 const duration = Date.now() - this.properties.start ; 37 this.properties.start = Date.now() ; 38 39 if (oldValue != null) 40 this.sendData(this.properties.session, oldValue, duration, this.properties.language, this.properties.os, this.properties.browser, this.properties.country) ; 41 } 42 43 async stillOnPage(tracker) { 44 const duration = Date.now() - tracker.properties.start ; 45 46 await tracker.sendData(tracker.properties.session, tracker.properties.page, duration, tracker.properties.language, tracker.properties.os, tracker.properties.browser, tracker.properties.country) ; 47 } 48 49 async sendData(session, page, duration, language, os, browser, country) { 50 const query = { "type": "track", "session": session, "page": page, "duration": duration, "language": language, "os": os, "browser": browser, "country": country } ; 51 const response = await fetch(apiURL, { method: "POST", headers: { "Content-Type": "application/json; charset=utf-8" }, body: JSON.stringify(query) }) ; 52 try { 53 const json = await response.json() ; 54 this.properties.session = json.data.session ; 55 } catch (err) { } 56 } 57 58 static browsers = [ 59 { "regex": /opr\//i, "name": "opera" }, 60 { "regex": /edg/i, "name": "edge" }, 61 { "regex": /chrome|chromium|crios/i, "name": "chrome" }, 62 { "regex": /firefox|fxios/i, "name": "firefox" }, 63 { "regex": /safari/i, "name": "safari" }, 64 { "regex": /trident/i, "name": "ie" }, 65 { "regex": /ucbrowser/i, "name": "uc" }, 66 { "regex": /samsungbrowser/i, "name": "samsung" } 67 ] ; 68 69 static oss = [ 70 { "regex": /win32|win64|windows|wince/i, "name": "windows" }, 71 { "regex": /macintosh|macintel|macppc|mac68k/i, "name": "macos" }, 72 { "regex": /iphone|ipad|ipod/i, "name": "ios" }, 73 { "regex": /linux|x11/i, "name": "unix" }, 74 { "regex": /android/i, "name": "android" } 75 ] ; 76 77 static countries = { 78 "Andorra": "ad", 79 "Dubai": "ae", 80 "Kabul": "af", 81 "Tirane": "al", 82 "Yerevan": "am", 83 "Casey": "aq", 84 "Davis": "aq", 85 "Mawson": "aq", 86 "Palmer": "aq", 87 "Rothera": "aq", 88 "Troll": "aq", 89 "Vostok": "aq", 90 "Buenos_Aires": "ar", 91 "Cordoba": "ar", 92 "Salta": "ar", 93 "Jujuy": "ar", 94 "Tucuman": "ar", 95 "Catamarca": "ar", 96 "La_Rioja": "ar", 97 "San_Juan": "ar", 98 "Mendoza": "ar", 99 "San_Luis": "ar", 100 "Rio_Gallegos": "ar", 101 "Ushuaia": "ar", 102 "Pago_Pago": "as", 103 "Vienna": "at", 104 "Lord_Howe": "au", 105 "Macquarie": "au", 106 "Hobart": "au", 107 "Melbourne": "au", 108 "Sydney": "au", 109 "Broken_Hill": "au", 110 "Brisbane": "au", 111 "Lindeman": "au", 112 "Adelaide": "au", 113 "Darwin": "au", 114 "Perth": "au", 115 "Eucla": "au", 116 "Baku": "az", 117 "Barbados": "bb", 118 "Dhaka": "bd", 119 "Brussels": "be", 120 "Sofia": "bg", 121 "Bermuda": "bm", 122 "Brunei": "bn", 123 "La_Paz": "bo", 124 "Noronha": "br", 125 "Belem": "br", 126 "Fortaleza": "br", 127 "Recife": "br", 128 "Araguaina": "br", 129 "Maceio": "br", 130 "Bahia": "br", 131 "Sao_Paulo": "br", 132 "Campo_Grande": "br", 133 "Cuiaba": "br", 134 "Santarem": "br", 135 "Porto_Velho": "br", 136 "Boa_Vista": "br", 137 "Manaus": "br", 138 "Eirunepe": "br", 139 "Rio_Branco": "br", 140 "Thimphu": "bt", 141 "Minsk": "by", 142 "Belize": "bz", 143 "St_Johns": "ca", 144 "Halifax": "ca", 145 "Glace_Bay": "ca", 146 "Moncton": "ca", 147 "Goose_Bay": "ca", 148 "Toronto": "ca", 149 "Nipigon": "ca", 150 "Thunder_Bay": "ca", 151 "Iqaluit": "ca", 152 "Pangnirtung": "ca", 153 "Winnipeg": "ca", 154 "Rainy_River": "ca", 155 "Resolute": "ca", 156 "Rankin_Inlet": "ca", 157 "Regina": "ca", 158 "Swift_Current": "ca", 159 "Edmonton": "ca", 160 "Cambridge_Bay": "ca", 161 "Yellowknife": "ca", 162 "Inuvik": "ca", 163 "Dawson_Creek": "ca", 164 "Fort_Nelson": "ca", 165 "Whitehorse": "ca", 166 "Dawson": "ca", 167 "Vancouver": "ca", 168 "Cocos": "cc", 169 "Zurich": "ch", 170 "Abidjan": "ci", 171 "Rarotonga": "ck", 172 "Santiago": "cl", 173 "Punta_Arenas": "cl", 174 "Easter": "cl", 175 "Shanghai": "cn", 176 "Urumqi": "cn", 177 "Bogota": "co", 178 "Costa_Rica": "cr", 179 "Havana": "cu", 180 "Cape_Verde": "cv", 181 "Christmas": "cx", 182 "Nicosia": "cy", 183 "Famagusta": "cy", 184 "Prague": "cz", 185 "Berlin": "de", 186 "Copenhagen": "dk", 187 "Santo_Domingo": "do", 188 "Algiers": "dz", 189 "Guayaquil": "ec", 190 "Galapagos": "ec", 191 "Tallinn": "ee", 192 "Cairo": "eg", 193 "El_Aaiun": "eh", 194 "Madrid": "es", 195 "Ceuta": "es", 196 "Canary": "es", 197 "Helsinki": "fi", 198 "Fiji": "fj", 199 "Stanley": "fk", 200 "Chuuk": "fm", 201 "Pohnpei": "fm", 202 "Kosrae": "fm", 203 "Faroe": "fo", 204 "Paris": "fr", 205 "London": "gb", 206 "Tbilisi": "ge", 207 "Cayenne": "gf", 208 "Gibraltar": "gi", 209 "Nuuk": "gl", 210 "Danmarkshavn": "gl", 211 "Scoresbysund": "gl", 212 "Thule": "gl", 213 "Athens": "gr", 214 "South_Georgia": "gs", 215 "Guatemala": "gt",
216 "Guam": "gu", 217 "Bissau": "gw", 218 "Guyana": "gy", 219 "Hong_Kong": "hk", 220 "Tegucigalpa": "hn", 221 "Port-au-Prince": "ht", 222 "Budapest": "hu", 223 "Jakarta": "id", 224 "Pontianak": "id", 225 "Makassar": "id", 226 "Jayapura": "id", 227 "Dublin": "ie", 228 "Jerusalem": "il", 229 "Kolkata": "in", 230 "Calcutta": "in", 231 "Chagos": "io", 232 "Baghdad": "iq", 233 "Tehran": "ir", 234 "Reykjavik": "is", 235 "Rome": "it", 236 "Jamaica": "jm", 237 "Amman": "jo", 238 "Tokyo": "jp", 239 "Nairobi": "ke", 240 "Bishkek": "kg", 241 "Tarawa": "ki", 242 "Kanton": "ki", 243 "Kiritimati": "ki", 244 "Pyongyang": "kp", 245 "Seoul": "kr", 246 "Almaty": "kz", 247 "Qyzylorda": "kz", 248 "Qostanay": "kz", 249 "Aqtobe": "kz", 250 "Aqtau": "kz", 251 "Atyrau": "kz", 252 "Oral": "kz", 253 "Beirut": "lb", 254 "Colombo": "lk", 255 "Monrovia": "lr", 256 "Vilnius": "lt", 257 "Luxembourg": "lu", 258 "Riga": "lv", 259 "Tripoli": "ly", 260 "Casablanca": "ma", 261 "Monaco": "mc", 262 "Chisinau": "md", 263 "Majuro": "mh", 264 "Kwajalein": "mh", 265 "Yangon": "mm", 266 "Ulaanbaatar": "mn", 267 "Hovd": "mn", 268 "Choibalsan": "mn", 269 "Macau": "mo", 270 "Martinique": "mq", 271 "Malta": "mt", 272 "Mauritius": "mu", 273 "Maldives": "mv", 274 "Mexico_City": "mx", 275 "Cancun": "mx", 276 "Merida": "mx", 277 "Monterrey": "mx", 278 "Matamoros": "mx", 279 "Mazatlan": "mx", 280 "Chihuahua": "mx", 281 "Ojinaga": "mx", 282 "Hermosillo": "mx", 283 "Tijuana": "mx", 284 "Bahia_Banderas": "mx", 285 "Kuala_Lumpur": "my", 286 "Kuching": "my", 287 "Maputo": "mz", 288 "Windhoek": "na", 289 "Noumea": "nc", 290 "Norfolk": "nf", 291 "Lagos": "ng", 292 "Managua": "ni", 293 "Amsterdam": "nl", 294 "Oslo": "no", 295 "Kathmandu": "np", 296 "Nauru": "nr", 297 "Niue": "nu", 298 "Auckland": "nz", 299 "Chatham": "nz", 300 "Panama": "pa", 301 "Lima": "pe", 302 "Tahiti": "pf", 303 "Marquesas": "pf", 304 "Gambier": "pf", 305 "Port_Moresby": "pg", 306 "Bougainville": "pg", 307 "Manila": "ph", 308 "Karachi": "pk", 309 "Warsaw": "pl", 310 "Miquelon": "pm", 311 "Pitcairn": "pn", 312 "Puerto_Rico": "pr", 313 "Gaza": "ps", 314 "Hebron": "ps", 315 "Lisbon": "pt", 316 "Madeira": "pt", 317 "Azores": "pt", 318 "Palau": "pw", 319 "Asuncion": "py", 320 "Qatar": "qa", 321 "Reunion": "re", 322 "Bucharest": "ro", 323 "Belgrade": "rs", 324 "Kaliningrad": "ru", 325 "Moscow": "ru", 326 "Simferopol": "ru", 327 "Kirov": "ru", 328 "Volgograd": "ru", 329 "Astrakhan": "ru", 330 "Saratov": "ru", 331 "Ulyanovsk": "ru", 332 "Samara": "ru", 333 "Yekaterinburg": "ru", 334 "Omsk": "ru", 335 "Novosibirsk": "ru", 336 "Barnaul": "ru", 337 "Tomsk": "ru", 338 "Novokuznetsk": "ru", 339 "Krasnoyarsk": "ru", 340 "Irkutsk": "ru", 341 "Chita": "ru", 342 "Yakutsk": "ru", 343 "Khandyga": "ru", 344 "Vladivostok": "ru", 345 "Ust-Nera": "ru", 346 "Magadan": "ru", 347 "Sakhalin": "ru", 348 "Srednekolymsk": "ru", 349 "Kamchatka": "ru", 350 "Anadyr": "ru", 351 "Riyadh": "sa", 352 "Guadalcanal": "sb", 353 "Mahe": "sc", 354 "Khartoum": "sd", 355 "Stockholm": "se", 356 "Singapore": "sg", 357 "Paramaribo": "sr", 358 "Juba": "ss", 359 "Sao_Tome": "st", 360 "El_Salvador": "sv", 361 "Damascus": "sy", 362 "Grand_Turk": "tc", 363 "Ndjamena": "td", 364 "Kerguelen": "tf", 365 "Bangkok": "th", 366 "Dushanbe": "tj", 367 "Fakaofo": "tk", 368 "Dili": "tl", 369 "Ashgabat": "tm", 370 "Tunis": "tn", 371 "Tongatapu": "to", 372 "Istanbul": "tr", 373 "Funafuti": "tv", 374 "Taipei": "tw", 375 "Kiev": "ua", 376 "Uzhgorod": "ua", 377 "Zaporozhye": "ua", 378 "Wake": "um", 379 "New_York": "us", 380 "Detroit": "us", 381 "Louisville": "us", 382 "Monticello": "us", 383 "Indianapolis": "us", 384 "Vincennes": "us", 385 "Winamac": "us", 386 "Marengo": "us", 387 "Petersburg": "us", 388 "Vevay": "us", 389 "Chicago": "us", 390 "Tell_City": "us", 391 "Knox": "us", 392 "Menominee": "us", 393 "Center": "us", 394 "New_Salem": "us", 395 "Beulah": "us", 396 "Denver": "us", 397 "Boise": "us", 398 "Phoenix": "us", 399 "Los_Angeles": "us", 400 "Anchorage": "us", 401 "Juneau": "us", 402 "Sitka": "us", 403 "Metlakatla": "us", 404 "Yakutat": "us", 405 "Nome": "us", 406 "Adak": "us", 407 "Honolulu": "us", 408 "Montevideo": "uy", 409 "Samarkand": "uz", 410 "Tashkent": "uz", 411 "Caracas": "ve", 412 "Ho_Chi_Minh": "vn", 413 "Efate": "vu", 414 "Wallis": "wf", 415 "Apia": "ws", 416 "Johannesburg": "za", 417 "Antigua": "ag", 418 "Anguilla": "ai", 419 "Luanda": "ao", 420 "McMurdo": "aq", 421 "DumontDUrville": "aq", 422 "Syowa": "aq", 423 "Aruba": "aw", 424 "Mariehamn": "ax", 425 "Sarajevo": "ba", 426 "Ouagadougou": "bf", 427 "Bahrain": "bh", 428 "Bujumbura": "bi", 429 "Porto-Novo": "bj", 430 "St_Barthelemy": "bl", 431 "Kralendijk": "bq", 432 "Nassau": "bs", 433 "Gaborone": "bw", 434 "Blanc-Sablon": "ca", 435 "Atikokan": "ca", 436 "Creston": "ca", 437 "Kinshasa": "cd", 438 "Lubumbashi": "cd", 439 "Bangui": "cf", 440 "Brazzaville": "cg", 441 "Douala": "cm", 442 "Curacao": "cw", 443 "Busingen": "de", 444 "Djibouti": "dj", 445 "Dominica": "dm", 446 "Asmara": "er", 447 "Addis_Ababa": "et", 448 "Libreville": "ga", 449 "Grenada": "gd",
450 "Guernsey": "gg", 451 "Accra": "gh", 452 "Banjul": "gm", 453 "Conakry": "gn", 454 "Guadeloupe": "gp", 455 "Malabo": "gq", 456 "Zagreb": "hr", 457 "Isle_of_Man": "im", 458 "Jersey": "je", 459 "Phnom_Penh": "kh", 460 "Comoro": "km", 461 "St_Kitts": "kn", 462 "Kuwait": "kw", 463 "Cayman": "ky", 464 "Vientiane": "la", 465 "St_Lucia": "lc", 466 "Vaduz": "li", 467 "Maseru": "ls", 468 "Podgorica": "me", 469 "Marigot": "mf", 470 "Antananarivo": "mg", 471 "Skopje": "mk", 472 "Bamako": "ml", 473 "Saipan": "mp", 474 "Nouakchott": "mr", 475 "Montserrat": "ms", 476 "Blantyre": "mw", 477 "Niamey": "ne", 478 "Muscat": "om", 479 "Kigali": "rw", 480 "St_Helena": "sh", 481 "Ljubljana": "si", 482 "Longyearbyen": "sj", 483 "Bratislava": "sk", 484 "Freetown": "sl", 485 "San_Marino": "sm", 486 "Dakar": "sn", 487 "Mogadishu": "so", 488 "Lower_Princes": "sx", 489 "Mbabane": "sz", 490 "Lome": "tg", 491 "Port_of_Spain": "tt", 492 "Dar_es_Salaam": "tz", 493 "Kampala": "ug", 494 "Midway": "um", 495 "Vatican": "va", 496 "St_Vincent": "vc", 497 "Tortola": "vg", 498 "St_Thomas": "vi", 499 "Aden": "ye", 500 "Mayotte": "yt", 501 "Lusaka": "zm", 502 "Harare": "zw" 503 } 504} 505 506customElements.define('ama-web-tracker', AMAWebTracker) ; 507 508export default AMAWebTracker ;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.