When using an Applet that includes the RSS service's New Feed Item trigger, the entry image url ingredient will return the URL for the first image in the entry. In the event that an RSS entry doesn't include an image, the system will default to a 'File not found' image if that ingredient is being used in action.
In the event that an RSS entry lacks both an image and a placeholder, the system will default to a 'File not found' image.
To set a default image for RSS posts without images, you can use the following filter code. This example demonstrates how to post a fallback image on Telegram when an RSS entry doesn't have an image:
let imageURL = Feed.newFeedItem.EntryImageUrl;
let noImage = 'no_image_card.png';
let replacementImage = 'https://yourlinkhere.jpg';
if (imageURL === "" || imageURL.indexOf(noImage) !== -1) {
imageURL = replacementImage;
}
Telegram.sendPhoto.setPhotoUrl(imageURL);
Important notes:
1. When using the above code, replace https://yourlinkhere.jpg with the URL to your image. Ensure that your replacement image is hosted on an external domain, preferably one that you own. You can also host your image on Dropbox or Google Drive as an atlernative
2. The above code uses the Telegram Send Photo action. If your Applet uses a different action Telegram.sendPhoto.setPhotoUrl(imageURL) will need to be updated.
The relevant action method can be found by clicking the available options on the right side of the filter code editor and then selecting the set photo option. In this screenshot the Applet is using the Twitter Post a Tweet with image action:
When clicking the text on the right, Twitter.postNewTweetWithImage.setPhotoUrl() would be copied and could then be pasted into the filter code editor to replace telegram.sendPhoto.setPhotoUrl(imageURL) with Twitter.postNewTweetWithImage.setPhotoUrl(imageURL).
By implementing this filter code, you can maintain consistent image presentation across all your RSS feed posts, even when original images are unavailable.