Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function addTweet(tweet) {
// Reject tweets with media.
if (tweet.extended_entities && tweet.extended_entities.media.length > 0) {
return;
}
// Parse emoji.
tweet.text = twemoji.parse(tweet.text);
// Highlight the #SGDQ2016 hashtag.
tweet.text.replace(/(#sgdq2016)/ig, '<span class="hashtag">#SGDQ2016</span>');
// Add the tweet to the list
tweets.value.push(tweet);
}
function addTweet(tweet) {
// Reject tweets with media.
if (tweet.extended_entities && tweet.extended_entities.media.length > 0) {
return;
}
// Don't add the tweet if we already have it
const isDupe = tweets.value.find(t => t.id_str === tweet.id_str);
if (isDupe) {
return;
}
// Parse emoji.
tweet.text = twemoji.parse(tweet.text);
// Highlight the #SGDQ2016 hashtag.
tweet.text = tweet.text.replace(/#sgdq2016/ig, '<span class="hashtag">#SGDQ2016</span>');
// Add the tweet to the list
tweets.value.push(tweet);
}
function addTweet(tweet) {
// Don't add the tweet if we already have it
const isDupe = tweets.value.find((t) => t.id_str === tweet.id_str) ||
fanartTweets.value.find((t) => t.id_str === tweet.id_str);
if (isDupe) {
return;
}
// Parse emoji.
tweet.text = twemoji.parse(tweet.extended_tweet ? tweet.extended_tweet.full_text : tweet.text);
// Replace newlines with spaces
tweet.text = tweet.text.replace(/\n/ig, ' ');
// Highlight the #SGDQ2018 hashtag.
tweet.text = tweet.text.replace(/#sgdq2018/ig, '<span class="hashtag">#SGDQ2018</span>');
if (tweet.extended_tweet &&
tweet.extended_tweet.extended_entities &&
tweet.extended_tweet.extended_entities.media &&
tweet.extended_tweet.extended_entities.media.length > 0) {
tweet.gdqMedia = tweet.extended_tweet.extended_entities.media;
delete tweet.extended_tweet.extended_entities.media;
}
else if (tweet.extended_entities &&
tweet.extended_entities.media &&
tweet.extended_entities.media.length > 0) {
tweet.gdqMedia = tweet.extended_entities.media;
delete tweet.extended_entities.media;
function reveal (data) {
console.info('You can play with your data now, it\'s accessible in window.data');
console.info(data);
console.table(data.most.starred, 'name homepage stargazers_count forks_count open_issues'.split(' '));
root.data = data;
$('.oh-header').html(compile('oh_header', data));
$('.ot-sidebar').html(compile('ot_sidebar', data));
$('.ot-description').html(compile('ot_description', data));
$('.ot-repos').html(compile('ot_repos', data));
twemoji.parse(document.body);
document.body.classList.add('hy-reveal');
}
function countEmojis(emoji) {
let count = 0;
twemoji.parse(emoji.char, d => {
count += d.split('-').length;
});
return count;
}
getHtml(){
return twemoji.parse(
emojione.shortnameToUnicode(
marked(this.getContent())
)
);
}
return function (res, status, xhr) {
if (status < 200 || status >= 300) {
xhrcontainer.classList.add('ve-show');
xhrmessage.txt($.format('(%s) %s', status, res && res.message ? res.message : 'Unknown Error'));
if (res && res.documentation_url) {
xhrdocumentation.attr('href', res.documentation_url);
xhrdocumentation.txt(res.documentation_url);
xhrdocumentation.html(xhrdocumentation.html() + twemoji.parse(' 😡'));
xhrdocumentation.classList.add('ve-show');
} else {
xhrdocumentation.attr('href', null);
xhrdocumentation.classList.remove('ve-show');
}
} else {
then(res, status, xhr);
}
};
}
md.renderer.rules.emoji = function(token, idx) {
return twemoji.parse(token[idx].content);
};
md.renderer.rules.emoji = (token, idx) => twemoji.parse(token[idx].content)