Created
January 22, 2018 18:25
-
-
Save parzibyte/4cc6db5eae45be83f48f6626c0a6a681 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) | |
id_post_eliminar = 4 | |
detalles_post = cliente.call(posts.GetPost(id_post_eliminar)) | |
respuesta_de_usuario = int(input(""" | |
¿Realmente desea eliminar el post? | |
Detalles: | |
ID: {} | |
Título: {} | |
Escriba 1 si desea confirmar la operación: | |
""".format(detalles_post.id, detalles_post.title))) | |
if respuesta_de_usuario == 1: | |
resultado = cliente.call(posts.DeletePost(id_post_eliminar)) | |
if resultado is True: | |
print("Eliminado correctamente") | |
else: | |
print("Algo salió mal") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment