social wall
function socialStreamSetup(twitID, fBookID, yTubeId, yTubeApi, instaAccess, instaClient, instaAccountID) {
$('#social-stream').dcSocialStream({
feeds: {
twitter: {
id: 'CBPLawyers',
intro: 'Tweeted',
search: 'Tweeted',
out: 'intro,thumb,text,share',
retweets: false,
replies: false,
images: '',
url: 'https://www.create.net.au/applications/ecobud_au/twitter.php',
icon: 'twitter.png'
},
// facebook: {
// id: fBookID,
// out: 'intro,share,title,text,user',
// text: 'content',
// url: 'https://graph.facebook.com',
// feed: 'posts'
// },
youtube: {
id: 'UC87h642uyLU_OVHvEDgPr1Q',
thumb: 'high',
out: 'intro,thumb,title',
api_key: 'AIzaSyBgOLKqmeE_ztqbcLL4s71Lird9M1t9GxA'
},
// instagram: {
// id: instaAccountID,
// out: 'intro,thumb',
// accessToken: instaAccess,
// clientId: instaClient
// },
linkedin: {
url: '/WWW_Shared/API/LinkedInCompanyUpdates.ashx?take=8&event-type=status-update',
id: '43970',
icon: 'https://store-images.s-microsoft.com/image/apps.36749.9007199266245564.6701eae8-16d2-4ba0-bdaa-8d9d9f9a1e70.03e5f6a9-3866-4ad9-9f2b-6b57ff90419e?w=180&h=180&q=60'
}
},
rotate: {
delay: 0
},
controls: false,
filter: true,
wall: true,
center: true,
limit: 8,
max: 'limit',
order: 'random',
iconPath: 'http://www.designchemical.com/blog/wp-content/themes/dc2011/dcsns/images/dcsns-dark/',
imagePath: 'http://www.designchemical.com/blog/wp-content/themes/dc2011/dcsns/images/dcsns-dark/',
responsify: true
});
}
//(twitID, fBookID, yTubeId, yTubeApi, instaAccess, instaClient, instaAccountID)
socialStreamSetup('', '', '', '', '', '', '');
#wall {
padding-top: 0;
}
.stream li {
padding: 15px 0 10px 0;
text-align: left;
width: 31%;
margin-left: 1%;
margin-right: 1%;
margin-bottom: 2%;
font-size: 14px;
padding-top: 0px;
border-radius: 3px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.22);
overflow: hidden;
}
@media (max-width: 1024px) {
.stream li {
width: 31%;
}
}
@media (max-width: 991px) {
.stream li {
width: 31%;
margin-left: 1%;
margin-right: 1%;
margin-bottom: 10px;
}
}
@media (max-width: 479px) {
.stream li {
width: 48%;
}
}
.stream li:hover {
-webkit-transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
-moz-transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
-moz-box-shadow: 0 0.625em 1.25em rgba(0, 0, 0, 0.19), 0 0.375em 0.375em rgba(0, 0, 0, 0.23);
-webkit-box-shadow: 0 0.625em 1.25em rgba(0, 0, 0, 0.19), 0 0.375em 0.375em rgba(0, 0, 0, 0.23);
box-shadow: 0 0.625em 1.25em rgba(0, 0, 0, 0.19), 0 0.375em 0.375em rgba(0, 0, 0, 0.23);
}
.stream li .inner {
padding: 0px;
padding-top: 34px;
}
.stream li .inner .section-title, .stream li .inner .section-text {
padding-top: 15px;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 10px;
display: inline-block;
color: #47506e;
font-family: "Open Sans", Helvetica, Arial, sans-serif;
font-weight: 500;
font-size: 14px;
max-width: 100%;
word-wrap: break-word;
}
@media (max-width: 1024px) {
.stream li .inner .section-title, .stream li .inner .section-text {
font-size: 11px;
}
}
.stream li .inner .section-share {
padding: 0;
margin: 0;
top: 9px;
position: absolute;
right: 5px;
z-index: 4;
}
@media (max-width: 1024px) {
.stream li .inner .section-share {
display: none;
visibility: hidden;
}
}
.stream li .icon {
max-width: 40px;
top: 5px;
left: 5px;
}
.stream li .section-intro {
top: 0;
height: 34px;
font-family: "Open Sans", Helvetica, Arial, sans-serif;
padding-left: 27px;
font-size: 14px;
}
.stream li .section-intro a {
padding-left: 0;
}
@media (max-width: 1024px) {
.stream li .section-intro {
font-size: 8px;
}
}
.stream li .section-thumb {
margin: 0px;
}
.stream li .section-thumb img {
border: none;
max-width: 100% !important;
width: 100%;
padding: 0;
}
@media (min-width: 992px) {
.stream li .section-thumb img {
min-width: 364px;
}
}
.stream li.dcsns-youtube span.section-thumb a::before {
content: "";
background-image: url(https://create.net.au/socialwall/images/play.png);
background-size: cover;
background-position: 50% 50%;
position: absolute;
display: -webkit-box;
width: 100%;
height: 100%;
margin-top: -20px;
}
.stream li.dcsns-twitter .section-thumb {
display: none;
visibility: hidden;
}
.dcsns ul, .dcsns li {
border-radius: 3px;
overflow: hidden;
}
.dcsns-toolbar {
text-align: center;
margin-top: 20px;
margin-bottom: 0px !important;
}
.dcsns-toolbar .filter {
display: inline-block;
}
.dcsns-toolbar .filter .link-all {
color: #3a3a3a;
text-shadow: none;
}
.dcsns-toolbar .filter .link-all:hover {
color: #177ba6;
}
.dcsns-toolbar .filter li a {
background: none !important;
}
.dcsns-toolbar .filter li a:hover {
background: none !important;
}
.dcsns-toolbar .filter li a:hover img {
opacity: .8;
}
.stream li.dcsns-pinterest .section-intro, .filter .f-pinterest a:hover, .filter .f-pinterest a.iso-active {
background-color: black;
}
@media (min-width: 992px) {
.dcsns-flickr .section-thumb {
width: 200%;
}
}
web part: static html
<div id='wall'>
<div id='social-stream'></div>
</div>
reference:
<link rel="stylesheet" type="text/css" href="//d1sb0u89kzy49b.cloudfront.net/cdn/socialwall/1.5.15/css/dcsns_wall.css" media="all" />
<link href='/app_themes/CBPSite/css/socialwall.css' rel='stylesheet'>
<script type="text/javascript" src="//d1sb0u89kzy49b.cloudfront.net/cdn/socialwall/1.5.15/js/jquery.social.stream.1.5.15.min.js"></script>
<script type="text/javascript" src="//d1sb0u89kzy49b.cloudfront.net/cdn/socialwall/1.5.15/js/jquery.social.stream.wall.1.6.js"></script>
<script src='/app_themes/CBPSite/js/jquery.prettyPhoto.js' type='text/javascript'></script>
<script src='/app_themes/CBPSite/js/socialwall.js' type='text/javascript'></script>
<%@ WebHandler Language="C#" Class="LinkedInCompanyUpdates" %>
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Web;
using CMS.DataEngine;
using CMS.SiteProvider;
using Newtonsoft.Json;
/// <summary>
/// Summary description for LinkedInCompanyUpdates
/// </summary>
public class LinkedInCompanyUpdates : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "application/json";
var companyID = SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".LinkedInID");
var token = SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".LinkedInAccessToken");
var expiry = SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".LinkedInAccessTokenExpiry");
//DateTime expirtyDate;
//DateTime.TryParseExact(expiry, "dd MMM yyyy HH:mm", null, DateTimeStyles.None, out expirtyDate);
//if (expirtyDate < DateTime.Now.AddDays(5))
//{
// //TODO: notify that token is going to expiry soon
//}
//if (expirtyDate < DateTime.Now)
//{
// var res = new
// {
// Error = "Token expired"
// };
// context.Response.Write(JsonConvert.SerializeObject(res));
//}
//else
//{
var count = string.IsNullOrWhiteSpace(context.Request["take"]) ? 10 : int.Parse(context.Request["take"]);
if (count > 50)
{
count = 50;
}
using (var client = new WebClient())
{
var url = string.Format("https://api.linkedin.com/v1/companies/{0}/updates?oauth2_access_token={1}&format=json&count={2}", companyID, token, count);
var res = client.DownloadString(url);
context.Response.Write(res);
context.Response.ContentType = "application/json";
}
//}
}
public bool IsReusable
{
get
{
return false;
}
}
}
1. Go to the link https://apigee.com/console/linkedin
2. Click Auth2 and login with the account of company administrator
3. Choose the api of “List all companies that the member is an administrator of” and click send
4. Make sure you can see “name: cbp” from Response body and write the id down
5. Choose the api of “Get a company's profile (simple)”
6. Change the number in red circle to the id you just wrote down in the url and click send
7. Copy all the request body and send it to me with the id you wrote down before