Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 22, 2018 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/d0250aeb4d7642bc4f2fa34d0fb1b391 to your computer and use it in GitHub Desktop.
Save parzibyte/d0250aeb4d7642bc4f2fa34d0fb1b391 to your computer and use it in GitHub Desktop.
from wordpress_xmlrpc import Client, WordPressPost
from wordpress_xmlrpc.methods import posts
usuario = ""
contraseña = ""
sitio = ""
cliente = Client(sitio, usuario, contraseña)
nueva_entrada = WordPressPost()
nueva_entrada.title = "El título de la entrada"
nueva_entrada.content = "Hola, yo soy el contenido. Claro que <strong>puedo</strong> llevar contenido HTML"
id_entrada_publicada = cliente.call(posts.NewPost(nueva_entrada))
print("Correcto! Se publicó la entrada, y su id es {}".format(id_entrada_publicada))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment