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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
use serde::de;
use serde::{Deserialize, Deserializer, Serialize};

use crate::page;
use futures::future::join_all;
use regex::Regex;
use std::collections::HashMap;
use std::fmt;
use std::marker::PhantomData;
use std::sync::Arc;

extern crate lazy_static;

// The build.rs build script reads the local apps.json file at build time
// and includes the text string as a constant in a created 'apps.json.rs'
// in the build dir. Here, we include this constant.
include!(concat!(env!("OUT_DIR"), "/apps.json.rs"));

pub async fn check(raw_data: Arc<page::RawData>) -> Vec<Tech> {
    let mut futures: Vec<tokio::task::JoinHandle<Option<Tech>>> = vec![];

    for app in APPS_JSON_DATA.apps.values() {
        futures.push(app.tech_tokio(raw_data.clone()));
    }

    join_all(futures)
        .await
        .iter()
        .filter_map(|r| r.as_ref().ok())
        .filter(|o| o.is_some())
        .map(|r| r.as_ref().unwrap().to_owned())
        .collect::<Vec<_>>()
}

// lazy_static! {
//     static ref APPS_JSON_DATA: AppsJsonData = {
//         let apps_json = fs::read_to_string(APPS_JSON_PATH)
//             .expect("Something went wrong reading the apps.json file");
//         let mut apps_json_data: AppsJsonData =
//             serde_json::from_str(&apps_json).expect("Error loading the apps.json file");

//         for (app_name, app) in apps_json_data.apps.iter_mut() {
//             (*app).name = String::from(app_name);
//         }

//         apps_json_data
//     };
// }

lazy_static! {
    static ref APPS_JSON_DATA: AppsJsonData = {
        let mut apps_json_data: AppsJsonData =
            serde_json::from_str(APPS_JSON_TEXT).expect("Error loading the apps.json file");

        for (app_name, app) in apps_json_data.apps.iter_mut() {
            (*app).name = String::from(app_name);
        }

        apps_json_data
    };
}

/// A technology that is found on a page
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
pub struct Tech {
    pub category: String,
    pub name: String,
}
impl Tech {
    /// let tech = Tech::named("webpack");
    /// assert_eq!(tech.name, "webpack");
    /// assert_eq!(tech.category, "Miscellaneous");
    // fn named(name: &str) -> Option<Tech> {
    //     if let Some(app) = APPS_JSON_DATA.named(name) {
    //         Some(Tech::from(app))
    //     } else {
    //         None
    //     }
    // }

    pub fn from(app: &App) -> Tech {
        Tech {
            name: app.name.clone(),
            category: app.category_name(),
        }
    }
}

#[derive(Debug, Serialize, Deserialize)]
pub struct AppsJsonData {
    apps: HashMap<String, App>,
    categories: HashMap<u32, Category>,
}
impl AppsJsonData {
    // fn named(&self, name: &str) -> Option<&App> {
    //     self.apps.get(&String::from(name))
    // }

    fn category_name(&self, id: u32) -> Option<String> {
        match self.categories.get(&id) {
            // Some(category) => Some(String::from(category.name)),
            Some(category) => Some(category.name.clone()),
            None => None,
        }
    }
}
#[derive(Debug, Serialize, Deserialize, PartialEq)]
pub struct App {
    #[serde(skip)]
    name: String,
    cats: Vec<u32>,
    website: String,
    #[serde(default)]
    priority: i32,
    #[serde(deserialize_with = "one_or_more_strings")]
    #[serde(default)]
    html: Vec<String>,
    #[serde(default)]
    headers: HashMap<String, String>,
    #[serde(default)]
    cookies: HashMap<String, String>,
    #[serde(default)]
    js: HashMap<String, String>,
    #[serde(default)]
    url: String,
    #[serde(default)]
    meta: HashMap<String, String>,
    #[serde(default)]
    icon: String,
    #[serde(deserialize_with = "one_or_more_strings")]
    #[serde(default)]
    implies: Vec<String>,
    #[serde(default)]
    #[serde(deserialize_with = "one_or_more_strings")]
    excludes: Vec<String>,
    #[serde(default)]
    #[serde(deserialize_with = "one_or_more_strings")]
    script: Vec<String>,
}

