From: Antonio Ospite <ao2@ao2.it>
Date: Mon, 11 Sep 2017 11:17:31 +0000 (+0200)
Subject: rss_converter_facebook.com.xsl: fix scraping facebook.com pages once again
X-Git-Tag: v1.2.0~12
X-Git-Url: https://git.ao2.it/tweeper.git/commitdiff_plain/ea51103d9e33e0445bd5cbbf0f65273fa335c3b5?hp=e825e4202ca664beca2b41cc2b5ff51fbee81996

rss_converter_facebook.com.xsl: fix scraping facebook.com pages once again

Tip: in order to get more posts, and not just the last two, append
"/posts" to the facebook page URL, or use the URL of the "See all" link
in the "Posts" section.
---

diff --git a/src/rss_converter_facebook.com.xsl b/src/rss_converter_facebook.com.xsl
index def8e69..0750b30 100644
--- a/src/rss_converter_facebook.com.xsl
+++ b/src/rss_converter_facebook.com.xsl
@@ -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') or contains(@class, 'userContentWrapper')]">
+    <xsl:template match="//div[contains(@class, 'fbUserPost')]">
         <xsl:variable name="story-id" select=".//input[@name='ft_ent_identifier']/@value"/>
         <xsl:variable
             name="item-permalink"
@@ -106,8 +106,8 @@
 
     <xsl:template match="/">
         <xsl:variable name="channel-title" select="//title"/>
-        <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"/>
+        <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"/>
 
         <rss version="2.0">
             <xsl:attribute name="xml:base"><xsl:value-of select="$BaseURL" /></xsl:attribute>
@@ -135,7 +135,7 @@
                         <xsl:value-of select="$channel-image"/>
                     </url>
                 </image>
-                <xsl:apply-templates select="//div[contains(@class, 'fbUserContent') or contains(@class, 'userContentWrapper')]"/>
+                <xsl:apply-templates select="//div[contains(@class, 'fbUserPost')]"/>
             </channel>
         </rss>
     </xsl:template>