Search

I’m trying to import a twitter feed but the date isn’t showing, take a look at the pubDate in the screenshot (you’ll have to ‘View Image’ to see it properly), it greyed out as if its part of text node.

Any idea what the problem is here?

Twitter Feed Error

I think that’s just the syntax highlighter being dumb.

Are you attempting to format the pubDate in to something more readable? For that, you’ll need to convert it using a utility like this one:

I have it working on another site, I’ve copied the code over exactly but I’m just getting NaN back

Here’s how I’m calling the templates

<xsl:call-template name="time-ago">
    <xsl:with-param name="date-and-time">
        <xsl:call-template name="format-from-rfc-to-iso">
            <xsl:with-param name="rfc-date" select="data/twitter/rss/channel/item/pubDate"/>
        </xsl:call-template>
    </xsl:with-param>
</xsl:call-template>

Do you see the plain value when using a value-of?

<xsl:value-of select="data/twitter/rss/channel/item/pubDate"/>

In what context are you calling the above template? Can we see your full XSLT? The XPath query to the date element might be wrong.

Hi Nick, I tried value-of there and it printed it fine, mongo for not doing that before, I’m blaming the 12 hour work days. Here’s the XSLT:

<div id="twitter" class="pane">
    <div class="pane-head">
        <h4>twitter</h4>
        <a href="http://twitter.com/redkingtkd">Follow Us</a>
    </div>
    <div class="pane-body">
        <p class="tweet">
            <xsl:call-template name="linkahashify">
                <xsl:with-param name="tweet" select="substring-after(data/twitter/rss/channel/item/description,'redkingtkd: ')"/>
            </xsl:call-template>
        </p>
        <p class="meta">
            <xsl:call-template name="time-ago">
                <xsl:with-param name="date-and-time">
                    <xsl:call-template name="format-from-rfc-to-iso">
                        <xsl:with-param name="rfc-date" select="data/twitter/rss/channel/item/pubDate"/>
                    </xsl:call-template>
                </xsl:with-param>
            </xsl:call-template>
        </p>
    </div>
</div>

And just calling the format-from-rfc-to-iso template, what does that yield?

<xsl:call-template name="format-from-rfc-to-iso">
    <xsl:with-param name="rfc-date" select="data/twitter/rss/channel/item/pubDate"/>
</xsl:call-template>

From the description of the RSS feed RFC date format to ISO date format utility, I’m not sure whether it returns both the date and time…

It just returns the date.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details