ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Magpie RSS/Atom Parser 1.4 and ISO-8859-1 character encoding

November 16, 2011 11:00am

Subscribe [2]
  • #1 / Nov 16, 2011 11:00am

    mathalete

    86 posts

    EE 1.6.8
    Magpie parser 1.4

    Hi there,

    I’m trying to use the in-built Magpie RSS/Atom Parser to call a third party XML feed.

    I’m getting encoding errors when trying to call the following file:

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <rss version="2.0" xmlns:job="http://:../../webrecRSS.dtd">
    <channel>
        <title>search form results</title>
        <link></link>
        <description></description>
        <item>
            <title>Finance Officer</title>
            <link> http://:/ETREC107GF.open?VACANCY_ID=24017407K2&WVID=35584105Xh</link>
            <guid> http://:/ETREC107GF.open?VACANCY_ID=24017407K2&WVID=35584105Xh</guid>
            <description><![CDATA[<b>Reference:</b> 
    <b>Description:</b> The main responsibility of the Receptionist is to present an efficient and friendly front line image of Link to the public and to provide a high level of service to Link Housing, Link Group and Link Living staff.
    The post holder will have a good standard of education.
    Link offers excellent terms and conditions, and as an Investor in People and Healthy Working Lives Gold Award holder, we aim to provide a wide range of development opportunities and healthy living initiatives. You'll work with colleagues who offer support to ensure our customers' expectations are met. In return, we are looking for applications from people who will contribute to our aims and work to the highest professional standards.
    Further Info:-
    Job Description
    Person Specification
    <b>Region:</b> Link Group
    <b>Location:</b> Edinburgh
    <b>Salary:</b> £20,000 to £25,000
    <b>Package:</b> Full time, 35 hours per week Monday to Friday ]]></description>
            <job:description>The main responsibility of the Receptionist is to present an efficient and friendly front line image of Link to the public and to provide a high level of service to Link Housing, Link Group and Link Living staff.
    The post holder will have a good standard of education.
    Link offers excellent terms and conditions, and as an Investor in People and Healthy Working Lives Gold Award holder, we aim to provide a wide range of development opportunities and healthy living initiatives. You'll work with colleagues who offer support to ensure our customers' expectations are met. In return, we are looking for applications from people who will contribute to our aims and work to the highest professional standards.
    Further Info:-
    Job Description
    Person Specification</job:description>
            <job:reference></job:reference>
            <job:salary>£20,000 to £25,000</job:salary>
            <job:salaryval></job:salaryval>
            <job:minsalary></job:minsalary>
            <job:maxsalary></job:maxsalary>
            <job:category>Finance</job:category>
            <job:closingdate>Fri, 25 Nov 2011 00:00:00 GMT</job:closingdate>
            <job:region>Link Group</job:region>
            <job:location>Edinburgh</job:location>
            <job:package>Full time, 35 hours per week Monday to Friday</job:package>
            Wed, 16 Nov 2011 00:00:00 GMT</pubDate>
        </item>
    </channel>
    </rss>


    I enclose my code attempting to call the file below :

    <!doctype html>
    <html lang="en-us" class="no-js">
    <head>
      <meta charset="utf-8">
      
      <title dir="ltr">Testing.</title>
    
      
    </head>
    <body>
    <h1>Testing feed</h1>
    
    {exp:magpie url="http://jobsrss35584105xh.xml" limit="3" refresh="720" feed_type="RSS" feed_version="2.0" encoding="ISO-8859-1" convert_encoding="y"}
    
    
    <ul>
    {magpie:items}
    <li><a href="http://{magpie:link}">{magpie:title}</a></li>
    {/magpie:items}
    </ul>
    {/exp:magpie}
    
    </body>
    </html>

    If I change the character encoding of the xml file to UTF-8 (on a static test file), the parsing works fine.
    However presently using ISO-8859-1 is causing parsing errors - and unfortunately I can change the encoding on the 3rd party source.

    What do I need to change to get this work?

    BEst
    Peter.

  • #2 / Nov 17, 2011 7:56am

    mathalete

    86 posts

    Hmm… the plot thickens..

    In Google Chrome I’m getting the following error >

    Warning: MagpieRSS: Failed to fetch <a href="http://mywebsite.com/ttrain_webrecruitment/jobsrss35584105xh.xml">http://mywebsite.com/ttrain_webrecruitment/jobsrss35584105xh.xml</a>. (HTTP Error: connection failed () in /usr/local/psa/home/vhosts/mywebsite.com/subdomains/folder/httpdocs/folder/plugins/pi.magpie.php on line 1390
    
    Notice: Trying to get property of non-object in /usr/local/psa/home/vhosts/xxxx.co.uk/subdomains/folder/httpdocs/folder/plugins/pi.magpie.php on line 105
    
    Warning: ob_start() [ref.outcontrol]: output handler 'ob_gzhandler' cannot be used after 'URL-Rewriter' in /usr/local/psa/home/vhosts/mywebsite.com/subdomains/folder/httpdocs/folder/core/core.output.php on line 388

    in Firefox it tells me this

    Content Encoding Error
          
          
    The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
            
    
    Please contact the web site owners to inform them of this problem.
  • #3 / Nov 17, 2011 1:11pm

    Kevin Smith

    4784 posts

    Hi mathalete,

    I’m sorry to see you’re having such trouble with the Magpie plugin. Let me confirm a few things in order to best help you out. Are you using this Magpie plugin, the one supported by EllisLab? The reason I ask is because the version number is different from the version you said you were using, and the syntax is different. With the first-party plugin, you should be using {title} and {items} rather than {magpie:title} and {magpie:items}.

    If you fix the syntax issues, does it work properly? If not, could you upgrade your EE installation to the latest version of EE 1 (which is 1.7.1 as of now) along with the latest version of the first-party Magpie plugin?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases