AlienStar Posted January 10, 2021 Share Posted January 10, 2021 (edited) hello everybody due to facing so many errors with _IE functions I found winhttp udf can do the same but I have a bit info about. to create a post in my wordpress I use this code #include <WinHttp.au3> $sLoginPage = '/wp-login.php' $postPage = '/wp-admin/post-new.php' $sDomain = 'https://mhd2020.000webhostapp.com' $sLogin = '**********' $sPassword = '*********' ConsoleWrite("Connecting..."&@CRLF) $hOpen = _WinHttpOpen() $hConnect = _WinHttpConnect($hOpen, $sDomain) ConsoleWrite("Signing in... "&@CRLF) ; Login first _WinHttpSimpleFormFill($hConnect, _ $sLoginPage, _ "loginform", _ 'user_login', $sLogin, _ 'user_pass', $sPassword) ConsoleWrite('! Error for login = ' & @error & @LF) ConsoleWrite("creating a post."&@CRLF) $sResponse = _WinHttpSimpleFormFill($hConnect, _ $postPage, _ "post", _ 'title', "Test" ,'content', "test test test") ConsoleWrite('! Error for create = ' & @error & @LF) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) it could create a post but without publishing (just a draft) I need to: - checkbox in category field by object ID e.g: "in-category-1" - submit a post (not make a draft post) how to do this please ? Edited January 10, 2021 by AlienStar Link to comment Share on other sites More sharing options...
faustf Posted January 14, 2021 Share Posted January 14, 2021 mm i suppose you wanna create a Macro , for work with your site , for my best opinion is much stable if you use a REST API in wordpress , or work directly with database of site ,if you want create macro in site full of javascript , is much better if you use , webdriver , but is only my opinion good luck AlienStar 1 Link to comment Share on other sites More sharing options...
AlienStar Posted January 16, 2021 Author Share Posted January 16, 2021 you are right my friend but the need was a desktop application to use anywhere without dealing with websites php files Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now