nvd_feed_api

Ruby code posted by noraj
created at 03 Jan 17:43

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
# Initialize the scraper.
s = NVDFeedScraper.new
# Scrap the NVD website to get the feeds attributes.
s.scrap
# Change the default feed storage location beacause default value is '/tmp/'.
# '/tmp/' is mounted as tmpFS and is cleaned at every start.
# This will considerably speed up your performance is you have to reboot.
NVDFeedScraper::Feed.default_storage_location = "/home/shark/Dev/cve_feeds"
# Create a {Feed} object for all available feeds
s.feeds(s.available_feeds).each do |f|
  # and for each one download the JSON file and fill the attributes.
  f.json_pull
end
587 Bytes in 2 ms with coderay