mirror of
https://github.com/wahyd4/sohub.git
synced 2026-08-09 04:56:09 +10:00
add weibo message to show
This commit is contained in:
@@ -38,6 +38,6 @@ A aggregater of all kinds of social messages and other streams
|
||||
+ <del>通过微信发送文本消息</del>
|
||||
+ <del>通过微信发布图片消息</del>
|
||||
+ <del>通过微信发送通知消息</del>
|
||||
+ 抓取Weibo状态进行显示
|
||||
+ <del>抓取Weibo状态进行显示</del>
|
||||
+ 同步Google Calendar显示
|
||||
|
||||
|
||||
+33
-2
@@ -13,8 +13,10 @@ $(document).ready(function () {
|
||||
/**
|
||||
* 切换容器中的文字
|
||||
* @param container
|
||||
* @param flag 初始值
|
||||
*/
|
||||
function slideDiv(container, flag) {
|
||||
var flag = flag || textMessageCount;
|
||||
setInterval(function () {
|
||||
var children = container.children();
|
||||
if (flag >= children.length) {
|
||||
@@ -75,7 +77,7 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
|
||||
slideDiv(content, textMessageCount);
|
||||
slideDiv(content);
|
||||
//hide the loading text
|
||||
$('#loading').hide();
|
||||
})
|
||||
@@ -107,7 +109,7 @@ $(document).ready(function () {
|
||||
|
||||
var footprint = $('<div></div>').addClass('footprint');
|
||||
footprint.append('<img src="/images/elephant.jpg">');
|
||||
footprint.append('<div>' + timeSince(json[i].createTime) + '</div>');
|
||||
footprint.append('<div>' + json[i].fromUser + '发表于' + timeSince(json[i].createTime) + '</div>');
|
||||
item.append(footprint);
|
||||
item.append('<p>' + json[i].content + '</p>');
|
||||
noticeContainer.append(item);
|
||||
@@ -119,4 +121,33 @@ $(document).ready(function () {
|
||||
});
|
||||
}, interval * 2 - 1000 * 30);
|
||||
|
||||
|
||||
// delay almost 2.5 minute to display notice message
|
||||
setTimeout(function () {
|
||||
$.get('/weibo', function (json) {
|
||||
json = json.items;
|
||||
console.log(json);
|
||||
var weiboContainer = $('.weibo-content');
|
||||
for (var i = 0; i < json.length; i++) {
|
||||
var item = $('<li style="display: none"></li>');
|
||||
|
||||
var footprint = $('<div></div>').addClass('footprint');
|
||||
footprint.append('<img src="' + json[i].user.avatar_hd + '">');
|
||||
footprint.append('<div>' + json[i].user.name + '发布于' + timeSince(new Date(json[i].created_at)) + '</div>');
|
||||
item.append(footprint);
|
||||
var content = $('<div class="weibo"> </div>');
|
||||
if (json[i].original_pic !== undefined) {
|
||||
content.append('<img src="' + json[i].original_pic + '"></img>');
|
||||
}
|
||||
content.append('<p>' + json[i].text + '</p>');
|
||||
item.append(content);
|
||||
weiboContainer.append(item);
|
||||
|
||||
}
|
||||
|
||||
slideDiv(weiboContainer, textMessageCount);
|
||||
|
||||
});
|
||||
}, interval * 3 - 1000 * 30);
|
||||
|
||||
});
|
||||
@@ -15,13 +15,7 @@ h1 a {
|
||||
position: absolute;
|
||||
top: 200px;
|
||||
z-index: 50;
|
||||
|
||||
-webkit-transition: opacity 1s ease-in-out;
|
||||
-webkit-animation-timing-function: ease-in-out;
|
||||
-webkit-animation-iteration-count: infinite;
|
||||
-webkit-animation-duration: 3s;
|
||||
-webkit-animation-direction: alternate;
|
||||
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.main-container {
|
||||
@@ -68,6 +62,15 @@ h1 a {
|
||||
|
||||
}
|
||||
|
||||
.weibo-content li .weibo{
|
||||
max-height: 500px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.weibo-content li .weibo p {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.content li.alert {
|
||||
padding: 19px 35px 19px 14px;
|
||||
height: 200px;
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
</ul>
|
||||
<ul class="content image-content" style="display:none;">
|
||||
</ul>
|
||||
<div class="content notice-content" style="display:none;">
|
||||
</div>
|
||||
<ul class="content notice-content" style="display:none;">
|
||||
</ul>
|
||||
<ul class="content weibo-content" style="display:none;">
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user