<commit_before>/**
 * dubtrack-downvote
 *
 * For more information and installation instructions, please see:
 * https://github.com/ronaldojf/dubtrack-downvote/
 */

// ==UserScript==
// @name         dubtrack-downvote
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  Automatically "downdub" (downvote) tracks after a few seconds.
// @author       <NAME>
// @site         https://github.com/ronaldojf/dubtrack-downvote/
// @match        *://dubtrack.fm/*
// @match        *://www.dubtrack.fm/*
// @grant        unsafeWindow
// @updateURL    https://github.com/ronaldojf/dubtrack-downvote/raw/master/dubtrack-downvote.user.js
// ==/UserScript==

(function($, console, Dubtrack) {
  'use strict';

  $(function() {
    /**
     * AUTO DOWNDUB/DOWNVOTE
     */
    setInterval(function() {
      // Don't do anything if a vote has already been case (i.e. if this song is upvoted as well).
      if ($(".voted").length === 0) $(".dubdown").click();
    }, 5000);
  });

})(unsafeWindow.$, unsafeWindow.console, unsafeWindow.Dubtrack);<commit_msg>Uses event-orientation to vote, and avoids to downvote your own songs<commit_after>/**
 * dubtrack-downvote
 *
 * For more information and installation instructions, please see:
 * https://github.com/ronaldojf/dubtrack-downvote/
 */

// ==UserScript==
// @name         dubtrack-downvote
// @namespace    http://tampermonkey.net/
// @version      1.1.0
// @description  Automatically "downdub" (downvote) tracks after a few seconds.
// @author       <NAME>
// @site         https://github.com/ronaldojf/dubtrack-downvote/
// @match        *://dubtrack.fm/*
// @match        *://www.dubtrack.fm/*
// @grant        none
// @updateURL    https://github.com/ronaldojf/dubtrack-downvote/raw/master/dubtrack-downvote.user.js
// ==/UserScript==

(function($, console, Dubtrack) {
  'use strict';

  $(function() {
    var downvoteOtherPeople = function() {
      if (Dubtrack.loggedIn && $(".voted").length === 0) {
        if (Dubtrack.room.player.activeSong.attributes.user.id === Dubtrack.session.id) {
          Dubtrack.playerController.vote('updub');
        } else {
          Dubtrack.playerController.vote('downdub');
        }
      }
    };

    setTimeout(function() {
      downvoteOtherPeople();
      Dubtrack.Events.bind('realtime:room_playlist-update', downvoteOtherPeople);
    }, 10 * 1000);
  });

})($, console, Dubtrack);
{'fraction_non_alphanumeric': 0.17095435684647303, 'fraction_numerical': 0.007468879668049793, 'mean_word_length': 2.714946070878274, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '4006322', 'n_tokens_mistral': 815, 'n_tokens_neox': 792, 'n_words': 151}