<xsl:text>https://facebook.com</xsl:text>
</xsl:variable>
+ <!--
+ Extract the page id from an element like:
+ <meta property="al:android:url" content="fb://page/793837197390834">
+
+ The page id will be used to build the permalink.
+ -->
+ <xsl:variable
+ name="page-id"
+ select="substring-after(//meta[@property='al:android:url']/@content, 'fb://page/')"/>
+
<xsl:template match="//div[contains(@class, 'userContentWrapper')]">
+ <xsl:variable name="story-id" select=".//input[@name='ft_ent_identifier']/@value"/>
<xsl:variable name="item-content" select=".//div[contains(@class, 'userContent')]"/>
- <xsl:variable name="item-permalink" select="concat($BaseURL, .//a[@target='']/@href)"/>
+ <xsl:variable
+ name="item-permalink"
+ select="concat($BaseURL, '/permalink.php?id=', $page-id, '&story_fbid=', $story-id)"/>
+
<item>
<title>
<xsl:variable name="item-title" select="$item-content/p"/>