@@ -54,7 +54,6 @@ def build_error_feed(message:, title: 'Error')
5454 # Build an access denied RSS feed
5555 # @param url [String] The denied URL
5656 # @return [String] Valid RSS XML
57- # rubocop:disable Metrics/MethodLength
5857 def build_access_denied_feed ( url )
5958 title = 'Access Denied'
6059 description = 'This URL is not allowed for public auto source generation.'
@@ -71,46 +70,49 @@ def build_access_denied_feed(url)
7170 ]
7271 )
7372 end
74- # rubocop:enable Metrics/MethodLength
7573
7674 ##
7775 # Build an empty feed warning RSS
7876 # @param url [String] The URL that failed to extract content
7977 # @param strategy [String] The strategy that was used
8078 # @param site_title [String, nil] Extracted site title
8179 # @return [String] Valid RSS XML
82- # rubocop:disable Metrics/MethodLength
8380 def build_empty_feed_warning ( url :, strategy :, site_title : nil )
8481 display_title = site_title ? "#{ site_title } - Content Extraction Issue" : 'Content Extraction Issue'
85- description = <<~DESC
86- Unable to extract content from #{ url } using #{ strategy } strategy.
87- The site may use JavaScript, have anti-bot protection, or have a
88- structure that's difficult to parse.
89- DESC
90-
91- item_description = "No content could be extracted from #{ url } . This could be due to:
92- • JavaScript-heavy site (try browserless strategy)
93- • Anti-bot protection
94- • Complex page structure
95- • Site blocking automated requests
96-
97- Try a different strategy or contact the site administrator."
98-
9982 build_rss_feed (
10083 title : display_title ,
101- description : description ,
84+ description : empty_feed_description ( url , strategy ) ,
10285 link : url ,
10386 items : [
10487 {
10588 title : 'Content Extraction Failed' ,
106- description : item_description ,
89+ description : empty_feed_item_description ( url ) ,
10790 link : url ,
10891 pubDate : Time . now . rfc2822
10992 }
11093 ]
11194 )
11295 end
113- # rubocop:enable Metrics/MethodLength
96+
97+ def empty_feed_description ( url , strategy )
98+ <<~DESC
99+ Unable to extract content from #{ url } using #{ strategy } strategy.
100+ The site may use JavaScript, have anti-bot protection, or have a
101+ structure that's difficult to parse.
102+ DESC
103+ end
104+
105+ def empty_feed_item_description ( url )
106+ <<~DESC
107+ No content could be extracted from #{ url } . This could be due to:
108+ • JavaScript-heavy site (try browserless strategy)
109+ • Anti-bot protection
110+ • Complex page structure
111+ • Site blocking automated requests
112+
113+ Try a different strategy or contact the site administrator.
114+ DESC
115+ end
114116
115117 def build_channel_content ( xml , title , description , link )
116118 xml . title title . to_s
0 commit comments