With basic Odysseus processing capabilities, an RSS feed can be read and processed.

The following provides an example to the Tageeschau RSS feed

 

#PARSER PQL
#ADDQUERY
#DEFINE URL http://www.tagesschau.de/xml/rss2/
out = CACHE({
          maxelements = 200
        },
        CHANGEDETECT({
            attr=['guid']                  
          },
          TIMESTAMPORDERVALIDATE(TIMESTAMP({
                start='pubDate',
                dateformat='EEE, d MMM yyyy HH:mm:ss Z',
                locale='EN'                                    
              },
              CONVERTER({
                  protocol='XML',
                  inputdatahandler='Document',
                  outputdatahandler='tuple',
                  options=[
                    ['xpaths','/rss/channel/item/title;/rss/channel/item/link;/rss/channel/item/pubDate;/rss/channel/item/description;/rss/channel/item/guid'],
                    ['reverse','true']
                  ],
                  schema=[
                    ['title', 'String'],
                    ['links', 'String'],
                    ['pubDate','String'],
                    ['description','String'],
                    ['guid','String']
                  ]                                                                          
                },
                ACCESS({
                    source='${URL}',
                    wrapper='GenericPull',
                    transport='HTTP',
                    protocol='Document',
                    datahandler='Document',
                    options=[
                      ['uri', '${URL}'],
                      ['method', 'get'],
                      ['scheduler.delay','50000']
                    ]                                                                                                            
                  }                                                                                          
                )                                          
              )                                     
            )                        
          )              
        )            
      )
  • No labels