Tag: Feedjira/解析
feed = Feedjira::Feed.fetch_and_parse(feed_url)
def fetch_and_parse(url) response = connection(url).get unless response.success? raise FetchFailure, "Fetch failed - #{response.status}" end feed = parse response.body feed.feed_url = url feed.etag = response.headers['etag'].to_s.delete '"' feed.last_modified = parse_last_modified(response) feed end