Class: Snackhack2::SiteMap
- Inherits:
-
Object
- Object
- Snackhack2::SiteMap
- Defined in:
- lib/snackhack2/sitemap.rb
Instance Method Summary collapse
-
#initialize(site) ⇒ SiteMap
constructor
A new instance of SiteMap.
- #run ⇒ Object
Constructor Details
#initialize(site) ⇒ SiteMap
Returns a new instance of SiteMap.
5 6 7 |
# File 'lib/snackhack2/sitemap.rb', line 5 def initialize(site) @site = site end |
Instance Method Details
#run ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/snackhack2/sitemap.rb', line 9 def run sm = Snackhack2::get(File.join(@site, "sitemap.xml")) if sm.code == 200 if !sm.body.include?("Not Found") Snackhack2::file_save(@site, "site.xml", sm.body) else puts "[+] Eh. I don't think the site has a sitemap. Manually check just in case... :(\n\n" end else puts "[+] Status Code: #{sm.code}" end end |