pavelk2 / social-feed

JavaScript plugin that shows a user feed from the most popular social networks
http://pavelk2.github.io/social-feed-example/
MIT License
963 stars 304 forks source link

Known Issues and how to fix them #350

Open snyoz opened 5 years ago

snyoz commented 5 years ago

Hey Guys, during my development process with the project I came across several problems. I want to summarize a few fixes for you because this repo is great but not maintained anymore. These fixes can be a real time saver for you.

Twitter Loading in Slowly You can fix that by making use of another proxy script. kierweb helped us in several posts: "you'll need to use the 'Codebird-Cors-Proxy https://github.com/jublonet/codebird-cors-proxy'. Download the repo into a directory on your website .... and then in your jquery running socialfeed add proxy: "<path to codebird-cors-proxy-directory" to the twitter bit."

then use it like this: 
$('#socialfeed').socialfeed({
twitter:{
proxy: "https://path-to-your-domain.com/codebird-proxy/",
accounts: ['@...],
limit: 6,
consumer_key: '...',
consumer_secret: '...'
},
show_media: true,
length:240
});

(!) For me it only worked when I used an absolute path to the proxy configuration. (!) Downside of this proxy: When the connection to the Jublo Codebirds Server is down - your application will be down, too. You will be also able to implement your own server side implementation to bridge a more reliable communication between your app and twitter. You can take a look at this repo if you're interested in: https://github.com/sonnyt/tweetie

Instagram Feed isn't working? Instagram changed the required API Request, this is the reasons why the demo here is broken. You have to fix in the "jquery.socialfeed.js" file. H1r1n mentioned it before: "To fix the Cannot read property 'id' of undefined issue for Instagram, because the user is undefined, change this line 487" url = Feed.instagram.api + 'users/search/?q=' + username + '&' + authTokenParams + '&count=1' + '&callback=?';

with this line: url = Feed.instagram.api + 'users/self/?' + authTokenParams + '&count=1' + '&callback=?';

Mixed Content Issue with Twitter (Mixed Content Errors) I recommend you to place the following meta-tag into your section of your DOM. This should fix your mixed content issue with twitter and will force it to received it secured. (Tested in latest Chrome, Safari and FF)

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

Upgrade your codebird.js file from 2.5.x to 3.x This project is using an outdated version of the codebird.js file to proxy your requests to the Twitter REST API as work-around instead of making use of your own implementation of server-side implementation. You can replace it with the current version here: https://github.com/jublo/codebird-js/blob/develop/codebird.js The original file is located in the following directory: bower_components/codebird-js/codebird.js - make sure to use it in combination with the "proxy" fix mentioned above.

LucaBn commented 5 years ago

About Instagram Feed: When trying to get the token I had this error: /?error_reason=user_denied&error=access_denied&error_description=The+user+denied+your+request.

I know it's strange but I solved it by changing my browser language to english as recommended in this post: https://www.reddit.com/r/Instagram/comments/b7cl1h/problem_with_api_for_instagram_feed/

AlkarE commented 4 years ago

Thanks to Kevin Bacon 'snyoz'. working solution. Completely fixed issues with twitter and instagram

ellemaker commented 4 years ago

how about on facebook page post feed?