Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Photos missing from RSS #674

Closed
aaronpk opened this issue Feb 3, 2024 · 5 comments
Closed

Photos missing from RSS #674

aaronpk opened this issue Feb 3, 2024 · 5 comments

Comments

@aaronpk
Copy link

aaronpk commented Feb 3, 2024

Mastodon RSS feed puts photos in a <media:content url=""> tag, which doesn't appear to be recognized by granary.

Example XML:

    <item>
      <guid isPermaLink="true">https://mamot.fr/@nhoizey/111866417349105396</guid>
      <link>https://mamot.fr/@nhoizey/111866417349105396</link>
      <pubDate>Sat, 03 Feb 2024 07:41:05 +0000</pubDate>
      <description>&lt;p&gt;🔗 “Where have all the flowers gone?” by &lt;span class="h-card" translate="no"&gt;&lt;a href="https://mastodon.social/@davatron5000" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank"&gt;@&lt;span&gt;davatron5000&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="https://mamot.fr/tags/IndieWeb" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank"&gt;#&lt;span&gt;IndieWeb&lt;/span&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;⚓️ &lt;a href="https://nicolas-hoizey.com/links/2024/01/19/where-have-all-the-flowers-gone/" rel="nofollow noopener noreferrer" translate="no" target="_blank"&gt;&lt;span class="invisible"&gt;https://&lt;/span&gt;&lt;span class="ellipsis"&gt;nicolas-hoizey.com/links/2024/&lt;/span&gt;&lt;span class="invisible"&gt;01/19/where-have-all-the-flowers-gone/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <media:content url="https://files.mastodon.social/cache/media_attachments/files/111/866/417/384/185/248/original/875edd3105e4e08b.png" type="image/png" fileSize="97310" medium="image">
        <media:rating scheme="urn:simple">nonadult</media:rating>
        <media:description type="plain">Screenshot of Where have all the flowers gone?</media:description>
      </media:content>
      <category>indieweb</category>
    </item>

JSONFeed conversion from Granary:

{
"author": {
"name": "#indieweb",
"url": "https://mastodon.social/tags/indieweb"
},
"content_html": "Screenshot of Where have all the flowers gone?",
"date_published": "2024-02-03T07:41:05+00:00",
"id": "https://mamot.fr/@nhoizey/111866417349105396",
"url": "https://mamot.fr/@nhoizey/111866417349105396"
}
@snarfed
Copy link
Owner

snarfed commented Feb 3, 2024

Interesting, thanks for filing! I'm not familiar with whatever XML namespace media: is from, but I'll take a look.

@snarfed
Copy link
Owner

snarfed commented Feb 4, 2024

Mastodon's root RSS element w/namespaces is:

<rss version="2.0" xmlns:webfeeds="http://webfeeds.org/rss/1.0" xmlns:media="http://search.yahoo.com/mrss/">
@snarfed
Copy link
Owner

snarfed commented Feb 4, 2024

Also granary is overriding the actual content in <description> with the image's alt text in <media:description type="plain"> 😕.

@snarfed
Copy link
Owner

snarfed commented Feb 4, 2024

Oh we don't parse any images out of RSS at all yet. 🤷

@snarfed snarfed closed this as completed in db0880d Feb 4, 2024
@snarfed
Copy link
Owner

snarfed commented Feb 4, 2024

Done! New example JSON Feed output from https://mstdn.social/@ElleGray.rss :

    {
      "content_html": "<p>look we don't need to be competitive about our hummingbirds I'm just saying mine can joust</p>",
      "date_published": "2024-02-04T18:12:26+00:00",
      "id": "https://mstdn.social/@ElleGray/111874562251028805",
      "image": "https://media.mstdn.social/media_attachments/files/111/874/561/315/706/387/original/4b5673cfb159a20f.jpg",
      "url": "https://mstdn.social/@ElleGray/111874562251028805"
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants