CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/anemone/extractors/meta_refresh.rb
Views: 1904
1
class Anemone::Extractors::MetaRefresh < Anemone::Extractors::Base
2
3
def run
4
doc.search( "//meta[@http-equiv='refresh']" ).map do |url|
5
begin
6
_, url = url['content'].split( ';', 2 )
7
next if !url
8
unquote( url.split( '=', 2 ).last )
9
rescue
10
next
11
end
12
end
13
rescue
14
nil
15
end
16
17
def unquote( str )
18
[ '\'', '"' ].each do |q|
19
return str[1...-1] if str.start_with?( q ) && str.end_with?( q )
20
end
21
str
22
end
23
24
end
25
26