ribbeldippel / add search link for mygully.com (watchlist)

// ==UserScript==
// @name         add search link for mygully.com (watchlist)
// @description  trakt.tv
// @version      0.0.1
// @icon         http://www.google.com/s2/favicons?domain=www.trakt.tv
// @license      MIT
// @require      https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js
//
// @include      http://trakt.tv/user/*/watchlist/shows/released*
// ==/UserScript==

(function () {

    'use strict';

    var shows = $('.library-show');

    $.each(shows, function (index, show) {
        var title = $(show).find('.title').text().replace(' ', '+');
        $(show).find('.title').on('click', function (e) {
            e.stopImmediatePropagation();
            e.preventDefault();
            window.open('http://mygully.com/search.php#' + title, title);
        });

    });

})();