YouTube Connector 12.12

# Example Configure Script

The following example illustrates the `configure_atom.lua` script.

    function getConfigOptions()
       return {
          SSLMethod="SSLV23",
       }
    end

    function getNamespaces()
       return {
          atom="http://www.w3.org/2005/Atom"
       }
    end

    function getDateFormats()
       return { "YYYY-MM-DDTHH:NN:SS" }
    end

    -- ################ FEED URL ################

    function getFeedUrls()
       local config = get_config()
       local section = get_param("SECTION")
       local url = config:getValue(section, "FEEDURL", "")
       return { url };
    end

    -- ################ FEED ################

    function getFeedModifiedDateXPath()
       cache_result()
       return "/atom:feed/atom:updated"
    end

    function getEntryXPaths()
       cache_result()
       return { "/atom:feed/atom:entry" }
    end

    function getNextUrlXPaths()
       cache_result()
       return { "/atom:feed/atom:link[@rel='next']/@href" }
    end

    -- ################ ENTRIES ################

    function getEntryIdXPath()
       cache_result()
       return "~/atom:id"
    end

    function getEntryModifiedDateXPath()
       cache_result()
       return "~/atom:updated"
    end

    function getEntryMetadataXPaths()
       cache_result()
       return {
           ID="~/atom:id",
           URL="~/atom:link[@rel='alternate']/@href",
           DRETITLE="~/atom:title[@type='text']",
           AUTHOR="~/atom:author/atom:name",
           PUBLISHED_DATE="~/atom:published",
           UPDATED_DATE="~/atom:updated",
       }
    end

    function getEntryContentUrlXPath()
       cache_result()
       return "~/atom:content[starts-with(@src,http)]/@src"
    end

    function getEntryContentXPath()
       cache_result()
       return "~/atom:content"
    end

© Copyright 2022 Micro Focus or one of its affiliates
Version 12.12 | Last updated June 2022

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to swpdl.idoldocsfeedback@microfocus.com.

We appreciate your feedback!

Product: IDOL YouTube Connector 12.12

Topic Title: Example Configure Script