<commit_before>'use strict';

angular.module('grabbagApp')
  .controller('MainCtrl', function ($scope, $http, socket) {
    $scope.awesomeThings = [];

    $http.get('/api/things').success(function(awesomeThings) {
      $scope.awesomeThings = awesomeThings;
      socket.syncUpdates('thing', $scope.awesomeThings);
    });

    $scope.addThing = function() {
      if($scope.newThing === '') {
        return;
      }
      $http.post('/api/things', { name: $scope.newThing });
      $scope.newThing = '';
    };

    $scope.deleteThing = function(thing) {
      $http.delete('/api/things/' + thing._id);
    };

    $scope.$on('$destroy', function () {
      socket.unsyncUpdates('thing');
    });


    $http({
      method: 'GET',
      url: 'http://access.alchemyapi.com/calls/text/TextGetTextSentiment?apikey=6c3f7de7adae065674ccce9289e1a2930fc4c74f',
      params: {
        text: 'Fuck you motherfucker',
        outputMode: 'json',
        showSourceText: 1
        }
      }).
      success(function (data, status, headers, config) {
        console.log("GET request was successful!");
        console.log(data);

        // var events = data.events;
        // var lats = [];
        // var lons = [];
        // var coordinates = [];
        // for (var i=0; i < events.length; i++) {
        //   if (events && events[i] && events[i].venue) {
        //     var venue = events[i].venue;
        //     var address = venue.address;
        //     var lat = address.latitude;
        //     var lon = address.longitude;
        //     lats.push(lat);
        //     lons.push(lon);
        //     coordinates.push(new google.maps.LatLng(lat, lon));
        //   }
        // }<commit_msg>Remove apiKey from actual URL<commit_after>'use strict';

angular.module('grabbagApp')
  .controller('MainCtrl', function ($scope, $http, socket) {
    $scope.awesomeThings = [];

    $http.get('/api/things').success(function(awesomeThings) {
      $scope.awesomeThings = awesomeThings;
      socket.syncUpdates('thing', $scope.awesomeThings);
    });

    $scope.addThing = function() {
      if($scope.newThing === '') {
        return;
      }
      $http.post('/api/things', { name: $scope.newThing });
      $scope.newThing = '';
    };

    $scope.deleteThing = function(thing) {
      $http.delete('/api/things/' + thing._id);
    };

    $scope.$on('$destroy', function () {
      socket.unsyncUpdates('thing');
    });


    $http({
      method: 'GET',
      url: 'http://access.alchemyapi.com/calls/text/TextGetTextSentiment',
      params: {
        apikey : '6c3f7de7adae065674ccce9289e1a2930fc4c74f',
        text: 'Fuck you motherfucker',
        outputMode: 'json',
        showSourceText: 1
        }
      }).
      success(function (data, status, headers, config) {
        console.log("GET request was successful!");
        console.log(data);

        // var events = data.events;
        // var lats = [];
        // var lons = [];
        // var coordinates = [];
        // for (var i=0; i < events.length; i++) {
        //   if (events && events[i] && events[i].venue) {
        //     var venue = events[i].venue;
        //     var address = venue.address;
        //     var lat = address.latitude;
        //     var lon = address.longitude;
        //     lats.push(lat);
        //     lons.push(lon);
        //     coordinates.push(new google.maps.LatLng(lat, lon));
        //   }
        // }
{'fraction_non_alphanumeric': 0.1715786402100963, 'fraction_numerical': 0.014006419608987453, 'mean_word_length': 2.007017543859649, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6520288', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1084, 'n_words': 184}