Notch Notch Manual 0.9.23
 Light | Dark
GetEntryImageFilename()

GetEntryImageFilename()

Purpose #

Retrieves the file path of the image for a given RSS entry from an RSS Node.

Syntax #

string GetEntryImageFilename(int entry_index, int image_index);

Parameters

entry_indexThe index of the entry, where 0 is the top of the list.
image_indexThe index of the image to retrieve. RSS entries can have multiple images.

Example #

function Update()
{ 
    t = UpdateContext.LocalTime;
    numLayers = Document.GetNumLayers();  
    layer = Document.GetLayer(0);
    layerEndTime = layer.GetEndTime();
    
    rssNode = layer.FindNode("RSSFeed").AsRSSFeedNode();
    textNode = layer.FindNode("MainText");
    imageLoaderNode = layer.FindNode("MainImageLoader");

    numRssEntries = rssNode.GetNumEntries();
    entryIndex = 0;

    entryImageFilename = rssNode.GetEntryImageFilename(entryIndex, 0);
    entryText =  rssNode.GetEntryTitle(entryIndex);

    imageLoaderNode.SetString("Attributes.Filename", entryImageFilename);
    textNode.SetText(entryText);
}