Skip to content
Moling Guo edited this page Apr 29, 2016 · 5 revisions

Many trucks post updated information on their social media account rather than their websites, so we integrate major social media feeds to our project, but without using the widget styles as we researched in last semester. Instead, We customize the style to make sure they have consistent feeling as our app.

###Twitter There are two places we use twitter feeds, one is the timeline widget to show latest update for each individual truck twitter account.
screenshot 2016-04-29 01 49 17

The other one is a single tweet shown as a quote about a truck, this one is more complicated to implement, which requests the original embedded HTML format from Twitter API, and then use REGEX to remove extra brackets we don't need to clean up the HTML, so we only keep the text and strip out any format and images.

$scope.embedQuote = function(url) {
    	TwitterAPI.get({ 
    		url: url,
    		hide_thread: true,
			hide_media: true,
			omit_script: true,
			align: 'center'
		}, function(data) {
			var rawdata = data.html;
			rawdata = rawdata.replace(/<blockquote[^>]*>?/g, '');
			rawdata = rawdata.replace(/<\/blockquote>/g, '');
			$scope.twitter_embeds.push($sce.trustAsHtml(rawdata));
		});
  	};

screenshot 2016-04-29 01 53 49

Resource:
Twitter API
Twitter Timeline Widget

###Instagram We decided to use Instansive widget because it provides many customization as we need, the only trouble was in March, during our user testing period, Instansive had changed to Lightwidget which took us sometime to figure this out.
screenshot 2016-04-26 00 15 06
Resource: lightwidget

###General And we have a section to link all major social media accounts.
screenshot 2016-04-26 00 32 42

Clone this wiki locally