stefansundin / rssbox

:newspaper: I consume the world via RSS feeds, and this is my attempt to keep it that way.
https://github.com/stefansundin/rssbox/discussions/64
GNU Affero General Public License v3.0
763 stars 73 forks source link

RSS unaltered titles entries #9

Closed sn-o-w closed 3 years ago

sn-o-w commented 5 years ago

Hey there. Is it possible to have unaltered titles entries?

E.g., for YouTube (maybe other services too?) to have two tags like < original-title > and < title > for the entries within a feed? I don't really need the duration of a livestream and "(started)"/"(completed)". If your awesome RSSbox will show me original titles as well, that would be nice.

stefansundin commented 5 years ago

Hi!

There is no way to opt-out of this at the moment. Most RSS readers support the native YouTube feeds, e.g. https://www.youtube.com/feeds/videos.xml?channel_id=UCkIfUg5-SkgtXXLqOAjiWsA

These feeds are cleaner and might be what you are looking for. RSSBox will take you to these feeds if you use the normal submit button and not the Live item in the dropdown.

Since you are asking for a non-standard tag such as <original-title>, it makes me think you are programmatically parsing the feed?

sn-o-w commented 5 years ago

Yeah, I know. But YouTube's normal and default RSS is sometimes stupid and doesn't show the current livestreams a/o videos uploaded.

Using your "Live" thing for YouTube is working well, but I would like to have the original title, not an altered one. Having two tags like < original-title > and < title > would help me to choose which one I need (I use a RSS bot and I prefer the original title for the entries of the feed). Or let it be just showing original title and nothing else added to it.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/stefansundin"><img src="https://avatars.githubusercontent.com/u/1991151?v=4" />stefansundin</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>I created a branch for you with the change you want. <a href="https://github.com/stefansundin/rssbox/tree/cristisilaghi">https://github.com/stefansundin/rssbox/tree/cristisilaghi</a></p> <pre><code class="language-diff">diff --git a/views/youtube_feed.erb b/views/youtube_feed.erb index f425afa..b1d0aa9 100644 --- a/views/youtube_feed.erb +++ b/views/youtube_feed.erb @@ -40,7 +40,7 @@ <entry> <id>youtube:video:<%= video["id"] %><%= id_extra %><%= ":#{params[:cachebuster]}" if params[:cachebuster] %></id> - <title><%= title.esc %></title> + <title><%= video["snippet"]["title"].to_line.esc %></title> <link href="https://www.youtube.com/watch?v=<%= video["id"] %>" /> <updated><%= updated %></updated> <author><name><%= @username.esc %></name></author></code></pre> <p>You can create your own Heroku app that runs it if you do the following:</p> <ul> <li>Create Heroku account. <a href="https://www.heroku.com/">https://www.heroku.com/</a> <ul> <li>You can host one app for free.</li> </ul></li> <li>Create Google developer project, enable the YouTube API, and get an API key. See <a href="https://github.com/stefansundin/rssbox#google">https://github.com/stefansundin/rssbox#google</a></li> <li>Click this link to deploy the branch: <a href="https://heroku.com/deploy?template=https://github.com/stefansundin/rssbox/tree/cristisilaghi">https://heroku.com/deploy?template=https://github.com/stefansundin/rssbox/tree/cristisilaghi</a> <ul> <li>Input your Google API key in the <code>GOOGLE_API_KEY</code> field.</li> </ul></li> </ul> <p>Anyway, you can fork the repo and do whatever you want, and deploy changes to your own Heroku app.</p> <p>I don't know what RSS bot you are using, but perhaps it is simpler to just have it query the YouTube API directly. It may be even easier. Basically all the code you need to look at are these lines: <a href="https://github.com/stefansundin/rssbox/blob/a2977bad4562ea1726bb899b44572564a319f534/app.rb#L237-L264">https://github.com/stefansundin/rssbox/blob/a2977bad4562ea1726bb899b44572564a319f534/app.rb#L237-L264</a></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/sn-o-w"><img src="https://avatars.githubusercontent.com/u/2406819?v=4" />sn-o-w</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>I use Discord.RSS on several Discord servers. And I can customize the feed's text message, I can choose which tags I need, what info to display.</p> <p>I had a look at YT API v3, but it seems it doesn't work as RSS. And default YT's RSS is not working well. As I said earlier, YT's RSS sometimes will not publish new video/livestreams.</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>