0

The Magpie plugin for EE1 doesn't seem to like https addresses, it was working fine but now the site where the feed is located have switched to https for everything and now Magpie is not getting new data. I tried changing the url in the template code but it fails completely, leading me to believe that it can't handle the secure address. Any options appreciated, I have 4 sites still on EE1 that can't afford to be updated to EE2.

3
  • I usually harp about upgrading, but instead I'd like to make a suggestion. Perhaps you could offer some work exchange for these out-of-date customers/sites; they buy an upgrade license and you offer a certain amount of free work beyond your normal contribution. I mean no offense, I gather that you do a lot of voluntary work, and that you do this for the good of the client. It's only going to get harder the longer their sites remain so many left-of-the-dot versions behind.
    – jrothafer
    Dec 19 '15 at 4:39
  • I just tried the built-in feed parser with EE 3, and it still doesn't handle https feeds correctly, i.e. it fails silently. Will be filing bug report / feature request with EllisLab.
    – Ingmar
    Dec 19 '15 at 8:21
  • Update, this might be a problem with my local setup. I've written it up here: expressionengine.stackexchange.com/questions/35092/…
    – Ingmar
    Dec 19 '15 at 8:39
1

I had the same problem.

The solution is simple, you must update the "Snoopy" class (HTTP client) in the pi.magpie.php file.

The last release of Snoopy can be found here: https://sourceforge.net/projects/snoopy/

You just have to make a copy-paste-replace and change the name of the class: M_Snoopy() instad of Snoopy.

Regards from France

1
  • By use the latest Snoopy.class.php to update magpie/extlib/Snoopy.class.inc, I can now access https RSS without class name change. Thanks! Apr 23 '18 at 2:42
0

For a quick work-around, you could write a quick PHP script that fetches the external URL over HTTPS and spits it back out over HTTP. You could save this as "https-workaround.php", and prepend the new HTTPS urls in your template with "http://yourdomain.example.com/some-folders/https-workaround.php?feed=" and you should be all set. If it throws an error, it could very well be the same PHP issue that's preventing the add-on from working, and, correcting it may fix it without the need for using this new script.

<?php
if(!isset($_GET['feed'])){
    echo "Error: no feed URL was provided. Please include the url of the feed you'd like to decode, e.g. " . $_SERVER['PHP_SELF'] . "?feed=http://www.example.com/feed.xml" ;
    die();
}else{

    // Need this for XML or some services return data in a JSON format instead
    $context = stream_context_create(array(
        'http' => array(
            'method' => 'GET',
            'header' => "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"                               
        )
    ));

    // Grab the URL specified by ?feed= and fetch it with our HTML/XML only headers
    $fileContents = file_get_contents($_GET['feed'], false, $context);

    // Output the feed
    echo $fileContents;
}
1
  • Thanks for trying to help Nick. I think I did everything right but it still fails. The error I was getting was: Strict Standards: Non-static method Magpie::usage() should not be called statically, assuming $this from incompatible context in /public_html/admin/plugins/pi.magpie.php on line 29 I think I just need to get the site updated to EE2, but that's takes time, which I don't have at the moment.
    – Paul Frost
    Aug 19 '15 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.