N8n Ghost node - Create Post Image Issues

Hello,

I am trying to setup a flow within n8n to post blog posts for me.

I am currently using a method to generate an image through dall-e and then uploading that image to Google Drive (Folder set to share to anyone with a link).

When setting up the Ghost node, I input title, content author etc - everything seems to be working. I populate the Open Graph Image with the webContentLink attribute form my Google Drive step (and I’ve tried a lot of the others). The post goes through but I can never get the image to display.

Can anyone help me here? And what details would you need from me?

How do you put the imagr link into posts?

(post deleted by author)

{ “posts”: [{ “feature_image”: “https://drive.google.com/uc?id=10o6rb7WwX9II8AUWR5OaneKgeSESFiIr&export=download” }] }

But i am getting a an error:

Header name must be a valid HTTP token [“content-type: application/json”]

Error details

From HTTP Request

Error code

ERR_INVALID_HTTP_TOKEN

Request

{ "headers": { "content-type: application/json": "application/json", "accept": "application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7", "Authorization": "**hidden**" }, "method": "POST", "uri": "https://nerdic.ghost.io/ghost/api/v3/admin/posts/66d95588abb1020001375fa1", "gzip": true, "rejectUnauthorized": true, "followRedirect": true, "resolveWithFullResponse": true, "followAllRedirects": true, "timeout": 300000, "body": { "posts": { "feature_image": "{ \"posts\": [{ \"feature_image\": \"https://drive.google.com/uc?id=10o6rb7WwX9II8AUWR5OaneKgeSESFiIr&export=download\" }] }" } }, "encoding": null, "json": false, "useStream": true }

Other info

Item Index

0

Node type

n8n-nodes-base.httpRequest

Node version

4.2 (Latest)

n8n version

1.57.0 (Self Hosted)

Time

05/09/2024, 11:51:45

Stack trace

(post deleted by author)

I am trying the following but getting an error as below:

Method

URL:

https://nerdic.ghost.io/ghost/api/v3/admin/posts/{{ $json.id }}

https://nerdic.ghost.io/ghost/api/v3/admin/posts/66d95588abb1020001375fa1

(GHOST ADMIN AUTHENTICATION)

Header Parameters

Name: Content-Type: application/json

Value: application/json

Send Body

Body Content Type: JSON

Name:

{ “posts”: [{ “feature_image”: “{{ $(‘Google Drive’).item.json.webContentLink }}” }] }

{ “posts”: [{ “feature_image”: “https://drive.google.com/uc?id=10o6rb7WwX9II8AUWR5OaneKgeSESFiIr&export=download” }] }

I am getting the following error:

Error code

ERR_INVALID_HTTP_TOKEN

Request

{ “headers”: { “content-type: application/json”: “application/json”, “accept”: “application/json,text/html,application/xhtml+xml,application/xml,text/;q=0.9, image/;q=0.8, /;q=0.7”, “Authorization”: “hidden” }, “method”: “POST”, “uri”: “https://nerdic.ghost.io/ghost/api/v3/admin/posts/66d95588abb1020001375fa1”, “gzip”: true, “rejectUnauthorized”: true, “followRedirect”: true, “resolveWithFullResponse”: true, “followAllRedirects”: true, “timeout”: 300000, “body”: { “posts”: { “feature_image”: “{ "posts": [{ "feature_image": "https://drive.google.com/uc?id=10o6rb7WwX9II8AUWR5OaneKgeSESFiIr&export=download\” }] }" } }, “encoding”: null, “json”: false, “useStream”: true } Other info

That error looks like an authentication problem, not a problem with the image, but just to confirm, can you try using an image that isn’t in Google Drive? Do you still get that error, or is it unique to using Google drive?

Well with the picture being jammed directly into the featured image, I might be able to forego the entire process of uploading to Google Cloud for hosting entirely.
So I’ll try that once I am back at the wheel.

Previously I tried taking pictures directly from the output, but they weren’t being put into the feature image and thereby not hosted. Then I tried to upload them to airtable and that worked but the URLs died after a few hours. So I was back at it with Google. Then this no feature image aspect of the Ghost node made me to the direct API - and that might be able to jam it directly into the feature image and host it on Ghost instead.
If not I’ll try a different method of generating an image through Replicate with an api call instead - that yielded better results on Lindy.ai.
And while Lindy is certainly capable, it’s seems incredibly expensive to run.

That Google Drive image cant be displayed until you get authenticated on Google Drive. Its not the BEST way to embed an image…

1 Like

Okay then what’s a better way? :) eager to learn more and more as each day goes.

My Google Cloud app is reviewed and accepted - so. But not fond of the method regardless