derat / nitter-rss-proxy

Moved to codeberg.org/derat/nitter-rss-proxy
https://codeberg.org/derat/nitter-rss-proxy
BSD 3-Clause "New" or "Revised" License
11 stars 3 forks source link

><p> in feeds from twitter for spaces #6

Closed sajiljosephs closed 1 year ago

sajiljosephs commented 1 year ago

<p> in feeds from twitter for spaces Config: format := flag.String("format", "atom", Feed format to write ("atom", "json", "rss")) With all the feed formats it is giving one or the other invalid characters Eg:

<p>Minister <a href="
derat commented 1 year ago

I think your comment might've gotten mangled or truncated. Could you try entering it again here? Please include the command that you're running and the timeline where you're seeing the problem.

sajiljosephs commented 1 year ago

I have installed the default application with "go install" and ran the application with "go run main.go" on my local machine and from the browser accessed http://127.0.0.1:8080/micronautfw Result: <p>📖 Micronaut Guide - Building a Docker Image of your Micronaut application <a href="https://hubs.li/Q01C5_gy0&#34;&gt;hubs.li/Q01C5_gy0&lt;/a&gt; <a href="http://nitter.kylrth.com/search?q=%23micronaut&#34;&gt;#micronaut&lt;/a&gt;&lt;/p&gt;&lt;br&gt;&lt;img src="http://nitter.kylrth.com/pic/card_img%2F1625168817239252995%2FGWx-UU1f%3Fformat%3Djpg%26name%3D800x419&#34; style="max-width:250px;" />

All the spaces have come with different invalid characters which isn't usable

image

derat commented 1 year ago

How are you trying to read the feed that's served by nitter-rss-proxy?

In the screenshot that you shared, characters like < and > are escaped to &lt; and &gt; (they're from HTML embedded inside XML), and whichever RSS reader you're using should be unescaping it before rendering the original HTML. See e.g. https://stackoverflow.com/questions/1398571/html-inside-xml-should-i-use-cdata-or-encode-the-html.

You can pass -format rss if you want a <content:encoded> tag that uses CDATA to embed unescaped HTML:

% nitter-rss-proxy -format rss -user micronautfw
...
    <item>
      <title>The Micronaut Foundation is excited to announce the release of Micronaut Framew…</title>
      <link>https://twitter.com/micronautfw/status/1608167744746168321</link>
      <description>&lt;p&gt;The Micronaut Foundation is excited to announce the release of Micronaut Framework 3.8.0! Please see our latest blog post for more details. &lt;a href=&#34;https://hubs.li/Q01wDVgG0&#34;&gt;hubs.li/Q01wDVgG0&lt;/a&gt; &lt;a href=&#34;https://nitter.weiler.rocks/search?q=%23micronaut&#34;&gt;#micronaut&lt;/a&gt;&lt;/p&gt;&lt;br&gt;&lt;img src=&#34;https://pbs.twimg.com/media/FlFcCqJX0AM4g8z?format=png&#34; style=&#34;max-width:250px;&#34; /&gt;</description>
      <content:encoded><![CDATA[<p>The Micronaut Foundation is excited to announce the release of Micronaut Framework 3.8.0! Please see our latest blog post for more details. <a href="https://hubs.li/Q01wDVgG0">hubs.li/Q01wDVgG0</a> <a href="https://nitter.weiler.rocks/search?q=%23micronaut">#micronaut</a></p><br><img src="https://pbs.twimg.com/media/FlFcCqJX0AM4g8z?format=png" style="max-width:250px;" />]]></content:encoded>
      <author>@micronautfw</author>
      <guid>https://twitter.com/micronautfw/status/1608167744746168321</guid>
      <pubDate>Wed, 28 Dec 2022 18:27:23 +0000</pubDate>
    </item>

But all of this should be handled for you automatically by whatever feed reader or feed-parsing library you're using to consume the data from nitter-rss-proxy.

sajiljosephs commented 1 year ago

Also will this proxy be able to handle 1000+ users without any memory issue ? Do we need to make any changes for it ?

derat commented 1 year ago

It's just a proxy, so it only allocates memory while it's proxying a request. Your bigger concern will be getting rate-limited or blocked by the Nitter instances that the proxy is configured to talk to. If you're planning to handle a lot of traffic, you should run your own Nitter instance and not use this proxy.