impl App {
    pub fn category_name(&self) -> String {
        assert!(!self.cats.is_empty());
        APPS_JSON_DATA.category_name(self.cats[0]).unwrap()
    }

    // pub fn check_headers(&self,)
    // pub async fn tech(
    //     &self,
    //     headers: &reqwest::header::HeaderMap,
    //     cookies: &[crate::Cookie],
    //     meta_tags: &HashMap<String, String>,
    //     parsed_html: &Html,
    //     html: &str,
    // ) -> Option<Tech> {
    //     if self.check(headers.clone(), cookies.clone(), meta_tags.clone(), html.clone()) {
    //         Some(Tech::from(self))
    //     } else {
    //         None
    //     }
    // }

    pub fn tech_tokio(
        &'static self,
        raw_data: Arc<page::RawData>,
    ) -> tokio::task::JoinHandle<Option<Tech>> {
        tokio::spawn(async move {
            if self.check(raw_data.clone()) {
                Some(Tech::from(self))
            } else {
                None
            }
        })
    }

    // TODO: initially only checking for one positive
    pub fn check(&self, raw_data: Arc<page::RawData>) -> bool {
        // check headers
        for (header_to_check, expected_value) in self.headers.iter() {
            if let Some(value) = raw_data.headers.get(header_to_check) {
                // println!("1. {:?}", value);
                if let Ok(string_value) = value.to_str() {
                    if check_text(expected_value, string_value) {
                        // eprintln!(
                        //     "||| HEADER ({}) hit on: {}",
                        //     header_to_check, expected_value
                        // );
                        return true; // TODO: temp impletation that returns on any hit
                    }
                }
            }
        }

        // html
        for maybe_regex in self.html.iter() {
            if check_text(maybe_regex, &raw_data.html) {
                // eprintln!("||| HTML hit on: {}", maybe_regex);
                return true; // TODO: temp impletation that returns on any hit
            }
        }

        // cookies
        for (cookies_to_check, expected_value) in self.cookies.iter() {
            // Examples from app.json
            // "__cfduid": ""
            // "__derak_auth": "",
            // "_session_id": "\\;confidence:75"
            // "ci_csrf_token": "^(.+)$\\;version:\\1?2+:",
            // "Fe26.2**": "\\;confidence:50"

            // COOKIE: Cookie { cookie_string: Some("1P_JAR=2019-09-18-19; expires=Fri, 18-Oct-2019 19:05:14 GMT; path=/; domain=.google.com; SameSite=none"), name: Indexed(0, 6), value: Indexed(7, 20), expires: Some(Tm { tm_sec: 14, tm_min: 5, tm_hour: 19, tm_mday: 18, tm_mon: 9, tm_year: 119, tm_wday: 5, tm_yday: 0, tm_isdst: 0, tm_utcoff: 0, tm_nsec: 0 }), max_age: None, domain: Some(Indexed(77, 87)), path: Some(Indexed(66, 67)), secure: None, http_only: None, same_site: None }
            // COOKIE: Cookie { cookie_string: Some("NID=188=E7jfAOxVZYeABbEwAi-4RN6pK1a-98zWM1hcFnt8bjHM_303Gon7qmJCopif_taWAwwNrpB9bcjQXn1Mm9gRzIagJSoLll4Wp0XHrPtBUMIXN58jCbdQFVEKAz1yJgyi_oxdG6NVYB2An8_RWmJ-EWp-6umHMMatZfxTAyE2-n8; expires=Thu, 19-Mar-2020 19:05:14 GMT; path=/; domain=.google.com; HttpOnly"), name: Indexed(0, 3), value: Indexed(4, 179), expires: Some(Tm { tm_sec: 14, tm_min: 5, tm_hour: 19, tm_mday: 19, tm_mon: 2, tm_year: 120, tm_wday: 4, tm_yday: 0, tm_isdst: 0, tm_utcoff: 0, tm_nsec: 0 }), max_age: None, domain: Some(Indexed(236, 246)), path: Some(Indexed(225, 226)), secure: None, http_only: Some(true), same_site: None }

            // loop through and find the appropriate cookie
            if let Some(c) = raw_data.cookies.iter().find(|c| {
                // eprintln!("COOKIE: ({})==({})", c.name(), cookies_to_check);
                c.name == *cookies_to_check
            }) {
                // an empty expected_value means that we only care about the existence if the cookie
                if expected_value.is_empty() || check_text(expected_value, &c.value) {
                    // eprintln!("||| COOKIE ({}) hit on: {}", c.value, expected_value);
                    return true; // TODO: Temp impl where one hit returns
                }
            }
        }

        // try just checking for the js_to_check value, as (1) the js version seems to use the dom directly, and
        // (2) the Go version doesn't seem to work
        for (js_to_check, _rule_value) in self.js.iter() {
            for js in &raw_data.script_tags {
                if check_text(js_to_check, js) {
                    // eprintln!("||| JS hit on: {}", js_to_check);
                    return true;
                }
            }
        }

        // meta
        for (meta_to_check, expected_value) in self.meta.iter() {
            if let Some(value) = raw_data.meta_tags.get(meta_to_check) {
                // an empty expected_value means that we only care about the existence if the cookie
                if check_text(expected_value, value) {
                    // eprintln!(
                    //     "||| META ({}) hit on: {} for value: {}",
                    //     meta_to_check, expected_value, value
                    // );
                    return true; // TODO: Temp impl where one hit returns
                }
            }
        }

        // check html
        false
    }
}

