0

I have this code, where I pick RSS-feed from a web-site. The idea is, that every monday, on each week, the RSS-feed changes in the website. What is the most easiest way to update the RSS in my code automatically? I'm using JavaScript and XML in my project.

Thanks in advance

EDIT: Posting the current code;

    <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
    <title></title>

    <!-- <description></description>
    <link>http://www.sodexo.fi/</link>
    <language>fi</language>
    <copyright>Sodexo</copyright>
    <pubDate>Mon, 17 Apr 2017 12:00:00 +0300</pubDate>
    <lastBuildDate>Mon, 17 Apr 2017 12:00:00 +0300</lastBuildDate>
    <generator>sxomenuoutput</generator>
    <ttl>60</ttl> -->

    <atom:link href="http://www.sodexo.fi/ruokalistat/rss/weekly_rss/873/fi" rel="self" type="application/rss+xml"/>
    <item>
    <title></title>
    <description>

    <![CDATA[

// Content that changes each week.

     ]]> 
    </description>

    <!-- <link>http://www.sodexo.fi/frami</link> -->
    <guid isPermaLink="false">http://www.sodexo.fi/frami/1492376400</guid>
    <!--<pubDate>Mon, 17 Apr 2017 12:00:00 +0300</pubDate>
    <source url="http://www.sodexo.fi/">Sodexo.fi</source> -->

    </item>
    </channel>
    </rss>

To clarify; The content that is located inside of CDATA, changes each week. is there way to automatically update the changes inside my code?

Cod3r-b0ss
  • 205
  • 1
  • 10
  • Sharing your research helps everyone. Tell us what you've tried and why it didn't meet your needs. This demonstrates that you've taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer! Also see [how to ask](http://stackoverflow.com/questions/how-to-ask) – Cerbrus May 02 '17 at 06:53
  • I don't fully understand want you want to achieve. Do you want to get notified when an RSS feed from another site changes? – gus27 May 02 '17 at 06:55
  • 1
    Accidentally published without pasting the code. Code is added now. – Cod3r-b0ss May 02 '17 at 07:02
  • Your question is addressed in http://stackoverflow.com/questions/10943544/how-to-parse-an-rss-feed-using-javascript – Kung Fu Panda May 02 '17 at 07:03
  • You write "The content that is located inside of CDATA, changes each week". Who is generating the content? Isn't the code you provided the code that you generated/wrote? If not, please show us your code. – gus27 May 02 '17 at 07:11
  • @gus27 The website which provides open RSS-feed also provides the content inside CDATA. – Cod3r-b0ss May 02 '17 at 07:17
  • So you want to provide an own RSS feed containing content from another (external) RSS feed? – gus27 May 02 '17 at 07:18
  • @gus27 I just want to show the content from the CDATA in my own page. – Cod3r-b0ss May 02 '17 at 07:36
  • Please show us your code where you read in the RSS feed. – gus27 May 02 '17 at 08:45

1 Answers1

-2

platform? every monday update Rss? website Cross domain?

if not cross domain, use ajax update when loading page

if cross domain, use your program(C#, python ...) or tools(curl, wget ...) get RSS data, setup schedue to update, return from api to page.

OS Task tool: windows: Task Scheduler linux: crontab

Vin
  • 97
  • 4
  • 2
    This looks more like a collection of buzz words than like an explanation on how to solve a problem. – gus27 May 02 '17 at 07:14