We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30128
    • 78 Posts
    Thanks but that didn’t help for this specific feed (and I have several others on my ’want-list’ that use RDF too), I still get the lone > character. My guess is that it is actually PHP’s "taking care of" that messes it up smiley

    When I look at the raw code in Opera, it’a actually a whole web-page:
    Content-Type: multipart/alternative; boundary=----------iv6XD1HIQKMdvAykArFUYa
    MIME-Version: 1.0
    From: Nemi <>
    Message-ID: <[email protected]>
    Subject: Nemi for 2006-10-07
    Date: Sat, 07 Oct 2006 01:00:00 +0100
    X-Opera-Content-Hash: 502ff104f40e271d9119b25433a9dcdc
    
    ------------iv6XD1HIQKMdvAykArFUYa
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: 8bit
    
    _________________________________________________________________
    
    Article:
    * http://spray.nettavisen.no/kultur/tegneserie/nemi/nemi_pop.jsp?lastShown=07.10.06
    ------------iv6XD1HIQKMdvAykArFUYa
    Content-Type: text/html; charset=utf-8
    Content-Transfer-Encoding: 8bit
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <base href="http://atheos.de/funnies/nemi.rdf">
    <style type="text/css">
    div.feedEntryLinks
    {
        margin: 0;
        padding: 0;
    }
    div.feedEntryLinks > hr
    {
        clear: both;
    }
    div.feedEntryLinks > h1
    {
        font-size: 100%;
        font-style: italic;
        font-weight: normal;
        margin: 0;
        padding: 0;
    }
    ul.feedEntryAlternateLinks, ul.feedEntryRelatedLinks, ul.feedEntryViaLinks, ul.feedEntryEnclosureLinks
    {
        margin: 0.5em 0;
        padding: 0;
    }
    div.feedEntryLinks li
    {
      margin: 0 1em;
      padding: 0;
    }
    </style>
    
    <title>Nemi for 2006-10-07</title>
    </head>
    <body class="feedEntryBody">
    <div class="feedEntryContent">
    <img src="http://spray.nettavisen.no/shared/nemi/img/07.10.06.gif" border="0" />
    </div>
    <div class="feedEntryLinks">
    <hr>
    <h1>Article:</h1>
    <ul class="feedEntryAlternateLinks">
    <li><a href="http://spray.nettavisen.no/kultur/tegneserie/nemi/nemi_pop.jsp?lastShown=07.10.06">http://spray.nettavisen.no/kultur/tegneserie/nemi/nemi_pop.jsp?lastShown=07.10.06</a></li>
    </ul>
    </div>
    </body>
    </html>
    
    ------------iv6XD1HIQKMdvAykArFUYa--


    If this is not just something done by Opera’s internal handling, I may actually need regexp search for the img tag to fetch the src content.
      • 14050
      • 788 Posts
      That fixed the problem for me. Now it outputs nicely for html. Take a look at the first entry here:

      http://www.cmssandbox.com/MODx095/index.php?id=57

      Would it be possible to have it output the text, but html decoded as SimplePie and FireFox do:

      Instead of making a clickable link called "Google" like the above example shows, it outputs:

      <a href="http://www.google.com">Google</a>

      Maybe make this a parameter? I think the first option should be the default. Also, would it be possible to make certain text found in feeds automatically clickable? Like when parsing the <content> element on the Google Calendar feed, it would convert instances "www.blah.com" and "http://www.blah.com" into clickable links?
        Jesse R.
        Consider trying something new and extraordinary.
        Illinois Wine

        Have you considered donating to MODx lately?
        Donate now. Every contribution helps.
        • 14050
        • 788 Posts
        One last question. I am still having trouble with the &sortElements parameter. What would the parameter look like if I wanted to sort a Google Calender feed by its start time?

        &sortElements=`ENTRY(GD:WHEN|STARTTIME DESC)` is what I was trying. Although it doesn’t seem to work as the sorting doesn’t change if I change from ASC to DESC and vice versa.
          Jesse R.
          Consider trying something new and extraordinary.
          Illinois Wine

          Have you considered donating to MODx lately?
          Donate now. Every contribution helps.
          • 15987
          • 786 Posts
          jesse,
          just add &orderby=starttime&sortorder=a to your google calendar feed url. you can find all of the params here:

          http://code.google.com/apis/calendar/reference.html#Parameters
            • 1932
            • 137 Posts
            @jesster444:

            You need to replace the colons in the &sortElements parameter: &sortElements=`ENTRY(GD|WHEN|STARTTIME DESC)`

            What do you mean decoded? You want it to strip html tags, or convert back to entities? Should be dooable with PHx. Again, clickable link conversion can be done using PHx. If you can make a good case to include them as parameters I can add the options, but I want to keep the snippet as light as possible (yet functional).

            @Tjalve: It shouldn’t be rendering a full page, I tried the rdf feed link you posted and it worked fine:
            http://brianstanback.com/feedx.html
              • 30128
              • 78 Posts
              Ah sorry I didn’t see there were new code too, just copied the new snippet txt. Thx a ton, it worked laugh
                • 1932
                • 137 Posts
                Sweet, glad it’s workin laugh

                By the way, PHx comes with the FeedX snippet and is automatically loaded if it is not already installed globally within MODx. Custom PHx modifiers will work even with FeedX’s built-in PHx support.
                  • 15987
                  • 786 Posts
                  Brian,
                  One quick thing I noticed while integrating this into GoogleEvents. If the method getData is called directly the config parameter &cachType is ignored and the cache file is created and used on successive calls. Not a big deal, just makes testing a little more difficult.

                    • 1932
                    • 137 Posts
                    @Kyle,
                    I could add an option to disable caching altogether but figured setting the cacheTime to 1 second would suffice. Currently cacheType only controls whether the rendered output or just the parsed XML data is cached. I’m more than happy to add the option to disable it altogether would be beneficial...
                      • 15987
                      • 786 Posts
                      Ah, sorry... I didn’t read the docs on what cacheType was, I thought it turned off the caching. I can just set the time to 1 like you said, that is easy enough.

                      Thanks,
                      Kyle