Last active
April 12, 2019 02:10
-
-
Save troutcolor/51cf0f81308210886b97c5fe2dafc6d0 to your computer and use it in GitHub Desktop.
This is a script for alfred to post to a WordPress, adding the category micro, post format status and as a note. There is no title. I use a hotkey cmd-alt-cnrl-m alfred passes the selected text in the topmost app to the script as q. I don't deal with special chars. Password hard coded is probably not a good idea. Obviously you could edit categor…
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
on alfred_script(q) | |
set myBlogUsername to "USERNAME" | |
set myBlogPass to "PASSWORD" | |
set cat to {category:{"Micro"}, kind:{"note"}} | |
set poststrut to {post_type:"post", post_status:"publish", post_format:"status", post_title:"", post_content:q, terms_names:cat, comment_status:"open"} | |
tell application "http://example.com/xmlrpc.php" | |
set myPosts to call xmlrpc {method name:"wp.newPost", parameters:{"1", myBlogUsername, myBlogPass, poststrut}} | |
return myPosts | |
end tell | |
end alfred_script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment