Giter Club home page Giter Club logo

social-feed's Introduction

Social-feed

The jQuery plugin which shows user feeds from the most popular social networks.

Demo

http://pavelk2.github.io/social-feed-example/

Social networks supported:

  • Facebook
  • Instagram
  • Twitter
  • Google+
  • VK
  • Pinterest
  • RSS
  • Blogspot

Installation

via http://bower.io:

bower install social-feed

or download the latest release:

https://github.com/pavelk2/social-feed/releases

Getting started

Load dependency CSS:

<!-- Social-feed css -->
<link href="bower_components/social-feed/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">

Create a container for your feed:

<div class="social-feed-container"></div>

Load dependency javascript

<!-- 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 -->
<script src="bower_components/doT/doT.min.js"></script>
<!-- Moment.js for showing "time ago" and/or "date"-->
<script src="bower_components/moment/min/moment.min.js"></script>
<!-- Moment Locale to format the date to your language (eg. italian lang)-->
<script src="bower_components/moment/locale/it.js"></script>
<!-- Social-feed js -->
<script src="bower_components/social-feed/js/jquery.socialfeed.js"></script>

Initialize the social-feed plugin:

<script>
    $(document).ready(function(){
        $('.social-feed-container').socialfeed({
            // INSTAGRAM
            instagram:{
                accounts: ['@teslamotors','#teslamotors'],  //Array: Specify a list of accounts from which to pull posts
                limit: 2,                                    //Integer: max number of posts to load
                client_id: 'YOUR_INSTAGRAM_CLIENT_ID',       //String: Instagram client id (optional if using access token)
                access_token: 'YOUR_INSTAGRAM_ACCESS_TOKEN' //String: Instagram access token
            },

            // GENERAL SETTINGS
            length:400                                      //Integer: For posts with text longer than this length, show an ellipsis.
        });
    });
</script>

When you run the plugin, make sure that you have your webserver running

To alter the default post markup, edit template.html or pass a template string into the template_html parameter.

##All Settings

Social-feed.js supports many social networks. If you don't need or want to pull data from them all, remove the ones you don't need.

$('.social-feed-container').socialfeed({
    // FACEBOOK
    facebook:{
        accounts: ['@teslamotors','!teslamotors'],  //Array: Specify a list of accounts from which to pull wall posts
        limit: 2,                                   //Integer: max number of posts to load
        access_token: 'YOUR_FACEBOOK_ACCESS_TOKEN'  //String: "APP_ID|APP_SECRET"
    },

    // TWITTER
    twitter:{
        accounts: ['@spacex'],                       //Array: Specify a list of accounts from which to pull tweets
        limit: 2,                                    //Integer: max number of tweets to load
        consumer_key: 'YOUR_CONSUMER_KEY',           //String: consumer key. make sure to have your app read-only
        consumer_secret: 'YOUR_CONSUMER_SECRET_KEY', //String: consumer secret key. make sure to have your app read-only
        tweet_mode: 'compatibility'                  //String: change to "extended" to show the whole tweet
     },

    // VK
    vk:{
        accounts: ['@125936523','#teslamotors'],    //Array: Specify a list of accounts from which to pull posts
        limit: 2,                                   //Integer: max number of posts to load
        source: 'all'                               //String: VK API post filter. Possible values: "Owner","Others","all","suggests"
    },

    // GOOGLEPLUS
    google:{
         accounts: ['#teslamotors'],                //Array: Specify a list of accounts from which to pull posts
         limit: 2,                                  //Integer: max number of posts to load
         access_token: 'YOUR_GOOGLE_PLUS_ACCESS_TOKEN'//String: G+ access token
     },

    // INSTAGRAM
    instagram:{
        accounts: ['@teslamotors','#teslamotors'],  //Array: Specify a list of accounts from which to pull posts
        limit: 2,                                   //Integer: max number of posts to load
        client_id: 'YOUR_INSTAGRAM_CLIENT_ID',       //String: Instagram client id (option if using access token)
        access_token: 'YOUR_INSTAGRAM_ACCESS_TOKEN' //String: Instagram access token
    },

    // PINTEREST

    pinterest:{
        accounts: ['@teslamotors/model-s','@me'],   //Array: Specify a list of accounts from which to pull posts
                                                    //@me to pull your pins
                                                    //@user/board to pull pins from a user board
        limit: 2,                                   //Integer: max number of posts to load
        access_token: 'YOUR_PINTEREST_ACCESS_TOKEN' //String: Pinterest client id
    },

    // RSS

    rss:{
        urls: ['http://teslapodcast.libsyn.com/rss'], //Array: Specifiy a list of rss feed from which to pull posts
        limit: 2                                      //Integer: max number of posts to load for each url
    }

    // GENERAL SETTINGS
    length:400,                                     //Integer: For posts with text longer than this length, show an ellipsis.
    show_media:true,                                //Boolean: if false, doesn't display any post images
    media_min_width: 300,                           //Integer: Only get posts with images larger than this value
    update_period: 5000,                            //Integer: Number of seconds before social-feed will attempt to load new posts.
    template: "bower_components/social-feed/template.html",                         //String: Filename used to get the post template.
    template_html:                                  //String: HTML used for each post. This overrides the 'template' filename option
    '<article class="twitter-post"> \
    <h4>{{=it.author_name}}</h4><p>{{=it.text}}  \
    <a href="{{=it.link}}" target="_blank">read more</a> \
    </p> \
    </article>',
    date_format: "ll",                              //String: Display format of the date attribute (see http://momentjs.com/docs/#/displaying/format/)
    date_locale: "en",                              //String: The locale of the date (see: http://momentjs.com/docs/#/i18n/changing-locale/)
    moderation: function(content) {                 //Function: if returns false, template will have class hidden
        return  (content.text) ? content.text.indexOf('fuck') == -1 : true;
    },
    callback: function() {                          //Function: This is a callback function which is evoked when all the posts are collected and displayed
        console.log("All posts collected!");
    }
});

Dependencies

Ordering / sorting

Please note, when using a custom template, that the ordering mechanism depends on the dt-create attribute.

License

MIT

Issues

Found a bug or want a feature to be implemented? Please report it here https://github.com/pavelk2/social-feed/issues

