sniffles 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/Gemfile +2 -8
- data/Guardfile +1 -1
- data/README.md +12 -13
- data/lib/sniffles.rb +9 -9
- data/lib/sniffles/html.rb +3 -3
- data/lib/sniffles/sniffers/advertising/adsense.rb +8 -14
- data/lib/sniffles/sniffers/advertising/kontera.rb +6 -6
- data/lib/sniffles/sniffers/analytics/chartbeat.rb +7 -7
- data/lib/sniffles/sniffers/analytics/facebook_insights.rb +7 -7
- data/lib/sniffles/sniffers/analytics/google_analytics.rb +8 -8
- data/lib/sniffles/sniffers/analytics/kissmetrics.rb +7 -7
- data/lib/sniffles/sniffers/analytics/mixpanel.rb +7 -7
- data/lib/sniffles/sniffers/analytics/quantcast.rb +6 -6
- data/lib/sniffles/sniffers/cms/cscart.rb +6 -6
- data/lib/sniffles/sniffers/{advertising/gumgum.rb → cms/ghost.rb} +8 -8
- data/lib/sniffles/sniffers/cms/invision.rb +9 -9
- data/lib/sniffles/sniffers/cms/joomla.rb +7 -7
- data/lib/sniffles/sniffers/cms/movabletype.rb +8 -8
- data/lib/sniffles/sniffers/cms/mybb.rb +6 -6
- data/lib/sniffles/sniffers/cms/phpbb.rb +7 -7
- data/lib/sniffles/sniffers/cms/shopify.rb +7 -7
- data/lib/sniffles/sniffers/cms/tumblr.rb +7 -7
- data/lib/sniffles/sniffers/cms/vanilla.rb +8 -8
- data/lib/sniffles/sniffers/cms/vbulletin.rb +10 -10
- data/lib/sniffles/sniffers/cms/wordpress.rb +12 -12
- data/lib/sniffles/sniffers/{advertising/admeld.rb → cms/xcart.rb} +3 -2
- data/lib/sniffles/sniffers/cms/zencart.rb +6 -6
- data/lib/sniffles/sniffers/javascript/jquery.rb +6 -6
- data/lib/sniffles/text.rb +4 -4
- data/lib/sniffles/version.rb +1 -1
- data/sniffles.gemspec +2 -2
- data/spec/cassettes/beenverified_com.yml +644 -784
- data/spec/cassettes/blackhatworld_com.yml +2298 -3292
- data/spec/cassettes/blog_mixpanel_com.yml +1351 -0
- data/spec/cassettes/community_invisionpower_com.yml +836 -2771
- data/spec/cassettes/cxxvi_com.yml +311 -0
- data/spec/cassettes/demo-store_prestashop_com.yml +897 -813
- data/spec/cassettes/demo_cs-cart_com.yml +2996 -1146
- data/spec/cassettes/demo_oscommerce_com.yml +136 -408
- data/spec/cassettes/digital-photography-school_com.yml +656 -0
- data/spec/cassettes/downlopedia_com.yml +1262 -1321
- data/spec/cassettes/drupal.yml +1540 -1507
- data/spec/cassettes/exprodirect_com.yml +1888 -0
- data/spec/cassettes/facebook_insights.yml +544 -474
- data/spec/cassettes/flatpress_org_home_blog.yml +287 -317
- data/spec/cassettes/foursquare_com.yml +1901 -348
- data/spec/cassettes/geomagik_com.yml +475 -0
- data/spec/cassettes/ghost_org.yml +207 -0
- data/spec/cassettes/google_blogspot_com.yml +574 -1059
- data/spec/cassettes/guistyles_com.yml +705 -1292
- data/spec/cassettes/installatron_com.yml +286 -0
- data/spec/cassettes/invisionmodding_com.yml +1124 -2442
- data/spec/cassettes/joomla.yml +280 -0
- data/spec/cassettes/kissmetrics_com.yml +165 -0
- data/spec/cassettes/lancelhoff_com.yml +637 -0
- data/spec/cassettes/magento.yml +459 -459
- data/spec/cassettes/metafilter_com.yml +1449 -1230
- data/spec/cassettes/movabletype_com_blog.yml +175 -1221
- data/spec/cassettes/ocbfashionjewelry_com.yml +588 -0
- data/spec/cassettes/pandoramoa_com.yml +290 -608
- data/spec/cassettes/pearsonified_com.yml +433 -435
- data/spec/cassettes/phpbb_com.yml +438 -416
- data/spec/cassettes/sitefinity_com.yml +443 -418
- data/spec/cassettes/sixflags_com.yml +560 -1014
- data/spec/cassettes/soulemama_typepad_com.yml +2378 -2581
- data/spec/cassettes/stackoverflow_com.yml +4762 -0
- data/spec/cassettes/staff_tumblr_com.yml +1956 -1658
- data/spec/cassettes/topix_com.yml +1748 -1417
- data/spec/cassettes/wellmedicated_com.yml +801 -0
- data/spec/cassettes/wordpress_com.yml +238 -863
- data/spec/cassettes/xenforo_com.yml +1143 -1933
- data/spec/sniffles/html_spec.rb +6 -6
- data/spec/sniffles/sniffers/advertising/adsense_spec.rb +7 -8
- data/spec/sniffles/sniffers/advertising/buysellads_spec.rb +5 -5
- data/spec/sniffles/sniffers/advertising/casale_spec.rb +5 -5
- data/spec/sniffles/sniffers/advertising/kontera_spec.rb +6 -6
- data/spec/sniffles/sniffers/advertising/thedeck_spec.rb +5 -5
- data/spec/sniffles/sniffers/advertising/tribalfusion_spec.rb +5 -5
- data/spec/sniffles/sniffers/analytics/chartbeat_spec.rb +3 -3
- data/spec/sniffles/sniffers/analytics/clicky_spec.rb +3 -3
- data/spec/sniffles/sniffers/analytics/facebook_insights_spec.rb +6 -6
- data/spec/sniffles/sniffers/analytics/google_analytics_spec.rb +7 -19
- data/spec/sniffles/sniffers/analytics/kissmetrics_spec.rb +5 -5
- data/spec/sniffles/sniffers/analytics/mixpanel_spec.rb +9 -9
- data/spec/sniffles/sniffers/analytics/quantcast_spec.rb +7 -7
- data/spec/sniffles/sniffers/cms/cscart_spec.rb +8 -8
- data/spec/sniffles/sniffers/cms/ghost_spec.rb +18 -0
- data/spec/sniffles/sniffers/cms/invision_spec.rb +9 -9
- data/spec/sniffles/sniffers/cms/joomla_spec.rb +9 -9
- data/spec/sniffles/sniffers/cms/movabletype_spec.rb +8 -8
- data/spec/sniffles/sniffers/cms/mybb_spec.rb +9 -9
- data/spec/sniffles/sniffers/cms/phpbb_spec.rb +8 -8
- data/spec/sniffles/sniffers/cms/shopify_spec.rb +9 -9
- data/spec/sniffles/sniffers/cms/tumblr_spec.rb +7 -7
- data/spec/sniffles/sniffers/cms/vanilla_spec.rb +9 -9
- data/spec/sniffles/sniffers/cms/vbulletin_spec.rb +11 -17
- data/spec/sniffles/sniffers/cms/wordpress_spec.rb +12 -12
- data/spec/sniffles/sniffers/cms/xcart_spec.rb +18 -0
- data/spec/sniffles/sniffers/cms/zencart_spec.rb +9 -9
- data/spec/sniffles/sniffers/javascript/jquery_spec.rb +8 -8
- data/spec/sniffles/sniffers_spec.rb +1 -1
- data/spec/sniffles_spec.rb +17 -17
- data/spec/spec_helper.rb +7 -3
- data/spec/support/helpers.rb +2 -2
- metadata +39 -39
- data/lib/sniffles/sniffers/cms/posterous.rb +0 -28
- data/spec/cassettes/blog_posterous_com.yml +0 -5015
- data/spec/cassettes/demo_forum-software_org_mybb.yml +0 -385
- data/spec/cassettes/forum-software_org_vanilla.yml +0 -223
- data/spec/cassettes/humemes_com.yml +0 -496
- data/spec/cassettes/joomla_org.yml +0 -733
- data/spec/cassettes/orangecrushbeads_com.yml +0 -751
- data/spec/cassettes/shop_angrybirds_com.yml +0 -455
- data/spec/cassettes/softpedia_com.yml +0 -3196
- data/spec/cassettes/squidoo_com.yml +0 -532
- data/spec/cassettes/tmz_com.yml +0 -2927
- data/spec/cassettes/vbulletin_com.yml +0 -2983
- data/spec/cassettes/wundergroud_com.yml +0 -907
- data/spec/sniffles/sniffers/advertising/admeld_spec.rb +0 -17
- data/spec/sniffles/sniffers/advertising/gumgum_spec.rb +0 -18
- data/spec/sniffles/sniffers/cms/posterous_spec.rb +0 -18
@@ -2,23 +2,23 @@ module Sniffles
|
|
2
2
|
module Sniffers
|
3
3
|
class Cscart
|
4
4
|
include HTML
|
5
|
-
|
5
|
+
|
6
6
|
attr_accessor :doc
|
7
7
|
attr_reader :output
|
8
|
-
|
8
|
+
|
9
9
|
def initialize(response_body)
|
10
|
-
@output = {}
|
10
|
+
@output = {}
|
11
11
|
parse(response_body) && process_document
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def process_document
|
15
15
|
@output[:found] = found?
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
private
|
19
19
|
def found?
|
20
20
|
!!(@doc.text =~ /Powered by CS\-Cart/)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
@@ -1,24 +1,24 @@
|
|
1
1
|
module Sniffles
|
2
2
|
module Sniffers
|
3
|
-
class
|
3
|
+
class Ghost
|
4
4
|
include Text
|
5
|
-
|
5
|
+
|
6
6
|
attr_accessor :doc
|
7
7
|
attr_reader :output
|
8
|
-
|
8
|
+
|
9
9
|
def initialize(response_body)
|
10
|
-
@output = {}
|
10
|
+
@output = {}
|
11
11
|
parse(response_body) && process_document
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def process_document
|
15
15
|
@output[:found] = found?
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
private
|
19
19
|
def found?
|
20
|
-
match? /
|
20
|
+
match? /content="Ghost ([\d\.]*)"/
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
@@ -2,34 +2,34 @@ module Sniffles
|
|
2
2
|
module Sniffers
|
3
3
|
class Invision
|
4
4
|
include HTML
|
5
|
-
|
5
|
+
|
6
6
|
attr_accessor :doc
|
7
7
|
attr_reader :output
|
8
|
-
|
8
|
+
|
9
9
|
def initialize(response_body)
|
10
|
-
@output = {}
|
10
|
+
@output = {}
|
11
11
|
parse(response_body) && process_document
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def process_document
|
15
15
|
if @output[:found] = found?
|
16
16
|
parse_version
|
17
17
|
end
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
private
|
21
21
|
def found?
|
22
22
|
!!(copyright_link =~ /Forum Software by IP\.Board/)
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def parse_version
|
26
|
-
version_capture = (copyright_link.match
|
26
|
+
version_capture = (copyright_link.match(/Software by IP\.Board ([\d]+\.[\d]+\.[\d]+)/))
|
27
27
|
@output[:version] = version_capture ? version_capture[1] : false
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def copyright_link
|
31
31
|
text_at("//p[@id='copyright']/a")
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
|
-
end
|
35
|
+
end
|
@@ -2,26 +2,26 @@ module Sniffles
|
|
2
2
|
module Sniffers
|
3
3
|
class Joomla
|
4
4
|
include HTML
|
5
|
-
|
5
|
+
|
6
6
|
attr_accessor :doc
|
7
7
|
attr_reader :output
|
8
|
-
|
8
|
+
|
9
9
|
def initialize(response_body)
|
10
|
-
@output = {}
|
10
|
+
@output = {}
|
11
11
|
parse(response_body) && process_document
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def process_document
|
15
15
|
if @output[:found] = found?
|
16
16
|
parse_version
|
17
17
|
end
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
private
|
21
21
|
def found?
|
22
22
|
!!(meta_generator_content =~ /Joomla!/)
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def parse_version
|
26
26
|
@output[:version] = (meta_generator_content =~ /Joomla! ([\d]+\.[\d]+)/ ? $1 : false)
|
27
27
|
end
|
@@ -31,4 +31,4 @@ module Sniffles
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
34
|
-
end
|
34
|
+
end
|
@@ -2,27 +2,27 @@ module Sniffles
|
|
2
2
|
module Sniffers
|
3
3
|
class Movabletype
|
4
4
|
include HTML
|
5
|
-
|
5
|
+
|
6
6
|
attr_accessor :doc
|
7
7
|
attr_reader :output
|
8
|
-
|
8
|
+
|
9
9
|
def initialize(response_body)
|
10
|
-
@output = {}
|
10
|
+
@output = {}
|
11
11
|
parse(response_body) && process_document
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def process_document
|
15
15
|
@output[:found] = found?
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
private
|
19
19
|
def found?
|
20
|
-
!!(meta_generator_content =~ /
|
20
|
+
!!(meta_generator_content =~ /mt-static/)
|
21
21
|
end
|
22
22
|
|
23
23
|
def meta_generator_content
|
24
|
-
text_at("//
|
24
|
+
text_at("//link[@rel='icon']/@href")
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
28
|
-
end
|
28
|
+
end
|
@@ -2,23 +2,23 @@ module Sniffles
|
|
2
2
|
module Sniffers
|
3
3
|
class Mybb
|
4
4
|
include HTML
|
5
|
-
|
5
|
+
|
6
6
|
attr_accessor :doc
|
7
7
|
attr_reader :output
|
8
|
-
|
8
|
+
|
9
9
|
def initialize(response_body)
|
10
|
-
@output = {}
|
10
|
+
@output = {}
|
11
11
|
parse(response_body) && process_document
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def process_document
|
15
15
|
@output[:found] = found?
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
private
|
19
19
|
def found?
|
20
20
|
!!(@doc.text =~ /Powered By MyBB/)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
@@ -4,24 +4,24 @@ module Sniffles
|
|
4
4
|
include HTML
|
5
5
|
attr_accessor :doc
|
6
6
|
attr_reader :output
|
7
|
-
|
7
|
+
|
8
8
|
def initialize(response_body)
|
9
|
-
@output = {}
|
9
|
+
@output = {}
|
10
10
|
parse(response_body) && process_document
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def process_document
|
14
14
|
@output[:found] = found?
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
private
|
18
18
|
def found?
|
19
19
|
@doc.text.include?("Powered by phpBB") && phpbb_meta?
|
20
|
-
end
|
21
|
-
|
20
|
+
end
|
21
|
+
|
22
22
|
def phpbb_meta?
|
23
23
|
!@doc.xpath("//meta[@name='resource-type']").empty? && !@doc.xpath("//meta[@name='distribution']").empty?
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
27
|
-
end
|
27
|
+
end
|
@@ -2,23 +2,23 @@ module Sniffles
|
|
2
2
|
module Sniffers
|
3
3
|
class Shopify
|
4
4
|
include Text
|
5
|
-
|
5
|
+
|
6
6
|
attr_accessor :doc
|
7
7
|
attr_reader :output
|
8
|
-
|
8
|
+
|
9
9
|
def initialize(response_body)
|
10
|
-
@output = {}
|
10
|
+
@output = {}
|
11
11
|
parse(response_body) && process_document
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def process_document
|
15
15
|
@output[:found] = found?
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
private
|
19
19
|
def found?
|
20
|
-
match?
|
20
|
+
match?(/cdn\.shopify\.com/)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
@@ -2,23 +2,23 @@ module Sniffles
|
|
2
2
|
module Sniffers
|
3
3
|
class Tumblr
|
4
4
|
include Text
|
5
|
-
|
5
|
+
|
6
6
|
attr_accessor :doc
|
7
7
|
attr_reader :output
|
8
|
-
|
8
|
+
|
9
9
|
def initialize(response_body)
|
10
|
-
@output = {}
|
10
|
+
@output = {}
|
11
11
|
parse(response_body) && process_document
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def process_document
|
15
15
|
@output[:found] = found?
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
private
|
19
19
|
def found?
|
20
|
-
match?(/assets\.tumblr\.com\/
|
20
|
+
match?(/assets\.tumblr\.com\/assets/) && match?(/<!-- BEGIN TUMBLR CODE -->/)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
@@ -1,24 +1,24 @@
|
|
1
1
|
module Sniffles
|
2
2
|
module Sniffers
|
3
3
|
class Vanilla
|
4
|
-
include
|
5
|
-
|
4
|
+
include HTML
|
5
|
+
|
6
6
|
attr_accessor :doc
|
7
7
|
attr_reader :output
|
8
|
-
|
8
|
+
|
9
9
|
def initialize(response_body)
|
10
|
-
@output = {}
|
10
|
+
@output = {}
|
11
11
|
parse(response_body) && process_document
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def process_document
|
15
15
|
@output[:found] = found?
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
private
|
19
19
|
def found?
|
20
|
-
|
20
|
+
text_match?('//a[@href="http://vanillaforums.org/"]/text()', 'Vanilla Forums')
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
@@ -2,31 +2,31 @@ module Sniffles
|
|
2
2
|
module Sniffers
|
3
3
|
class Vbulletin
|
4
4
|
include HTML
|
5
|
-
|
5
|
+
|
6
6
|
attr_accessor :doc
|
7
7
|
attr_reader :output
|
8
|
-
|
8
|
+
|
9
9
|
def initialize(response_body)
|
10
|
-
@output = {}
|
10
|
+
@output = {}
|
11
11
|
parse(response_body) && process_document
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def process_document
|
15
15
|
if @output[:found] = found?
|
16
16
|
parse_version
|
17
17
|
parse_feed
|
18
18
|
end
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
private
|
22
22
|
def found?
|
23
23
|
!!(js_initialization? || meta_generator_content =~ /vBulletin/)
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def parse_feed
|
27
27
|
@output[:feed] = text_at("//link[@type='application/rss+xml']/@href")
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def parse_version
|
31
31
|
if meta_generator_content
|
32
32
|
@output[:version] = (meta_generator_content.match(/([\d]+\.[\d]+\.[\d]+)/) ? $1 : false)
|
@@ -34,14 +34,14 @@ module Sniffles
|
|
34
34
|
@output[:version] = false
|
35
35
|
end
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def meta_generator_content
|
39
39
|
text_at("//meta[@name='generator']/@content")
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
def js_initialization?
|
43
43
|
@doc.xpath("//script[contains(text(),'vBulletin_init()')]").any?
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
47
|
-
end
|
47
|
+
end
|
@@ -4,12 +4,12 @@ module Sniffles
|
|
4
4
|
include HTML
|
5
5
|
attr_accessor :doc
|
6
6
|
attr_reader :name, :group, :output, :response
|
7
|
-
|
7
|
+
|
8
8
|
def initialize(response_body)
|
9
|
-
@output = {}
|
9
|
+
@output = {}
|
10
10
|
parse(response_body) && process_document
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def process_document
|
14
14
|
if @output[:found] = found?
|
15
15
|
parse_version
|
@@ -18,37 +18,37 @@ module Sniffles
|
|
18
18
|
parse_pingback
|
19
19
|
end
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
private
|
23
23
|
def found?
|
24
24
|
@doc.xpath('//link[contains(@href,"wp-content")]').any?
|
25
|
-
end
|
26
|
-
|
25
|
+
end
|
26
|
+
|
27
27
|
def parse_feed
|
28
28
|
@output[:feed] = text_at("//link[@rel='alternate' and @type='application/rss+xml']/@href")
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
def parse_theme
|
32
32
|
theme_uri = text_at("//link[@rel='stylesheet' and contains(@href,'wp-content/themes/')][1]/@href")
|
33
33
|
@output[:theme] = (theme_uri ? clean_theme_uri(theme_uri)[1] : false)
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
def parse_version
|
37
37
|
version_meta_tag = text_at("//meta[@name='generator']/@content")
|
38
38
|
@output[:version] = (version_meta_tag ? extract_version(version_meta_tag)[1] : version_meta_tag)
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
def parse_pingback
|
42
42
|
@output[:pingback] = text_at("//link[@rel='pingback']/@href")
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
def clean_theme_uri(uri)
|
46
46
|
/wp-content\/themes\/([^\/]*)\//i.match uri
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
def extract_version(string)
|
50
50
|
/([\d]+\.[\d]+[\.]?[\d]?)/.match string
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
54
|
-
end
|
54
|
+
end
|