Rss to Twitter with Image

Hey @Collin_Mutambo,

I identified some issues with your workflow.

  1. The Not Contains logic in the IF node doesn’t solve the issue we had earlier. The node still returns all the items from the previous node, even the empty items. The ‘Is Empty’ operation will fix this. If you’re running an older version of n8n, please update to the latest version so that you are able to use the ‘Is Empty’ operation.
  2. The HTTP Request node was connected to the true output of the IF node. The condition in the IF node was false, hence no data was returned to the HTTP Request node.
  3. You are using a single Twitter node for both the articles that have images and the ones that don’t. Hence, the node gives you can error for the posts without an image. One way to resolve this is to use two separate Twitter node.

Below is the workflow that will solve your issue. Make sure that you’re using a recent version of n8n to use the Is Empty operation.

Thanks. Lots of headway --Upgraded n8n image in docker. IF issue sorted. Got this in the HTTP request node;
ERROR: UNKNOWN ERROR - check the detailed error for more information.

{“status”:“rejected”,“reason”:{“name”:“RequestError”,“message”:“Error: options.uri is a required argument”,“cause”:{},“error”:{},“options”:{“timeout”:3600000,“headers”:{“Content-Type”:“application/json”,“accept”:“application/json,text/html,application/xhtml+xml,application/xml,text/;q=0.9, image/;q=0.8, /;q=0.7”},“method”:“GET”,“gzip”:true,“rejectUnauthorized”:true,“encoding”:null,“simple”:true,“resolveWithFullResponse”:false,“transform2xxOnly”:false}}}

I changed the IF node (IS NO IMAGE) arrow from running from True to false and it worked. However, the images are being mixed up with the posts on twitter. For example, if an article is about BIDEN, an image from another article from the RSS feed will appear on twitter which is unrelated. How can I ensure that the post has both image and article matched correctly. Thank you for all. I have learned so much.

@harshil1712 tweaked a few things but still jumbled up or mixed up images from one post with images of others. When images are posted to Twitter, together with articles, they look nicely aligned.

@Collin_Mutambo, it is because of the way you’re referencing the values. You’re referring to the tweet content from a node that is before the IF node. This node will return all the data, no matter if it has images or not. While the nodes after the IF node will return content that has images. Hence, instead of referring to the content from the RSS Read node, refer to the content from the IF node or a node after that.

What I have below works, because I change the IF NO IMAGE to connect to true. When I move it back to false, I get the error in the HTT request fetch image node "Fetch image: UNKNOWN ERROR - check the detailed error for more information"

@harshil1712 and @jan - My heroes so far, OK, I know this is somehow me messing up at the last bit. I have done as you suggested. Images with posts are posted. However, I only want one post or article picked from the RSS feed (the latest or most recent), together with its image, sent to the twitter node and obviously posted on Twitter. The below is my best shot. However, it send me an array of many posts with the wrong images attached to them.

Can you check out the workflow at the end. In it did I fix the issue that it returned an array (by deactivating the “Return Array” parameter on the node “Extract Image1”) and also the issue that it did post the wrong text (by extracing the “contentSnippet” with the “Extract Image1” node so that image and text stay together and so does not cause the issue with the wrong item-index).

1 Like

@jan This has sorted out the issue of wrong posts. However I had to change the IF node that has the Isnoimage (with the Is Empty parameter) arrow from True to false because I was getting an error. Fetch image: UNKNOWN ERROR - check the detailed error for more information. Should this be left as is, because all my posts have images?

Images are now perfectly matched with posts. However they are posted in doubles (as in two of the same posts being tweeted). Not one of each, ideally only the latest as in the last IF modules.

Hey Collin, did you managed to have a final version that works for your template ?
would you be able to share the advances if you have made any ?

thanks in advance,