rss_converter_facebook.com.xsl: fix scraping facebook.com pages once again
authorAntonio Ospite <ao2@ao2.it>
Mon, 6 Nov 2017 16:53:42 +0000 (17:53 +0100)
committerAntonio Ospite <ao2@ao2.it>
Mon, 6 Nov 2017 16:53:42 +0000 (17:53 +0100)
Add back support for 'userContentWrapper' which seems to be still used.

src/rss_converter_facebook.com.xsl

index 0750b30..283549c 100644 (file)
@@ -52,7 +52,7 @@
         name="page-id"
         select="substring-after(//meta[@property='al:android:url']/@content, 'fb://page/')"/>
 
         name="page-id"
         select="substring-after(//meta[@property='al:android:url']/@content, 'fb://page/')"/>
 
-    <xsl:template match="//div[contains(@class, 'fbUserPost')]">
+    <xsl:template match="//div[contains(@class, 'fbUserStory') or contains(@class, 'userContentWrapper')]">
         <xsl:variable name="story-id" select=".//input[@name='ft_ent_identifier']/@value"/>
         <xsl:variable
             name="item-permalink"
         <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:template match="/">
         <xsl:variable name="channel-title" select="//title"/>
-        <xsl:variable name="channel-link" select="//div[contains(@class, 'fbUserPost')][1]//a[1]/@href"/>
-        <xsl:variable name="channel-image" select="//div[contains(@class, 'fbUserPost')][1]//a[1]//img/@src"/>
+        <xsl:variable name="channel-link" select="//div[contains(@class, 'fbUserStory') or contains(@class, 'userContentWrapper')][1]//a[1]/@href"/>
+        <xsl:variable name="channel-image" select="//div[contains(@class, 'fbUserStory') 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>
 
         <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:value-of select="$channel-image"/>
                     </url>
                 </image>
-                <xsl:apply-templates select="//div[contains(@class, 'fbUserPost')]"/>
+                <xsl:apply-templates select="//div[contains(@class, 'fbUserStory') or contains(@class, 'userContentWrapper')]"/>
             </channel>
         </rss>
     </xsl:template>
             </channel>
         </rss>
     </xsl:template>