Currently we work on server side: (https://github.com/pavelk2/social-feed-server)

Let us know

If you use this plugin, please write us a short message with a link to the project where you embed the plugin, and some features you want to have implemented here. It helps us to stay focused on the important issues. It is not mandatory, but we really appreciate it!

Do you want to become a part of the Social-feed? Write us and become an active contributor.

Join the chat at https://gitter.im/pavelk2/social-feed

social-feed's People

Contributors

angelistaa avatar annorax avatar cabaret avatar chirikov avatar conrex avatar der-lukas avatar foozzi avatar gitter-badger avatar hartlarsson avatar inhumanitas avatar martijngastkemper avatar mmcev106 avatar pavelk2 avatar robertsass avatar rogeriopradoj avatar sahandissanayake avatar shadownetx avatar tiptronic avatar webarkitekt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

social-feed's Issues

Not working

I have tried the demo, but its not working.

Twitter API 1.1

Are u planning to migrate to the new Twitter API 1.1? 'cause the 1.0 will be deprecated by end of this month :(

Cheers

Clean up

Clean js, css (unnecessary repeats), reduce icon sizes

Callback function

If there are no any messages for some account - callback function will not be triggered

display post from the wall only and not activity

Hi pavelk2!,
fisrt of all, thanks for this great plugin, works pretty well!

In the facebook part ....is there a way to show the wall post only?... right now are displaying all the activity in the fanpage and we need, for now, to display the post made it by the owner and nothing else.

thanks so much!

Twitter: Time on Firefox

Hi, great plugin!

I found a small bug but this is maybe related to "moment.min.js" - On Firefox when displaying tweets it always says "a few seconds ago" even if the tweet has been posted 2 days ago. When viewing the same page in Chrome or IE the correct date appears. Is this a known bug?

Thanks,
Alex M.

Instagram feed not working with username

Instagram photos won't show with username, only with hashtag. There might be a problem getting the user id from username. Works when using the numeral user id with the getImages function.

Post date

Show the date of the post, add a "muted" class to it

Twitter feeds not always showing

Not sure if this more like codebird.js issue, but seems at the moment Twitter feeds are not retrieved in every page refresh in social feed.

Console is not giving any error, but still Twitter feeds do not show up. It can be even reproduced on your http://pavelk2.github.io/social-feed/ page. Sometimes it shows twitter feeds and then it wont :(

HTML template

Make possible rendering a separate html template for the post

Global succes callback

It would be very nice to have a global success callback when all items are loaded across all social channels.

I'm my example I would like to put the social feed in to the owl carousel: http://owlgraphic.com/owlcarousel/ which only be successfully initialized when all elements are present.

Facebook Pages / User feed not pulled

I've attempted pulling the feed from multiple pages and users.

posts?ids=meteorologistgregdee,steveadamsonkark,ChiefKeithMonahan&limit=5
feed?ids=meteorologistgregdee,steveadamsonkark,ChiefKeithMonahan&limit=5

Although those will work within the graph api explorer, it seems that either users or pages are not working.

Try to get more than 1999 feed details from facebook

$(document).ready(function(){
$('.social-feed-container').socialfeed({
//FACEBOOK--------------------
facebook:{
accounts:['simplepickup'], //usernames or id
limit:8888,
token:'240696342763428|FgHgjfn7wWMNT15ONHP0tVdWm_k' //you can also create an app and put here your 'APP ID|APP SECRET' - it is easier but not safe
},
//GENERAL SETTINGS--------------
length:130,
show_media:true,
callback: function(){
console.log('all posts are collected');
}
});
});

So with this code the plugin must have pulled more than 1 year of feed. But it pulls only upto 3 moths or 300 feed items.

Any reason why ?

Many thanks

Posts with images.

Could you implement displaying images that are in facebook posts. Currently it displays the image info or text relating to the image but not the image.

Undefined

If there is a link in the post, it comes up as undefined

Error on facebook by hashtag

Hi,
I tried your script and there is an error on facebook hashtag.
The returned error is:
"error": {
"message": "(#11) Post search has been deprecated",
"type": "OAuthException",
"code": 11
}

I think your plugin use the version 1.0 of the graph api.
Can you upgrade to the newest version 2.1?

Thank you

add since and until filters in the query of feeds

if your filter is only the number of feeds, there can be case that you "lose" to display some feeds.
the correct way is to filter from a specific time to another (preserving the limit of feeds)

i am working on this and i ll submit any result.

Facebook Issue

Hi Pavel,

Firstly i really like the social feed tool and think it is very useful.

I have tested it on my local machine and it works fine with the Obama example but when i add my own username and token it doesn't work.

Can there be a cache issue? or is there a time delay when a new token is created?

I know the user name and token is correct as when i manually enter the URL the feed gets displayed, if you could please let me know what is causing the issue i would be most grateful.

p.s. here is the URL link of the FB feed to prove the token is correct

https://graph.facebook.com/therakuman/feed?&access_token=240696342763428|FgHgjfn7wWMNT15ONHP0tVdWm_k

/// Update ///

I have now released what the issue was and that instead of putting my username i had to put my first name then a dot and then my last name to pull out the feed.

Can i ask why it will not work with my username??

My username feed is pulling in the correct info where as my name does not but simply show 2 post is it something to do with my Facebook settings? if so can you please advice

comments

hi! does it support comments under posts (buttons, count, etc. )?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.