What are the Correct Values and Actions to Automate WordPress Blog Post Publishing in Pipedream?

, Warning (likely out of date)
These results are likely out of date. Test this step again.
Error
getaddrinfo ENOTFOUND https

I apologize for the confusion earlier. The error message “getaddrinfo ENOTFOUND https” indicates that there might be an issue with the domain name resolution or the URL being used in the request. Please double-check the wordpressDomain prop value you’re using to ensure it’s a valid domain. If the issue persists, please provide more context or information about the steps leading to this error, and I’ll do my best to help you resolve it.

, DETAILS

    at null.__node_internal_captureLargerStackTrace (node:internal/errors:496:5)
    at null.__node_internal_ (node:internal/errors:715:10)
    at GetAddrInfoReqWrap.onlookup (node:dns:108:26)

I apologize for the confusion earlier. The error message you shared earlier doesn’t seem to be directly related to the code you provided. The code you shared appears to be correct, and the error message seems to be related to a different part of your workflow or environment. To help you further, please provide more context or information about the steps leading to this error, and any other relevant code or settings in your workflow. This will help me better understand the issue and provide a solution.

, On step 3, I manually input the following for Configure.

WordPress Domain

https://digitaltopical.com

Username

[kc@digitaltopical.com](mailto:kc@digitaltopical.com)

WordPress Password
I can’t give this !
Post Title

{{steps.trigger.event.file}}

Post Content

{{steps.trigger.event.file}}

I see the issue now. The problem is with the formatting of the values you’ve entered for the WordPress Domain and Username. Please update them as follows: WordPress Domain [digitaltopical.com](http://digitaltopical.com) Username [kc@digitaltopical.com](mailto:kc@digitaltopical.com) Remove the angle brackets (< and >) and other unnecessary characters. Once you’ve made these changes, try running the step again. If you still encounter any issues, please let me know.

thank you for the help, but I now have this error.

Error - Request failed with status code 400
{“code”:“empty_content”,“message”:“Content, title, and excerpt are empty.”,“data”:{“status”:400}}
DETAILS

    at null.createError (/tmp/__pdg__/dist/code/e013743e6a2245383647571a0a6763cb20cfb5d1986d42bcaec3086bf441a58e/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/core/createError.js:16:15)
    at null.settle (/tmp/__pdg__/dist/code/e013743e6a2245383647571a0a6763cb20cfb5d1986d42bcaec3086bf441a58e/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/tmp/__pdg__/dist/code/e013743e6a2245383647571a0a6763cb20cfb5d1986d42bcaec3086bf441a58e/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (node:events:526:35)
    at null.endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Let me know how to fix it.

I see the issue now. The error “Request failed with status code 400” with the message “Content, title, and excerpt are empty” indicates that the WordPress API is expecting non-empty values for the post title and content. It seems that the values you’re using for the Post Title and Post Content are not being properly populated. You mentioned that you’re using {{steps.trigger.event.file}} for both Post Title and Post Content. Please ensure that the steps.trigger.event.file contains the correct data. If you’re still encountering issues, you can try using static values for the Post Title and Post Content to confirm if the issue is related to the dynamic values from the trigger step. If that works, you can then investigate the trigger step to make sure it’s providing the expected data.

, what are static values here?

Static values are fixed or constant values that you provide directly as input, instead of using dynamic values from previous steps in your workflow. For example, instead of using {{steps.trigger.event.file}} for the Post Title and Post Content, you can use static values like this: Post Title My Sample Post Title Post Content ```
This is the content of my sample post.

, Post title can be typed, but my content is very long like I said before.

I understand that your post content is very long. In this case, you can use a different method to pass the content to the Post Content field. One option is to store the content in a file and read the content from the file within your workflow. You can use a code step to read the file content and then pass it to the WordPress action. Here’s an example of how to read a file’s content in a code step: const fs = require("fs"); const content = fs.readFileSync("/path/to/your/file.txt", "utf-8"); return { content }; Replace /path/to/your/file.txt with the actual path to your file. This code step will return the content of the file, which you can then use in the Post Content field of the WordPress action like this: Post Content {{steps.read_file.content}} Replace steps.read_file with the actual name of the code step where you read the file content. This way, you can handle long content without manually typing it in the Post Content field.

, did you mean “Run Custom Code” when I select an app for the next step to read the file?

Yes, that’s correct! To read the file content, you can add a “Run Node.js Code” step in your workflow. In this step, you can write custom code to read the content of your file and then use it in the subsequent steps. Here’s an example of how to read a file’s content in a “Run Node.js Code” step: const fs = require("fs"); const content = fs.readFileSync("/path/to/your/file.txt", "utf-8"); return { content }; Replace /path/to/your/file.txt with the actual path to your file. This code step will return the content of the file, which you can then use in the Post Content field of the WordPress action like this: Post Content {{steps.read_file.content}} Replace steps.read_file with the actual name of the code step where you read the file content.

, do you want me to make step 4 with the codes or add them to step 3?

I recommend creating a new step (Step 4) for the “Run Node.js Code” to read the file content. This way, you can keep the steps separate and organized. After reading the file content in Step 4, you can use the output in the WordPress action (Step 3) for the Post Content field like this: Post Content {{steps.read_file.content}} Replace steps.read_file with the actual name of the code step where you read the file content.

, I got a Code Error
‘return’ outside of function. (3:0)

I apologize for the confusion earlier. It seems there was a mistake in the code I provided. In the “Run Node.js Code” step, you should use the module.exports syntax instead of the defineComponent syntax. Here’s the corrected code: const fs = require("fs"); const content = fs.readFileSync("/path/to/your/file.txt", "utf-8"); module.exports = { content }; Replace /path/to/your/file.txt with the actual path to your file. This code step will return the content of the file, which you can then use in the Post Content field of the WordPress action like this: Post Content {{steps.read_file.content}} Replace steps.read_file with the actual name of the code step where you read the file content.

, another error, Code Error
Error: ENOENT: no such file or directory, open ‘/path/to/your/file.txt’

I apologize for the confusion. The error you’re encountering is because the file path provided in the code example is a placeholder. You need to replace /path/to/your/file.txt with the actual path to the file you want to read. Please update the file path in the code and try running the workflow again. If you’re still encountering issues, please let me know and provide more information about the file you’re trying to read, such as its location and format.