本文整理汇总了Python中wordpress_xmlrpc.WordPressPost.tags方法的典型用法代码示例。如果您正苦于以下问题:Python WordPressPost.tags方法的具体用法?Python WordPressPost.tags怎么用?Python WordPressPost.tags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wordpress_xmlrpc.WordPressPost
的用法示例。
在下文中一共展示了WordPressPost.tags方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post_new
# 需要导入模块: from wordpress_xmlrpc import WordPressPost [as 别名]
# 或者: from wordpress_xmlrpc.WordPressPost import tags [as 别名]
def post_new(self, title, content, categories = ['Mac OS X'], individual_tags = '', status = 'private', date = dt.datetime.now()):
post = WordPressPost()
post.title = title
post.description = content
tags = 'automatically posted' if (self.additional_tags == '') else self.additional_tags + ', automatically posted'
tags = individual_tags + tags
post.tags = tags
post.date_created = date
post.post_status = status
post.categories = categories
self.__wp.call(NewPost(post, True))
示例2: Client
# 需要导入模块: from wordpress_xmlrpc import WordPressPost [as 别名]
# 或者: from wordpress_xmlrpc.WordPressPost import tags [as 别名]
# -*- coding: utf-8 -*-
#depende de https://github.com/maxcutler/python-wordpress-xmlrpc
from wordpress_xmlrpc import Client, WordPressPost
from wordpress_xmlrpc.methods.posts import GetRecentPosts, NewPost
from wordpress_xmlrpc.methods.users import GetUserInfo
wp = Client('http://yupana.pontaodaeco.org/xmlrpc.php', 'gesuselva', 'kernelpanic')
post = WordPressPost()
post.title = 'Que as atuais máquinas informacionais e comunicacionais não se contentem em veicular conteúdos representativos, mas que concorram igualmente para a confecção de novos agenciamentos de enunciação (individuais e/ou coletivos)?'
post.description = '<h1></h1><br><p>عبور الحدود aquilo que dissolve no solo e continua a jornada electroquímica dos corpos finalmente será separada daquilo que sempre esteve apenas permeando - <a href=\"https://github.com/glerm/yupana\"/>um dicionário em aglutinação movendo aqueles braços, pernas, cabeça, tripas.</a> esta árvore de sinais, continua se espalhando e entidades que חציית הגבול</p><img src=\"http://upload.wikimedia.org/wikipedia/commons/2/20/Boltzmanns-molecule.jpg\"/>'
post.tags = 'yupana, kernel'
post.categories = ['coding']
wp.call(NewPost(post, True))
示例3: WordPressPost
# 需要导入模块: from wordpress_xmlrpc import WordPressPost [as 别名]
# 或者: from wordpress_xmlrpc.WordPressPost import tags [as 别名]
# Get description
pattern = r'<div id="showContentText">(.*?)</div>.*?<div id="showContentImageInfo"'
body = re.search(pattern, res.text, re.MULTILINE | re.DOTALL).group(1)
# Upload image
data = {
'name': img_url.split("/")[-1],
'type': 'image/jpg',
}
data['bits'] = xmlrpc_client.Binary(requests.get(img_url).content)
file_res = wp.call(media.UploadFile(data))
# Wordpress post
post = WordPressPost()
post.title = "dayviews {d}/{m}-{y}".format(d=date.day, m=date.month,
y=date.year)
post.content = u'<img src="{url}"><br>{body}'.format(url=file_res['url'],
body=body)
post.date = date
post.tags = ['dayviews']
post.post_status = 'publish'
wp.call(NewPost(post))
# Get url of next image
pattern = r'href="(.*?)" title="Next'
next_match = re.search(pattern, res.text)
if next_match:
next_url = next_match.group(1)
i += 1
print i
示例4: Client
# 需要导入模块: from wordpress_xmlrpc import WordPressPost [as 别名]
# 或者: from wordpress_xmlrpc.WordPressPost import tags [as 别名]
p_category_id = sermon_vars['post_category_id']
p_tags = sermon_vars['post_tags']
rpc_url = sermon_vars['wp_rpc_url']
username = sermon_vars['wp_username']
password = sermon_vars['wp_password']
wp = Client(rpc_url, username, password)
post = WordPressPost()
post.title = p_title
post.description = p_description
post.format = p_format
post.categories = p_categories
#post.terms = post_category_name
post.tags = p_tags
print post.title + ": " + post.description + " [posted]"
post_id = wp.call(NewPost(post, True))
#podpress: https://wordpress.org/support/topic/xml-rpc-support-1
file_prefix = today.strftime('Hoc4Service%y%b%d_')
sermon_file = file_prefix + 'sermon' + '.mp3'
file_url = today.strftime('http://hoctoga.org/english/recordings/%Y/' + sermon_file)
print file_url
fields = {}
fields["URI"] = file_url
fields["title"] = p_title
fields["type"] = sermon_vars['file_type']