0.1.24 • Published 10 years ago

social-feed v0.1.24

Weekly downloads
28
License
-
Repository
-
Last release
10 years ago

Social Feed

Aggregates data from multiple social feeds

Configuration

Create a config.js file that looks like the following:

module.exports={
    twitter:{
        path:'/1.1/statuses/user_timeline.json?screen_name=screenName',
        clientId:'clientIdclientId',
        clientSecret:'clientSecretclientSecretclientSecret'
    },
    facebook:{
        appID:'appID',
        appSecret:'appSecret',
        path:'/someusername/feed',
        accessToken:'facebookAccessToken'
    },
    youtube:{
        url:'/feeds/api/users/someUser/uploads?v=2&alt=json'
    },
    flickr:{
        consumerKey : 'consumerKey',
        consumerrecret : 'consumerSecret',
        userId : 'userId',
        userKey : 'userKey',
        userSecret : 'userSecret'
    },
    blog:{
        host:'domain.com',
        path:'/feeds/posts/default?alt=json'
    }
};

SocketIO example

On the server...

var io = require('socket.io').listen(3031,{log:false});
var feeds = require('social-feeds'), feed={};

feeds.getFeeds(feed);
setInterval(function(){
    feeds.getFeeds(feed);
}, 5000);

io.sockets.on('connection', function (socket) {
    socket.on('refreshRequested', function (data) {
        socket.emit('feedUpdate', feed);
    });
    setInterval(function() {
        socket.emit('feedUpdate', feed);
    }, 5000 );
});

And on the client...

<script src="http://127.0.0.1:3031/socket.io/socket.io.js"></script>
<script>
    var socket = io.connect('http://localhost:3031');
    socket.on('feedUpdate', function (data) {
        console.log(data);
    });
</script>
0.1.24

10 years ago

0.1.23

10 years ago

0.1.21

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.0.2

10 years ago

0.1.0

11 years ago