
// Add model to the application.
window.application.addModel((function( $, application ){
    // I am the profile service class.
	function TwitterFeed(){
		this.twitterAPI = null;
	}
	
	// I initialize the model. I get called once the application starts
	// running. At that point, the DOM is available and all the other model
	// and view classes will have been added to the system.
	TwitterFeed.prototype.init = function(){
		// initialize properties
		this.twitterAPI = 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=neilsoult&count=4&include_rts=true';
	};
	
	// Update profile function
	TwitterFeed.prototype.getFeed = function( onSuccess, onError ){
		var self = this;
		// call the twitter api
		var data = $.getJSON(self.twitterAPI + '&callback=?', function(d){
			onSuccess(d);
		});
	};
	
	// Return a new model class.
	return( new TwitterFeed() );
	
})( jQuery, window.application ));

