Ref #52 RSS url detection

This commit is contained in:
erwanlr
2012-12-20 17:46:06 +01:00
parent 221068ef1b
commit c0a05a4119
3 changed files with 62 additions and 1 deletions

View File

@@ -93,7 +93,7 @@ module WebSite
def homepage_hash
unless @homepage_hash
@homepage_hash = WebSite.page_hash(self.url)
@homepage_hash = WebSite.page_hash(@uri.to_s)
end
@homepage_hash
end
@@ -106,4 +106,11 @@ module WebSite
end
@error_404_hash
end
# Will try to find the rss url in the homepage
# Only the first one found iw returned
def rss_url
homepage_body = Browser.instance.get(@uri.to_s).body
homepage_body[%r{<link .* type="application/rss\+xml" .* href="([^"]+)" />}, 1]
end
end