def update_renren(): renren_title = ''.join( (u'【教务处通知】', title,) ) renren_content = ''.join( (content, u'<p>原文地址:<a href="', link, '" target="_blank">', link, '</a></p>',) ) renren_content = renren_content.replace('\r\n', '').replace('\n', '').replace('\r', '') if multi_update.renren_new_post(renren_title, renren_content): print 'Renren Update Successful!' log.write( '%s - Jiaowu News - a new post to renren\n' % (datetime.now(),) ) else: print 'Renren Update Failed!!!!' log.write( '%s - Jiaowu News - update renren failed!!!!!\n' % (datetime.now(),) )
def update_renren(): renren_title = ''.join( (u'【小百合BBS活动预告】', title,) ) renren_content = ''.join( (u'<p>原文地址:<a href="', friendly_link, '" target="_blank">', friendly_link, u'</a><br />原帖作者:', author, '</p>', image_proxy(content),) ) renren_content = renren_content.replace('\r\n', '').replace('\n', '').replace('\r', '') if multi_update.renren_new_post(renren_title, renren_content): print 'Renren Update Successful!' log.write( '%s - LilyBBS Events - a new post to renren\n' % (datetime.now(),) ) else: print 'Renren Update Failed!!!!' log.write( '%s - LilyBBS Events - update renren failed!!!!!\n' % (datetime.now(),) )
def update_renren(row,postid): if row['type']==0: title=u'【学术讲座预告】%s' % (row['post_title']) content = u'<p>时间:%s<br />地点:%s<br />主讲人:%s<br />链接:<a href="%s" alt="" target="_blank">%s</a></p>%s' % (row['coming_date'][:16], row['place'], row['speakers'], postid2url(postid), postid2url(postid), row['post_content'],) elif row['type']==1: title=u'【校园活动预告】%s' % (row['post_title']) content = u'<p>时间:%s<br />地点:%s<br />主办:%s<br />链接:<a href="%s" alt="" target="_blank">%s</a></p>%s' % (row['coming_date'][:16], row['place'], row['display_name'], postid2url(postid), postid2url(postid), row['post_content'],) else: title =u'【预告】%s' % (row['post_title']) content = u'<p>时间:%s<br />地点:%s<br />链接:<a href="%s" alt="" target="_blank">%s</a></p>%s' % (row['coming_date'][:16], row['place'], postid2url(postid), postid2url(postid), row['post_content'],) if multi_update.renren_new_post(title, content): print 'Renren Update Successful!' log.write( '%s - Leture | Activity - a new post to renren\n' % (datetime.now(),) ) else: print 'Renren Update Failed!!!!' log.write( '%s - Leture | Activity - update renren failed!!!!!\n' % (datetime.now(),) )