#[derive(Debug, Serialize, Deserialize)]
struct Category {
    name: String,
    priority: u8,
}

// The meat of the matter
fn check_text(maybe_regex: &str, text: &str) -> bool {
    // TODO: strignoring version stuff for now.
    // TODO: Compile regex's in the initialization area.
    let maybe_regex = String::from(maybe_regex);
    let maybe_regex = maybe_regex.split("\\;").collect::<Vec<&str>>()[0];
    match Regex::new(maybe_regex) {
        Ok(re) => {
            // println!("REGEX IS FINE: [{}]", maybe_regex);
            re.is_match(text)
        }
        Err(_) => {
            // eprintln!("invalid regex in app.json '{}': {}", maybe_regex, err);
            // panic!("invalid regex in app.json '{}': {}", maybe_regex, err);
            false
        }
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    // use reqwest::header;

    // #[test]
    // fn tech_lookup() {
    //     let tech = Tech::named("webpack").unwrap();
    //     assert_eq!(tech.name, "webpack");
    //     assert_eq!(tech.category, "Miscellaneous");
    // }

    // #[test]
    // fn test_check_app() {
    //     // assert_eq!(
    //     //     APPS_JSON_DATA
    //     //         .named("webpack")
    //     //         .unwrap()
    //     //         .tech(&header::HeaderMap::new(), ""),
    //     //     None
    //     // );
    //     // assert_eq!(
    //     //     APPS_JSON_DATA.named("webpack").unwrap().tech(""),
    //     //     Tech::named("webpack")
    //     // );
    // }

    #[test]
    fn test_check_text() {
        assert!(check_text("foo", "somefood"));
        assert!(!check_text("bar", "somefood"));
        assert!(check_text("[CK]amva", "Kamva"));
        assert!(!check_text("[CK]amva", "Lamva"));
        assert!(check_text(
            "cf\\.kampyle\\.com/k_button\\.js",
            "some cf.kampyle.com/k_button.js"
        ));
        assert!(!check_text(
            "cf\\.kampyle\\.com/k_button\\.js",
            "some cXf.kampyle.com/k_button.js"
        ));
        assert!(check_text(
            "optimizely\\.com.*\\.js",
            "cdn.optimizely.com/js/711892001.js"
        ));
        assert!(!check_text(
            "<link[^>]+?href=[^\"]/css/([\\d.]+)/bootstrap\\.(?:min\\.)?css\\;version:\\1",
            "cdn.optimizely.com/js/711892001.js"
        ));

        //         invalid regex in app.json '<link[^>]+?href=[^"]/css/([\d.]+)/bootstrap\.(?:min\.)?css\;version:\1': regex parse error:
        // <link[^>]+?href=[^"]/css/([\d.]+)/bootstrap\.(?:min\.)?css\;version:\1

        // assert!(!check_text(
        //     "<link[^>]*\\s+href=[^>]*styles/kendo\\.common(?:\\.min)?\\.css[^>]*/>",
        //     ""
        // ));
        // assert!(check_text(
        //     "<link[^>]*\\s+href=[^>]*styles/kendo\\.common(?:\\.min)?\\.css[^>]*/>",
        //     "<link "
        // ));
    }
}

fn one_or_more_strings<'de, D>(deserializer: D) -> Result<Vec<String>, D::Error>
where
    D: Deserializer<'de>,
{
    struct StringOrVec(PhantomData<Vec<String>>);

    impl<'de> de::Visitor<'de> for StringOrVec {
        type Value = Vec<String>;

        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
            formatter.write_str("string or list of strings")
        }

        fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
        where
            E: de::Error,
        {
            Ok(vec![value.to_owned()])
        }

        fn visit_seq<S>(self, visitor: S) -> Result<Self::Value, S::Error>
        where
            S: de::SeqAccess<'de>,
        {
            Deserialize::deserialize(de::value::SeqAccessDeserializer::new(visitor))
        }
    }

    deserializer.deserialize_any(StringOrVec(PhantomData))
}

