티스토리 뷰

웹개발/Javascript

Twitter jQuery

yaku 2012. 3. 5. 15:14
= 3 ) && setTimeout(function() {
				self.query = input.value;
				$.publish( 'twitter/query' );
			}, 400);
		},

		fetchJSON: function() {
			var url = 'http://search.twitter.com/search.json?callback=?&q=';

			return $.getJSON( url + Twitter.query, function( data ) {
				Twitter.tweets = data.results;
				$.publish( 'twitter/results' );
			});
		},

		renderResults: function() {
			var self = Twitter,
				frag = [],
				tweet;

			self.container.html(
				$.map( self.tweets, function( obj, index ) {
					var t =
						obj.text.replace(/(http:[^\s]+)/, '$1')
								.replace(/@([^\s:]+)/, '@$1');

					return self.template.replace(/{{tweet}}/, t);
				}).join('')
			);
		}
	};

	window.Twitter = Twitter.init();

})(jQuery);
댓글
D-DAY
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함