(function (env) {
    "use strict";
    
    env.ddg_spice_gulp = function(api_result) {
        
        if (!api_result || !api_result.total) {
            return Spice.failed('gulp');
        }

        // Get the original query sans the trigger words.
        var script = $('[src*="/js/spice/gulp/"]')[0],
            source = $(script).attr("src"),
            query = source.match(/gulp\/([^\/]*)/)[1];
        
        var query_re = new RegExp(query, 'i');
        
        DDG.require('moment.js', function() {
            Spice.add({
                id: "grunt",
                name: "Gulp Plugins",
                data: api_result.results,
                meta: {
                    sourceName: 'Gulp',
                    // We can't link to the actual query since filtering is all done on 
                    // the front-end as well.
                    sourceUrl: 'http://gulpjs.com/plugins/'
                },
                normalize: function(item) {
                    // Make sure we have everything we need.
                    if(!item.name.length || !item.version.length || !item.keywords.length ||
                       !item.description.length || !item.rating.length || !item.modified.length) {
                        return;
                    }
                    item.license = item.license || [];
                    
                    
                    // Make sure that the query even exists in the name or description.
                    if(!query_re.test(item.name[0]) && !query_re.test(item.description[0]) && 
                       !query_re.test(item.keywords.toString())) {
                        return;
                    }
                    
                    return {
                        title: item.name[0] + ' ' + item.version[0],
                        subtitle: item.author.join(', ') || ' ',
                        description: item.description[0],
                        url: 'https://www.npmjs.com/package/' + item.name[0],
                        licenses: item.license.join(', ') || '',
                        time: moment(item.modified[0], "YYYYMMDD").fromNow()
                    };
                },
                templates: {
                    group: 'text',
                    detail: false,
                    item_detail: false,
                    variants: {
                        tile: 'basic1',
                        tileTitle: '1line',
                        tileFooter: '2line',
                        tileSnippet: 'large'
                    },
                    options: {
                        moreAt: true,
                        footer: Spice.gulp.footer
                    }
                }
            });
        });
    };
}(this));

@@ -564,12 +564,11 @@
 : %22g
-runt
+ulp
 %22,%0A 
@@ -593,20 +593,16 @@
 e: %22
-Gulp Plugins
+Software
 %22,%0A 
@@ -1325,17 +1325,16 @@
 e %7C%7C %5B%5D;
-%0A
         

Correct the ID