<commit_before>angular.module('handd', ['ngRoute'])

.value('wikiUrl', 'http://wiki.hackersanddesigners.nl/mediawiki/api.php')
.filter('unsafe', function($sce) {
  return function(val) {
    return $sce.trustAsHtml(val);
  };
})

/*
.service('Utils', function() {
  var self = this;
  this.cleanLinks = function(html) {
    var el = angular.element(html)
    var links = el.find('a');
    console.log(links);
    for(var i = 0; i < links.length; i++) {
      var href  = angular.element(links[i]).attr('href');
      if(href.indexOf('mediawiki') != -1) {
        var params = href.split('?');
        if(params.length > 1) {
          var keyValues = params[1].split('&');
          for(var j = 0; j < keyValues.length; j++) {
            var keyValue = keyValues[j].split('=');
            if(keyValue[0] == 'title') {
              return '{{ keyValue[1] }}' 
            }
          }
        }
        return 'http://wiki.hackersanddesigners.nl' + href;
      }
      return href;
    }
  };
})
*/

.service('Homepage', function(wikiUrl, $http) {
  var self = this;
  this.fetch = function(callback) {
    $http.get(wikiUrl+'?action=parse&page=Hackers_%26_Designers&format=json').then(function(res) {
      var obj = res.data;
      html = obj.parse.text['*'];
      callback(html);
    });
  };
})

.config(function($routeProvider) {
  $routeProvider
  .when('/', {
    controller:'HomepageController as homepage',
    templateUrl:'homepage.html',
    resolve: {
    }
  })
})

.controller('HomepageController', function(Homepage) {
  var homepage = this;
  Homepage.fetch(function(html) {
    //Utils.cleanLinks(html); 
    homepage.html = html; 
  });
});
        <commit_msg>change to image<commit_after>angular.module('handd', ['ngRoute'])

.value('wikiUrl', 'http://wiki.hackersanddesigners.nl/mediawiki/api.php')
.filter('unsafe', function($sce) {
  return function(val) {
    return $sce.trustAsHtml(val);
  };
})

.service('Homepage', function(wikiUrl, $http) {
  var self = this;
  this.fetch = function(callback) {
    $http.get(wikiUrl+'?action=parse&page=Jeremy_Bailey_ad1&format=json').then(function(res) {
      var obj = res.data;
      html = obj.parse.text['*'];
      callback(html);
    });
  };
})

.config(function($routeProvider) {
  $routeProvider
  .when('/', {
    controller:'HomepageController as homepage',
    templateUrl:'homepage.html',
    resolve: {
    }
  })
})

.controller('HomepageController', function(Homepage) {
  var homepage = this;
  Homepage.fetch(function(html) {
    homepage.html = html; 
  });
});
        
{'fraction_non_alphanumeric': 0.185546875, 'fraction_numerical': 0.00390625, 'mean_word_length': 3.020408163265306, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1228670', 'n_tokens_mistral': 886, 'n_tokens_neox': 868, 'n_words': 136}