/*

"AdvertisingNetworks/DoubleClickAdExchange(AdX)"
"AdvertisingNetworks/GoogleAdSense"
"Analytics/Clicky"
"Analytics/comScore"
"Analytics/GoogleAnalytics"
"Analytics/Liveinternet"
"Analytics/Optimizely"
"Analytics/SiteMeter"
"Analytics/Statcounter"
"Analytics/TrackJs"
"Analytics/Woopra"
"Blogs/Tumblr"
"CacheTools/GooglePageSpeed"
"CacheTools/RackCache"
"CacheTools/Varnish"
"CacheTools/W3TotalCache"
"CacheTools/WordPressSuperCache"
"CacheTools/WPRocket"
"Captchas/reCAPTCHA"
"CDN/Akamai"
"CDN/AmazonCloudfront"
"CDN/CloudFlare"
"CDN/GitHubPages"
"CDN/Incapsula"
"CDN/Sucuri"
"CMS/Concrete5"
"CMS/DNN"
"CMS/Drupal"
"CMS/Elementor"
"CMS/Joomla"
"CMS/KenticoCMS"
"CMS/SiteBuilder__Webzai"
"CMS/Squarespace"
"CMS/TYPO3CMS"
"CMS/Weebly"
"CMS/Wix"
"CMS/WordPress"
"Databases/Firebase"
"Databases/MongoDB"
"Databases/MySQL"
"Ecommerce/Bigcommerce"
"Ecommerce/CommerceServer"
"Ecommerce/Magento"
"Ecommerce/PrestaShop"
"Ecommerce/Shopify"
"Ecommerce/WooCommerce"
"Ecommerce/ZenCart"
"Editors/DreamWeaver"
"Editors/FrontPage"
"Editors/MicrosoftWord"
"Editors/WebSiteX5"
"FontScripts/Cufon"
"FontScripts/FontAwesome"
"FontScripts/GoogleFontAPI"
"FontScripts/Ionicons"
"HostingPanels/Plesk"
"JavaScriptFrameworks/AngularJS"
"JavaScriptFrameworks/Backbone.js"
"JavaScriptFrameworks/Marionette.js"
"JavaScriptFrameworks/Meteor"
"JavaScriptFrameworks/MooTools"
"JavaScriptFrameworks/Prototype"
"JavaScriptFrameworks/React"
"JavaScriptFrameworks/RequireJS"
"JavaScriptFrameworks/TweenMax"
"JavaScriptFrameworks/Vue.js"
"JavaScriptGraphics/Chart.js"
"JavaScriptGraphics/particles.js"
"JavaScriptGraphics/Raphael"
"JavaScriptGraphics/Supersized"
"JavaScriptLibraries/DataTables"
"JavaScriptLibraries/FancyBox"
"JavaScriptLibraries/jQuery"
"JavaScriptLibraries/jQueryMigrate"
"JavaScriptLibraries/jQueryUI"
"JavaScriptLibraries/Lightbox"
"JavaScriptLibraries/Lodash"
"JavaScriptLibraries/Modernizr"
"JavaScriptLibraries/Moment.js"
"JavaScriptLibraries/Polyfill"
"JavaScriptLibraries/prettyPhoto"
"JavaScriptLibraries/script.aculo.us"
"JavaScriptLibraries/scrollreveal"
"JavaScriptLibraries/Select2"
"JavaScriptLibraries/Slick"
"JavaScriptLibraries/Snap.svg"
"JavaScriptLibraries/Underscore.js"
"JavaScriptLibraries/WP-Statistics"
"Maps/GoogleMaps"
"MarketingAutomation/MailChimp"
"MessageBoards/phpBB"
"Miscellaneous/AmazonS3"
"Miscellaneous/Clipboard.js"
"Miscellaneous/Gravatar"
"Miscellaneous/GravityForms"
"Miscellaneous/OracleDynamicMonitoringService"
"Miscellaneous/Revslider"
"Miscellaneous/SWFObject"
"Miscellaneous/Weglot"
"MobileFrameworks/jQuery-pjax"
"MobileFrameworks/jQueryMobile"
"OperatingSystems/CentOS"
"OperatingSystems/Debian"
"OperatingSystems/FreeBSD"
"OperatingSystems/Gentoo"
"OperatingSystems/RedHat"
"OperatingSystems/Ubuntu"
"OperatingSystems/UNIX"
"OperatingSystems/WindowsServer"
"PaaS/AmazonWebServices"
"PaymentProcessors/PayPal"
"PaymentProcessors/Stripe"
"PhotoGalleries/NextGENGallery"
"ProgrammingLanguages/Java"
"ProgrammingLanguages/Lua"
"ProgrammingLanguages/Node.js"
"ProgrammingLanguages/PHP"
"ProgrammingLanguages/Ruby"
"SEO/AllinOneSEOPack"
"SEO/YoastSEO"
"TagManagers/GoogleTagManager"
"VideoPlayers/YouTube"
"WebFrameworks/animate.css"
"WebFrameworks/Bootstrap"
"WebFrameworks/CodeIgniter"
"WebFrameworks/Express"
"WebFrameworks/Laravel"
"WebFrameworks/MicrosoftASP.NET"
"WebFrameworks/RubyonRails"
"WebFrameworks/UIKit"
"WebFrameworks/ZURBFoundation"
"WebServerExtensions/mod_dav"
"WebServerExtensions/mod_ssl"
"WebServerExtensions/OpenSSL"
"WebServers/Apache"
"WebServers/ApacheTrafficServer"
"WebServers/IIS"
"WebServers/LiteSpeed"
"WebServers/Netlify"
"WebServers/Nginx"
"WebServers/OpenGSE"
"WebServers/OpenResty"
"WebServers/PhusionPassenger"
"Widgets/AddThis"
"Widgets/Facebook"
"Widgets/FlexSlider"
"Widgets/GooglePlus"
"Widgets/OWLCarousel"
"Widgets/Pinterest"
"Widgets/ShareThis"
"Widgets/Twitter"

"medfordroofers.com","JavaScriptLibraries/jQueryMigrate","WebServers/Nginx","PhotoGalleries/NextGENGallery","CMS/WordPress",
   "SEO/YoastSEO","WebFrameworks/animate.css","WebFrameworks/Bootstrap","FontScripts/GoogleFontAPI","ProgrammingLanguages/PHP",
   "Databases/MySQL","Miscellaneous/Revslider","FontScripts/FontAwesome","Analytics/GoogleAnalytics"

"<link[^>]* href=[\\'\"][^']+revslider[/\\w-]+\\.css\\?ver=([0-9.]+)[\\'\"]\\;version:\\1"
<link rel='stylesheet' id='rs-plugin-settings-css'  href='https://pricemyroof.com/wp-content/plugins/revslider/public/assets/css/settings.css?ver=5.4.8.2' type='text/css' media='all' />*/

