Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
Hello all, I asked a question about RSS feeds back in November 2018 (thank you Trendoman for your reply) - and it all went quiet from the client and nothing ever happened about it - https://www.couchcms.com/forum/viewtopic.php?f=2&t=11915&hilit=rss+feed&sid=f54368fdfe5ddc0161b63afda5bfeaf6#p32322

The subject has now been resurrected and the requirement is for a musician's Couch website to receive an Atom feed to allow the schedule of concerts to be automatically updated i.e. without any need to log in to the Admin Panel to add new cloned pages to engagements.php

The Atom feed would supply details of engagements and some sort of background processing would take each engagement from the feed to generate a new cloned engagements.php page.

The feed would look like this:
Code: Select all
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom">
  <title>Performances</title>
  <subtitle></subtitle>
  <link href="" rel="self"/>
  <link href=""/>
  <updated></updated>
  <author><name>Overture</name></author>
  <id>2020-02-152020-08-1520042874</id>

 
      <entry>
         <title>15/02/2020 15:00 TITLE GOES HERE</title>
         <id>XXXXXXXX</id>
         <updated>20200215T150000</updated>
         <end>20200215T160000</end>
         <summary>SUMMARY GOES HERE</summary>
         <eventname>EVENT NAME GOES HERE</eventname>
         <address>ADDRESS GOES HERE</address>
         <artist>ARTIST GOES HERE</artist>
         <venue>VENUE GOES HERE</venue>
         <time>15:00</time>
         <dirigent></dirigent>
         <conductor>CONDUCTOR GOES HERE</conductor>
         <orchester></orchester>
         <orchestra>ORCHESTRA GOES HERE</orchestra>
         <soloist></soloist>
         <programme>PROGRAMME GOES HERE</programme>
         <link>URL GOES EHRE</link>
         <latitude>57.483722</latitude>
         <longitude>12.077079</longitude>
      </entry>


  </feed>


I have looked at the Couch docs and the bit on RSS feeds seems to be all about outgoing feeds. Is there an easy way for me to handle this incoming data? Has anybody else achieved such a feature on their Couch site? Would appreciate any advice!
I take it, you'd like to hear from other members.. It would be great if there is already an easy (couch) way to read incoming XML files, similar to what CSV Importer does with tag <cms:csv_reader>.

Anyway, the process would include (a) fetch the source (b) read the fetched source (c) create unique cloned pages with that data. The last part is the easiest - just use <cms:db_persist> tag. Parts a & b (mostly b) are what you are looking for in terms of ready-made solutions. Part (b) should be simple enough, because PHP itself already has the functions to deal with XML files and the only job would be to wrap those functions into new couch tags, either to put xml content into couch array-like variable or, similar to <cms:csv_reader>, put xml content into couch variables in context. I am sure, anyone who created couch tags or <cms:func> functions would see the opportunity here.
2 posts Page 1 of 1