Created
January 22, 2018 17:52
-
-
Save parzibyte/d0250aeb4d7642bc4f2fa34d0fb1b391 to your computer and use it in GitHub Desktop.
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 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