LIVE COVERAGE

Ex-EMCC student charged in fatal stabbing seeks bail

Posted May 13, 2014, at 10:10 a.m.
Last modified May 13, 2014, at 1:21 p.m.

Loading ...

var BdnTwitter1 = new function() {

this.convertDate = function( date ) {

var weekdays = new Array(7);

weekdays[0] = 'Sun';

weekdays[1] = 'Mon';

weekdays[2] = 'Tue';

weekdays[3] = 'Wed';

weekdays[4] = 'Thu';

weekdays[5] = 'Fri';

weekdays[6] = 'Sat';

var months = new Array(12);

months[0] = 'Jan';

months[1] = 'Feb';

months[2] = 'Mar';

months[3] = 'Apr';

months[4] = 'May';

months[5] = 'Jun';

months[6] = 'Jul';

months[7] = 'Aug';

months[8] = 'Sep';

months[9] = 'Oct';

months[10] = 'Nov';

months[11] = 'Dec';

d = new Date( date );

utc = d.getTime();

nd = new Date( utc );

hour = nd.getHours();

am = 'a.m.';

if( hour >= 13 ) {

hour = hour - 12;

am = 'p.m.';

}

minutes = nd.getMinutes();

if( minutes < 10 )

minutes = '0' + minutes;

return weekdays[ nd.getDay() ] + ' ' + months[ nd.getMonth() ] + ' ' + nd.getDate() + ', ' + nd.getFullYear() + ' at ' + hour + ":" + minutes + ' ' + am;

}

this.poll = function( twitterHandle, date, hashTag ) {

var url = '//bangordailynews.com/?feed=gettwitter&user=' + twitterHandle + '&q';

if( hashTag ) {

url += '=' + hashTag;

}

jQuery.getJSON( url,

function( data ){

var content = '

';

if( data['user'] ) {

content += '

';

content += '

';

content += '

';

content += '

';

content += '

';

content += '

' + data['user'].description + '

';

content += '

';

}

var data = data[ 'results' ];

for( i in data ) {

var newDate = BdnTwitter1.convertDate( data[i].created_at );

if( date == 'false' || newDate.substring( 0, 10 ) == date ) {

if( !data[ 'user' ] ) {

content += '

';

}

content += '

' + data[i].text + '

';

if( data[i].entities.media ) {

for( m in data[i].entities.media ) {

if( data[i].entities.media[m].type == 'photo' ) {

content += '

';

}

if( data[i].entities.media[m].type == 'video' && data[i].entities.media[m].embed ) {

content += '

' + data[i].entities.media[m].embed + '

';

}

}

}

content += '

';

content += '

';

content += '

';

}

}

content += '

';

jQuery( '#bdn-twitter-widget1' ).html( content );

}

);

}

this.init = function( twitterHandle, date, hashTag ) {

BdnTwitter1.poll( twitterHandle, date, hashTag ); }

}

BdnTwitter1.init( 'harrisonbdn', 'Tue May 13', '' );

Feed will update automatically

SEE COMMENTS →