<commit_before>'use strict';

angular.module('app.accept', [
  'ui.router',
  'ui.bootstrap'
])

.controller('AcceptModalCtrl', function($scope, $modalInstance, $http, auth, twitter) {
  $scope.twitter_handle = twitter;

  $scope.ok = function(amount) {
    $modalInstance.close();
  };

  $scope.cancel = function() {
    $modalInstance.dismiss('cancel');
  };

  $scope.respond = function(response, youtube) {
    $http.post('/update', {
      status: [response, youtube].join(' ') });
  };

  $scope.nominate = function(youtube, handle1, handle2, handle3) {
    var handles = [handle1, handle2, handle3];
    handles = handles.map(function(handle) {
      if (handle) {
        handle.replace(/^@/, '');
        return '@' + handle;
      }
    });
    handles = handles.join(' ');

    $http.post('https://api.twitter.com/1.1/statuses.update.json', {
      status: [handles, 'You have been challenged!', youtube].join(' ') });
  };
});<commit_msg>Twitter oAuth is a hard time<commit_after>'use strict';

angular.module('app.accept', [
  'ui.router',
  'ui.bootstrap'
])

.controller('AcceptModalCtrl', function($scope, $modalInstance, $http, auth, twitter) {
  $scope.twitter_handle = twitter;

  $scope.ok = function(amount) {
    $modalInstance.close();
  };

  $scope.cancel = function() {
    $modalInstance.dismiss('cancel');
  };

  $scope.respond = function(response, youtube) {
    console.log(auth);
    $http.post('/tweet', {
      status: [response, youtube].join(' '),
      smokeAndMirrors: auth.profile.identities[0].access_token });
  };

  $scope.nominate = function(youtube, handle1, handle2, handle3) {
    var handles = [handle1, handle2, handle3];
    handles = handles.map(function(handle) {
      if (handle) {
        handle.replace(/^@/, '');
        return '@' + handle;
      }
    });
    handles = handles.join(' ');

    $http.post('/tweet', {
      status: [handles, 'You have been challenged!', youtube].join(' '),
      smokeAndMirrors: auth.profile.identities[0].access_token });
  };
});
{'fraction_non_alphanumeric': 0.1891358024691358, 'fraction_numerical': 0.007901234567901235, 'mean_word_length': 3.3852813852813854, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '4851366', 'n_tokens_mistral': 679, 'n_tokens_neox': 655, 'n_words': 116}