1

I am trying to pull the first thumbnail image of an RSS item with magpie, but it returns all them in one string if there multiple images in the item.

RSS code:

     <multimedia>
    <media type="photo">
        <link>http://media.jrn.com/images/K0008499127--75534.JPG</link>
        <thumbnail>http://media.jrn.com/images/300*377/K0008499127--75534.JPG</thumbnail>
        <caption>State Rep. Joe Armstrong, D-Knoxville</caption>
        <credit></credit>
        <share_url>http://www.knoxnews.com/news/local/armstrong-indictment-inspires-cigarette-tax-legislation-275a5dc9-badf-3a5d-e053-0100007ffa4a-363078641.html</share_url>
    </media>
    <media type="photo">
        <link>http://media.jrn.com/images/mccormick_1436280885241_20971671_ver1.0_640_480.jpg</link>
        <thumbnail>http://media.jrn.com/images/300*213/mccormick_1436280885241_20971671_ver1.0_640_480.jpg</thumbnail>
        <caption>House Majority Leader Gerald McCormick, R-Chattanooga, addresses the House chamber in Nashville on Wednesday, April 22, 2015.</caption>
        <credit>Associated Press/Times Free Press</credit>
        <share_url>http://www.knoxnews.com/news/local/armstrong-indictment-inspires-cigarette-tax-legislation-275a5dc9-badf-3a5d-e053-0100007ffa4a-363078641.html</share_url>
    </media>
    </multimedia>

The magpie debugger returns the two images like this:

["multimedia_media_thumbnail"]=>
  string(145) "http://media.jrn.com/images/300*377/K0008499127--75534.JPGhttp://media.jrn.com/images/300*213/mccormick_1436280885241_20971671_ver1.0_640_480.jpg"

How to I get just the first image URL of multimedia_media_thumbnail?

jacklail
  • 21
  • 1

0 Answers0