Open XORwell opened 11 years ago
Yeah, I noticed that as well. Unfortunately, resolving relative URLs in feeds is not straight forward (see this comment and these specs). On top of that, the github feed doesn't even follow the specs (see XML below), if I read them correctly.
Anyway, as I see it, this is more of a parser issue that rests with Feedzirra. Although it's the most actively developed RSS parser in Ruby, going by their issue tracker I still wouldn't expect them to move very fast on even a pull request.
Outside of the github feeds, I haven't really encountered relative URLs very often. So I propose to just leave them alone for now.
I might be worthwhile, though, to do something with the @links
attribute (see below), or make the @url
into a more prominent link than a simple "(web)". Suggestions?
<entry>
<id>tag:github.com,2008:WatchEvent/1803628246</id>
<published>2013-08-13T18:06:35Z</published>
<updated>2013-08-13T18:06:35Z</updated>
<link type="text/html" rel="alternate" href="https://github.com/inossidabile/sprockets-preload"/>
<title type="html">XORwell starred inossidabile/sprockets-preload</title>
<author>
<name>XORwell</name>
<uri>https://github.com/XORwell</uri>
</author>
<media:thumbnail height="30" width="30" url="https://secure.gravatar.com/avatar/fd7d9314dab1d1272d1c1ed652a2b5a4?s=30&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"/>
<content type="html"><!-- watch -->
<div class="simple">
<span class="octicon octicon-star"></span>
<div class="title">
<a href="/XORwell">XORwell</a> <span>starred</span> <a href="/inossidabile/sprockets-preload" class="css-truncate css-truncate-target">inossidabile/sprockets-preload</a>
</div>
<div class="time">
<time class="js-relative-date" datetime="2013-08-13T18:06:35Z" title="2013-08-13 18:06:35">August 13, 2013</time>
</div>
</div>
</content>
</entry>
#<Feedzirra::Parser::AtomEntry:0x00000001349b20
@author="XORwell",
@content=
"<!-- watch -->\n<div class=\"simple\">\n <span class=\"octicon octicon-star\"></span>\n\n <div class=\"title\">\n <a href=\"/XORwell\">XORwell</a> <span>starred</span> <a href=\"/inossidabile/sprockets-preload\" class=\"css-truncate css-truncate-target\">inossidabile/sprockets-preload</a>\n </div>\n\n <div class=\"time\">\n <time class=\"js-relative-date\" datetime=\"2013-08-13T18:06:35Z\" title=\"2013-08-13 18:06:35\">August 13, 2013</time>\n </div>\n</div>\n",
@entry_id="tag:github.com,2008:WatchEvent/1803628246",
@links=["https://github.com/inossidabile/sprockets-preload"],
@published=2013-08-13 18:06:35 UTC,
@title="XORwell starred inossidabile/sprockets-preload",
@updated=2013-08-13 18:06:35 UTC,
@url="https://github.com/inossidabile/sprockets-preload"
#>
github for example is using relative paths in hrefs. as result,
Foo starred bar
links to laserchicken/bar instead of github/barrelative links should be replaces with absolutes..