bower install social-feed
<!-- Social-feed css --> <link href="css/jquery.socialfeed.css" rel="stylesheet" type="text/css"> <!-- font-awesome for social network icons --> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<div class="social-feed-container"></div>
<!-- jQuery --> <script src="bower_components/jquery/dist/jquery.min.js"></script> <!-- Codebird.js - required for TWITTER --> <script src="bower_components/codebird-js/codebird.js"></script> <!-- doT.js for rendering templates and moment.js for showing time ago --> <script src="bower_components/doT/doT.min.js"></script> <script src="bower_components/moment/min/moment.min.js"></script> <!-- Social-feed js --> <script src="js/jquery.socialfeed.js"></script>
<script> $(document).ready(function(){ $('.social-feed-container').socialfeed({ // FACEBOOK facebook:{ accounts: ['@teslamotors','#teslamotors'], limit: 2, access_token: 'YOUR_FACEBOOK_ACCESS_TOKEN' // APP_ID|APP_SECRET }, // TWITTER twitter:{ accounts: ['@spacex'], limit: 2, consumer_key: 'YOUR_CONSUMER_KEY', // make sure to have your app read-only consumer_secret: 'YOUR_CONSUMER_SECRET_KEY', // make sure to have your app read-only }, // VK vk:{ accounts: ['@125936523','#teslamotors'], limit: 2, source: 'all' }, // GOOGLEPLUS google:{ accounts: ['#teslamotors'], limit: 2, access_token: 'YOUR_GOOGLE_PLUS_ACCESS_TOKEN' }, // INSTAGRAM instagram:{ accounts: ['@teslamotors','#teslamotors'], limit:2, client_id: 'YOUR_INSTAGRAM_CLIENT_ID' }, // GENERAL SETTINGS length:400, show_media:true, // Moderation function - if returns false, template will have class hidden moderation: function(content){ return (content.text) ? content.text.indexOf('fuck') == -1 : true; }, //update_period: 5000, // When all the posts are collected and displayed - this function is evoked callback: function(){ console.log('all posts are collected'); } }); }); </script>
Source: https://habr.com/ru/post/239275/
All Articles