willpublicmedia / npr-api-expressionengine

Access the NPR API from within ExpressionEngine.
1 stars 1 forks source link

Correct pushed image structure #39

Open areynold opened 3 years ago

areynold commented 3 years ago

Story api uses the following structure for images:

<image id="1046523944" type="primary" width="200" src="https://media.npr.org/assets/img/2021/10/15/302---kieran-culkin---macall-b_wide-fc9f81334c7ef88afc81ad8fbb8ba9c00c184c4d.jpg?s=12" hasBorder="false">
    <title>Roman (Kieran Culkin) is trying to figure out where to put his loyalties.</title>
    <caption>Roman (Kieran Culkin) is trying to figure out where to put his loyalties.</caption>
    <link url=""/>
    <producer>Macall Polay</producer>
    <provider url="">HBO</provider>
    <copyright/>
    <enlargement src="https://media.npr.org/assets/img/2021/10/15/302---kieran-culkin---macall-b_wide-fc9f81334c7ef88afc81ad8fbb8ba9c00c184c4d.jpg">
        <caption/>
    </enlargement>
    <crop type="standard" src="https://media.npr.org/assets/img/2021/10/15/302---kieran-culkin---macall-b-4497d7e4bd85d06b3bdee42dd1c55b80e0f9de82.jpg" height="1278" width="1705"/>
    <crop type="square" src="https://media.npr.org/assets/img/2021/10/15/302---kieran-culkin---macall-b_sq-ea30fd2e0509f33e668e89473e2be061b9db6b87.jpg" height="958" width="958"/>
    <crop type="wide" src="https://media.npr.org/assets/img/2021/10/15/302---kieran-culkin---macall-b_wide-fc9f81334c7ef88afc81ad8fbb8ba9c00c184c4d.jpg" height="1025" width="1823" primary="true"/>
    <crop type="enlargement" src="https://media.npr.org/assets/img/2021/10/15/302---kieran-culkin---macall-b_wide-fc9f81334c7ef88afc81ad8fbb8ba9c00c184c4d.jpg" height="1025" width="1823"/>
</image>

Parent tag should have type="primary" and width="200".

The featured image should be a crop type of the parent, and should have the attribute primary="true".