/*
BBC:
[] Optimizely
        "Optimizely": {
            "cats": [
                10
            ],
            "icon": "Optimizely.png",
            "js": {
                "optimizely": ""
            },
            "script": "optimizely\\.com.*\\.js",
            "website": "https://www.optimizely.com"
        },

[] AT Internet Analyzer
        "AT Internet Analyzer": {
            "cats": [
                10
            ],
            "icon": "AT Internet.png",
            "js": {
                "ATInternet": "",
                "xtsite": ""
            },
            "website": "http://atinternet.com/en"
        },

[] Chartbeat
        "Chartbeat": {
            "cats": [
                10
            ],
            "icon": "Chartbeat.png",
            "js": {
                "_sf_async_config": "",
                "_sf_endpt": ""
            },
            "script": "chartbeat\\.js",
            "website": "http://chartbeat.com"
        },

[] Google Analytics
         *******  maybe from an "implies" rule
        "Google Analytics": {
            "cats": [
                10
            ],
            "cookies": {
                "__utma": "",
                "_ga": "",
                "_gat": ""
            },
            "icon": "Google Analytics.svg",
            "html": "<amp-analytics [^>]*type=[\"']googleanalytics[\"']",
            "js": {
                "GoogleAnalyticsObject": "",
                "gaGlobal": ""
            },
            "script": "google-analytics\\.com\\/(?:ga|urchin|analytics)\\.js",
            "website": "http://google.com/analytics"
        },

[] RequireJS2.3.2
           "RequireJS": {
            "cats": [
                12
            ],
            "icon": "RequireJS.png",
            "js": {
                "requirejs.version": "^(.+)$\\;version:\\1"
            },
            "script": "require.*\\.js",
            "website": "http://requirejs.org"
        },

[x] Apache
        "Apache": {
            "cats": [
                22
            ],
            "headers": {
                "Server": "(?:Apache(?:$|/([\\d.]+)|[^/-])|(?:^|\\b)HTTPD)\\;version:\\1"
            },
            "icon": "Apache.svg",
            "website": "http://apache.org"
        },

[x] Varnish
        "Varnish": {
            "cats": [
                23
            ],
            "headers": {
                "Via": "varnish(?: \\(Varnish/([\\d.]+)\\))?\\;version:\\1",
                "X-Varnish": "",
                "X-Varnish-Action": "",
                "X-Varnish-Age": "",
                "X-Varnish-Cache": "",
                "X-Varnish-Hostname": ""
            },
            "icon": "Varnish.svg",
            "website": "http://www.varnish-cache.org"
        },

[] Google Tag Manager
        "Google Tag Manager": {
            "cats": [
                42
            ],
            "html": [
                "googletagmanager\\.com/ns\\.html[^>]+></iframe>",
                "<!-- (?:End )?Google Tag Manager -->"
            ],
            "icon": "Google Tag Manager.png",
            "js": {
                "google_tag_manager": "",
                "googletag": ""
            },
            "website": "http://www.google.com/tagmanager"
        },

[] Modernizr
        "Modernizr": {
            "cats": [
                59
            ],
            "icon": "Modernizr.svg",
            "js": {
                "Modernizr._version": "^(.+)$\\;version:\\1"
            },
            "script": [
                "([\\d.]+)?/modernizr(?:.([\\d.]+))?.*\\.js\\;version:\\1?\\1:\\2"
            ],
            "website": "https://modernizr.com"
        },

[] jQuery1.9.1
        "jQuery": {
            "cats": [
                59
            ],
            "icon": "jQuery.svg",
            "js": {
                "jQuery.fn.jquery": "([\\d.]+)\\;version:\\1"
            },
            "script": [
                "jquery[.-]([\\d.]*\\d)[^/]*\\.js\\;version:\\1",
                "/([\\d.]+)/jquery(?:\\.min)?\\.js\\;version:\\1",
                "jquery.*\\.js(?:\\?ver(?:sion)?=([\\d.]+))?\\;version:\\1"
            ],
            "website": "https://jquery.com"
        },

js:
    AT Internet Analyzer
    Chartbeat
    Google Analytics
    Google Tag Manager
    jQuery1.9.1
    Modernizr
    Optimizely
    RequireJS2.3.2
    Apache
    Varnish


Go:
  "techs": [
ok    "JavaScriptFrameworks/RequireJS",
ok    "JavaScriptLibraries/Modernizr",
ok    "CacheTools/Varnish",
XXX    "CMS/WordPress",
XXX    "ProgrammingLanguages/PHP",
XXX    "Databases/MySQL",
ok    "WebServers/Apache",
XXX    "JavaScriptFrameworks/React"
  ],
  Go misses:
    - AT Internet Analyzer (though I don't see the refs in the static js, so this might be directly from the dom)
    - Chartbeat
    - Google Analytics
    - Google Tag Manager
    - jQuery1.9.1
    - Optimizely

  curr:
      "techs": [
      {
        "category": "Cache Tools",
        "name": "Varnish"
      },
      {
        "category": "Web Servers",
        "name": "Apache"
      }
    ],

*/