<file_sep>/**
 * Mozaïk EXT_NAME widgets sample config.
 */
require('dotenv').load();


const config = {
    env:  'prod',

    host:             '0.0.0.0',
    port:             process.env.PORT || 5000,
    useWssConnection: process.env.USE_SSL === 'true',

    theme: 'night-blue',

    api: {},

    rotationDuration: 10000,

    dashboards: [
        {
            columns: 3,
            rows:    2,
            widgets: [
                // Add widgets here
                {
                    type: 'twitter.twitter',
                    columns: 2, rows: 2,
                    x:0, y:1
                }
            ]
        }
    ]
}


module.exports = config
<file_sep># Mozaïk *twitter* extension demo [DEMO][demo-url]

This branch contains a sample demo to showcase `twitter` widgets.

[demo-url]: https://mozaik-twitter.herokuapp.com/
<file_sep>import convict from 'convict';


const config = convict({
    feed: {
	user: {
	    doc:     'The users feed to display',
	    default: 'ATT',
	    format:  String,
	    env:     'TWITTER_USER'
	},
	consumer_key: {
	    doc:     'The twitter consumer key',
            default: 'Ff59XqlhcZ2s3PdLcBu9BD6de',
            format:  String,
            env:     'TWITTER_CONSUMER_KEY'
	},
	consumer_secret: {
	    doc:     'The twitter consumer secret',
            default: '<KEY>',
            format:  String,
            env:     'TWITTER_CONSUMER_SECRET'
	},
	access_token_key: {
	    doc:     'The twitter token key',
            default: '<KEY>',
            format:  String,
            env:     'TWITTER_TOKEN_KEY'
	},
	access_token_secret: {
	    doc:     'The twitter token secret',
            default: '<KEY>',
            format:  String,
            env:     'TWITTER_TOKEN_SECRET'
	}
    }
});


export default config;
<file_sep>Interacts with the twitter API to display tweets
<file_sep>const gulp = require('gulp')
const _    = require('lodash')

// load mozaïk module tasks
_.forOwn(require('mozaik/gulpfile').tasks, task => {
    gulp.task(task.name, task.dep, task.fn)
})
<file_sep>import Feed from './Feed.jsx';


export default {
    Feed
};
<file_sep>import Promise from 'bluebird';
import config from './config';

var Twitter = require('twitter');

var user_feed = new Twitter({
  consumer_key: 'Ff59XqlhcZ2s3PdLcBu9BD6de',
  consumer_secret: '<KEY>',
  access_token_key: '<KEY>',
  access_token_secret: '<KEY>'
});


/**
 *  * @param {Mozaik} mozaik
 *   */
const client = mozaik => {
    mozaik.loadApiConfig(config);

    const params = {screen_name: 'desmondmorris'};
    user_feed.get('statuses/user_timeline', params)
      .then(console.log)
      .catch(console.error)
    return {
	twitter() {
	    const def = Promise.defer();
	    mozaik.logger.info(chalk.yellow(`[travis] calling repository: ${owner}/${repository}`));
	    travis.repos(owner, repository).get((err, res) => {
                if (err) {
                    def.reject(err);
                }

                def.resolve(res.repo);
            });

            return def.promise;
	}
    }
}
//const client = new Twitter({
//  consumer_key: process.env.TWITTER_CONSUMER_KEY,
//  consumer_secret: process.env.TWITTER_CONSUMER_SECRET,
//  access_token_key: process.env.TWITTER_ACCESS_TOKEN_KEY,
//  access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET
//})

export default client;
<file_sep>import React    from 'react'
import Mozaik   from 'mozaik/browser'
import twitter from 'mozaik-ext-twitter'


const MozaikComponent = Mozaik.Component.Mozaik
const ConfigActions   = Mozaik.Actions.Config

Mozaik.Registry.addExtensions({ twitter })

React.render(<MozaikComponent/>, document.getElementById('mozaik'))

ConfigActions.loadConfig()
