Created
April 28, 2011 05:51
-
-
Save brennanneoh/945871 to your computer and use it in GitHub Desktop.
Extension of Wordpress XMLRPC Python Library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wordpress_xmlrpc.base import * | |
from wordpress_xmlrpc.mixins import * | |
from wordpress_xmlrpc.wordpress import WordPressBase, WordPressPost | |
class GetSport(AuthParamsOffsetMixin, AuthenticatedMethod): | |
method_name = 'metaWeblog.getPost' | |
method_args = ('post_id',) | |
results_class = WordPressPost | |
class NewSport(AuthenticatedMethod): | |
method_name = 'wp.newSport' | |
method_args = ('content', 'publish') | |
class EditPost(AuthParamsOffsetMixin, AuthenticatedMethod): | |
method_name = 'metaWeblog.editPost' | |
method_args = ('post_id', 'content', 'publish') | |
class DeleteSport(AuthParamsOffsetMixin, AuthenticatedMethod): | |
method_name = 'wp.deleteSport' | |
method_args = ('post_id', ) | |
class GetEvent(AuthParamsOffsetMixin, AuthenticatedMethod): | |
method_name = 'metaWeblog.getPost' | |
method_args = ('post_id',) | |
results_class = WordPressPost | |
class NewEvent(AuthenticatedMethod): | |
method_name = 'wp.newEvent' | |
method_args = ('content', 'publish') | |
class EditEvent(AuthParamsOffsetMixin, AuthenticatedMethod): | |
method_name = 'metaWeblog.editPost' | |
method_args = ('post_id', 'content', 'publish') | |
class DeleteEvent(AuthParamsOffsetMixin, AuthenticatedMethod): | |
method_name = 'wp.deleteSport' | |
method_args = ('post_id', ) | |
class UploadEventImage(AuthenticatedMethod): | |
method_name = 'wp.uploadEventImage' | |
method_args = ('data','parent') | |
class NewUser(AuthenticatedMethod): | |
method_name = 'wp.newUser' | |
method_args = ('data',) | |
class WordPressUser(WordPressBase): | |
definition = { | |
'user_login': 'username', | |
'user_email': 'email', | |
'first_name': 'firstname', | |
'last_name': 'lastname', | |
'user_url': 'website', | |
'user_pass': 'password', | |
'role': 'role', | |
} | |
def __str__(self): | |
return self.nickname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment