Пример #1
0
def update_wordpress():
	categories = [u'小百合BBS活动预告']
	tags = "%s, %s" % ('LilyBBS', board,)
	custom_fields = [{'key': 'source', 'value': friendly_link}, {'key': 'author', 'value': author}]
	if multi_update.wordpress_new_post(title, content, categories, tags, custom_fields):
		print 'Wordpress Update Successful!'
		log.write( '%s - LilyBBS Events - a new post to wordpress\n' % (datetime.now(),) )
	else:
		print 'Wordpress Update Failed!!!!'
		log.write( '%s - LilyBBS Events - update wordpress failed!!!!!\n' % (datetime.now(),) )
Пример #2
0
def update_wordpress():
	if u'国际交流' in title:
		categories = [u'国际交流']
	else:
		categories = [u'教务通知']
	custom_fields = [{'key': 'source', 'value': link}]
	if multi_update.wordpress_new_post(title, content, categories,'' , custom_fields):
		print 'Wordpress Update Successful!'
		log.write( '%s - Jiaowu News - a new post to wordpress\n' % (datetime.now(),) )
	else:
		print 'Wordpress Update Failed!!!!'
		log.write( '%s - Jiaowu News - update wordpress failed!!!!!\n' % (datetime.now(),) )
Пример #3
0
def update_wordpress(row):
	if row['type']==0:
		categories = [u'学术讲座预告']
	elif row['type']==1:
		categories = [u'校园活动预告']
	else:
		categories = []
	tags = '%s, %s, %s' % (row['keywords'], row['display_name'], row['speakers'],)
	custom_fields = [{'key': 'place',   'value': row['place']},
	                 {'key': 'time',    'value': row['coming_date'][5:16]},
	                 {'key': 'speaker', 'value': row['speakers']},
	                 {'key': 'host',    'value': row['display_name']}]
	post_id = multi_update.wordpress_new_post(row['post_title'], row['post_content'], categories, tags, custom_fields)
	if post_id:
		print 'Wordpress Update Successful!'
		log.write( '%s - Leture | Activity - a new post to wordpress\n' % (datetime.now(),) )
	else:
		print 'Wordpress Update Failed!!!!'
		log.write( '%s - Leture | Activity- update wordpress failed!!!!!\n' % (datetime.now(),) )
	return post_id