rss_converter_facebook.com.xsl: match both the new and the old wrapper class
authorAntonio Ospite <ao2@ao2.it>
Wed, 8 Mar 2017 08:20:01 +0000 (09:20 +0100)
committerAntonio Ospite <ao2@ao2.it>
Wed, 8 Mar 2017 08:20:01 +0000 (09:20 +0100)
Facebook still seems to use the "userContentWrapper" sometimes, it's not
clear if "fbUserContent" was only used for a short period of time or if
both are actually used; in the doubt support both.

src/rss_converter_facebook.com.xsl

index fc4f272..def8e69 100644 (file)
@@ -52,7 +52,7 @@
         name="page-id"
         select="substring-after(//meta[@property='al:android:url']/@content, 'fb://page/')"/>
 
-    <xsl:template match="//div[contains(@class, 'fbUserContent')]">
+    <xsl:template match="//div[contains(@class, 'fbUserContent') or contains(@class, 'userContentWrapper')]">
         <xsl:variable name="story-id" select=".//input[@name='ft_ent_identifier']/@value"/>
         <xsl:variable
             name="item-permalink"
 
     <xsl:template match="/">
         <xsl:variable name="channel-title" select="//title"/>
-        <xsl:variable name="channel-link" select="//div[contains(@class, 'fbUserContent')][1]//a[1]/@href"/>
-        <xsl:variable name="channel-image" select="//div[contains(@class, 'fbUserContent')][1]//a[1]//img/@src"/>
+        <xsl:variable name="channel-link" select="//div[contains(@class, 'fbUserContent') or contains(@class, 'userContentWrapper')][1]//a[1]/@href"/>
+        <xsl:variable name="channel-image" select="//div[contains(@class, 'fbUserContent') or contains(@class, 'userContentWrapper')][1]//a[1]//img/@src"/>
 
         <rss version="2.0">
             <xsl:attribute name="xml:base"><xsl:value-of select="$BaseURL" /></xsl:attribute>
                         <xsl:value-of select="$channel-image"/>
                     </url>
                 </image>
-                <xsl:apply-templates select="//div[contains(@class, 'fbUserContent')]"/>
+                <xsl:apply-templates select="//div[contains(@class, 'fbUserContent') or contains(@class, 'userContentWrapper')]"/>
             </channel>
         </rss>
     </xsl:template>