Skip to content

Commit

Permalink
Added flag to dump media galleries.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomayac committed Sep 16, 2014
1 parent 991fe76 commit 5be297a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions mediagallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ if (require('fs').existsSync(__dirname + '/.env')) {
}

var TWEET_BREAKING_NEWS_CANDIDATES = false;
var DUMP_MEDIA_GALLERIES = false;

var twitterRestClient = new Twitter.RestClient(
process.env.MEDIA_GALLERY_API_KEY,
Expand Down Expand Up @@ -523,8 +524,10 @@ var illustrator = {
clusters.sort(illustrator.rankingFormulas.popularity.func);
illustrator.createMediaGallery(mediaItems, clusters, 'strictOrder',
searchTerms, wikipediaUrl, callback);
/*
illustrator.createMediaGallery(mediaItems, clusters, 'looseOrder',
searchTerms, wikipediaUrl, callback);
*/
},

createMediaGallery: function(mediaItems, clusters, algorithm, searchTerms,
Expand Down Expand Up @@ -660,8 +663,10 @@ var illustrator = {
}
}
mediaGallery.style.width = width + 'px';
illustrator.createMediaGalleryDump(mediaItems, divs, width, height,
algorithm, searchTerms, wikipediaUrl);
if (DUMP_MEDIA_GALLERIES) {
illustrator.createMediaGalleryDump(mediaItems, divs, width, height,
algorithm, searchTerms, wikipediaUrl);
}
selectedMediaItems = null;
return callback(container.innerHTML);
}
Expand Down Expand Up @@ -809,7 +814,7 @@ var illustrator = {
mediaGallery.style.height = height + 'px';
var container = document.createElement('div');
container.appendChild(mediaGallery);
if (TWEET_BREAKING_NEWS_CANDIDATES) {
if (DUMP_MEDIA_GALLERIES) {
illustrator.createMediaGalleryDump(mediaItems, divs, width, height,
algorithm, searchTerms, wikipediaUrl);
}
Expand Down

0 comments on commit 5be297a

Please sign in to comment.