<p>There's no current way for Feed Me to handle this I'm afraid. My best suggestion would be to write a module to fetch the XML from your first URL, parse that, find the <code>&lt;link&gt;</code> note, fetch and parse that, and output the XML. You'd then point Feed Me to that URL, with the actual content of the feed that's required.</p>
<p>It could be a Craft module, a standalone PHP script, or even JS - whatever you're comfortable work.</p>
<p>It's a bit of extra work, but custom development would be the only option for the moment.</p>
<p>EDIT: The other option you could create a template (let's say <code>my-feed.xml</code>) in your templates directory with:</p>
<pre><code>{% header &quot;Content-Type: application/xml;&quot; %}

{% set params = {
    url: 'http://path.to/feed/',
    type: 'xml',
} %}

{% set feed = craft.feedme.feed(params) %}

{% for node in feed %}
    {# Find the node that contains the link #}
    {% set link = node.myLinkNode %}

    {# Get the raw data and output it #}
    {% set xml = craft.feedme.getDataTypes().getRawData(link) %}

    {{ xml }}
</code></pre>

CC BY-SA 4.0
2021-01-22T00:15:23.413Z
I see, could you give me a very quick summary on how you would solve this with JS? No code, just a few words to push me in the right direction. I was hoping that I could create a separate feed and save the xml as an asset, but it looks like Feed Me only handles image files.
Håvard LJ
CC BY-SA 4.0
2021-01-22T02:38:07.663Z
When I mention JS, I'm probably referring to server-side JS with Node, doing the same thing, fetching, parsing, then fetching, parsing again. Any language you'd be comfortable with, but just needs to be a "middle-man" between your original feed and Feed Me. I've also just added another method above
crawf
CC BY-SA 4.0
2021-01-22T09:18:33.703Z
Is craft.feedme.getDataTypes().getRawData() something that should work out of the box?
Håvard LJ
CC BY-SA 4.0
2021-01-21T23:44:18.887Z
2021-01-22T02:50:35.767Z
2021-01-22T02:50:35.767Z
crawf
<p>I have just started using Feed me to import a festival schedule, and I have run into an issue with how their API is set up. The URL I have to use for the feed (with the token) outputs only a <code>&lt;link&gt;URL.xml&lt;/link&gt;</code> to a temporary XML-file with a unique filename each time. So there's pretty much a feed inside the feed. Any way of getting Feed Me to look at the linked XML-file, or any other suggestions on how to solve this?</p>

<plugin-feedme>
Feed Me: Feed inside the feed
# Feed Me: Feed inside the feed

(Asked by: username_0 on 2021-01-21)

I have just started using Feed me to import a festival schedule, and I have run into an issue with how their API is set up. The URL I have to use for the feed (with the token) outputs only a `URL.xml` to a temporary XML-file with a unique filename each time. So there's pretty much a feed inside the feed. Any way of getting Feed Me to look at the linked XML-file, or any other suggestions on how to solve this?

**Tags:** plugin-feedme

---

## 1 answers

### Answer by username_1 on 2021-01-21. Score: 3 | Accepted answer

There's no current way for Feed Me to handle this I'm afraid. My best suggestion would be to write a module to fetch the XML from your first URL, parse that, find the  note, fetch and parse that, and output the XML. You'd then point Feed Me to that URL, with the actual content of the feed that's required.
It could be a Craft module, a standalone PHP script, or even JS - whatever you're comfortable work.
It's a bit of extra work, but custom development would be the only option for the moment.
EDIT: The other option you could create a template (let's say my-feed.xml) in your templates directory with:
{% header "Content-Type: application/xml;" %}

{% set params = {
    url: 'http://path.to/feed/',
    type: 'xml',
} %}

{% set feed = craft.feedme.feed(params) %}

{% for node in feed %}
    {# Find the node that contains the link #}
    {% set link = node.myLinkNode %}

    {# Get the raw data and output it #}
    {% set xml = craft.feedme.getDataTypes().getRawData(link) %}

    {{ xml }}

> **Comments:**
> **username_0**: I see, could you give me a very quick summary on how you would solve this with JS? No code, just a few words to push me in the right direction. I was hoping that I could create a separate feed and save the xml as an asset, but it looks like Feed Me only handles image files.  
> **username_1**: When I mention JS, I'm probably referring to server-side JS with Node, doing the same thing, fetching, parsing, then fetching, parsing again. Any language you'd be comfortable with, but just needs to be a "middle-man" between your original feed and Feed Me. I've also just added another method above  
> **username_0**: Is craft.feedme.getDataTypes().getRawData() something that should work out of the box?  

---

