var
mention = function( str ) {
return str.replace("/[@]+[A-Za-z0-9-_]+/ig", function( username ) {
- return username.link("http://twitter.com/"+ username.replace("@","") );
+ return username.link("https://twitter.com/"+ username.replace("@","") );
});
},
hashtags = function( str ) {
return str.replace("/[#]+[A-Za-z0-9-_]+/ig", function( tag ) {
- return tag.link("http://search.twitter.com/search?q="+tag.replace("#","%23"));
+ return tag.link("https://search.twitter.com/search?q="+tag.replace("#","%23"));
});
};
// Call Twitter JSONP
- $.getJSON("http://search.twitter.com/search.json?callback=?", query, function(tweets){
+ $.getJSON("https://search.twitter.com/search.json?callback=?", query, function(tweets){
callback(tweets, query, exclusionsExp);
});
};
// Make the avatar, and append it to the $tweet
if ( query.avatar === true ) {
$tweet.append($("<a/>", {
- href: "http://twitter.com/" + tweet.from_user,
+ href: "https://twitter.com/" + tweet.from_user,
html: "<img src='" + tweet.profile_image_url + "'/>"
}));
}
// Make the tweet text, and append it to the $tweet, then to the parent
$tweet.append($("<span>", {
"class": "content",
- html: "<a href='http://twitter.com/" + tweet.from_user + "'>@" + tweet.from_user + "</a>: " + mention(hashtags(linkify(tweet.text)))
+ html: "<a href='https://twitter.com/" + tweet.from_user + "'>@" + tweet.from_user + "</a>: " + mention(hashtags(linkify(tweet.text)))
}))
// Append tweet to the $tweets ul
.appendTo($tweets);