serpscan 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +82 -0
  6. data/Rakefile +1 -0
  7. data/lib/serpscan.rb +16 -0
  8. data/lib/serpscan/account.rb +8 -0
  9. data/lib/serpscan/api.rb +48 -0
  10. data/lib/serpscan/errors.rb +3 -0
  11. data/lib/serpscan/keyword.rb +10 -0
  12. data/lib/serpscan/search_engine.rb +6 -0
  13. data/lib/serpscan/search_engine_country.rb +21 -0
  14. data/lib/serpscan/serpscan_child_object.rb +23 -0
  15. data/lib/serpscan/serpscan_object.rb +68 -0
  16. data/lib/serpscan/utilities.rb +18 -0
  17. data/lib/serpscan/version.rb +3 -0
  18. data/lib/serpscan/website.rb +16 -0
  19. data/serpscan.gemspec +30 -0
  20. data/spec/fixtures/vcr_cassettes/Serpscan_Keyword/it_should_behave_like_a_creatable_object/should_return_object_after_creation.yml +52 -0
  21. data/spec/fixtures/vcr_cassettes/Serpscan_Keyword/it_should_behave_like_a_deletable_object/should_return_true_after_delete.yml +86 -0
  22. data/spec/fixtures/vcr_cassettes/Serpscan_Keyword/it_should_behave_like_a_findable_object/should_return_a_value_for_alltime_change.yml +46 -0
  23. data/spec/fixtures/vcr_cassettes/Serpscan_Keyword/it_should_behave_like_a_findable_object/should_return_a_value_for_current_rank.yml +46 -0
  24. data/spec/fixtures/vcr_cassettes/Serpscan_Keyword/it_should_behave_like_a_findable_object/should_return_a_value_for_day_change.yml +46 -0
  25. data/spec/fixtures/vcr_cassettes/Serpscan_Keyword/it_should_behave_like_a_findable_object/should_return_a_value_for_id.yml +46 -0
  26. data/spec/fixtures/vcr_cassettes/Serpscan_Keyword/it_should_behave_like_a_findable_object/should_return_a_value_for_initial_rank.yml +46 -0
  27. data/spec/fixtures/vcr_cassettes/Serpscan_Keyword/it_should_behave_like_a_findable_object/should_return_a_value_for_phrase.yml +46 -0
  28. data/spec/fixtures/vcr_cassettes/Serpscan_Keyword/it_should_behave_like_a_findable_object/should_return_a_value_for_search_engine_country_id.yml +46 -0
  29. data/spec/fixtures/vcr_cassettes/Serpscan_Keyword/it_should_behave_like_a_findable_object/should_return_a_value_for_search_volume.yml +46 -0
  30. data/spec/fixtures/vcr_cassettes/Serpscan_Keyword/it_should_behave_like_a_findable_object/should_return_a_value_for_week_change.yml +46 -0
  31. data/spec/fixtures/vcr_cassettes/Serpscan_SearchEngine/it_should_behave_like_a_findable_object/should_return_a_value_for_countries.yml +46 -0
  32. data/spec/fixtures/vcr_cassettes/Serpscan_SearchEngine/it_should_behave_like_a_findable_object/should_return_a_value_for_id.yml +46 -0
  33. data/spec/fixtures/vcr_cassettes/Serpscan_SearchEngine/it_should_behave_like_a_findable_object/should_return_a_value_for_title.yml +46 -0
  34. data/spec/fixtures/vcr_cassettes/Serpscan_SearchEngine/it_should_behave_like_a_listable_object/should_return_an_array_of_Serpscan_SearchEngine_objects.yml +46 -0
  35. data/spec/fixtures/vcr_cassettes/Serpscan_SearchEngine/it_should_behave_like_a_listable_object/should_return_an_array_of_objects.yml +46 -0
  36. data/spec/fixtures/vcr_cassettes/Serpscan_Website/create_keyword/should_return_a_keyword_object.yml +96 -0
  37. data/spec/fixtures/vcr_cassettes/Serpscan_Website/it_should_behave_like_a_creatable_object/should_return_object_after_creation.yml +51 -0
  38. data/spec/fixtures/vcr_cassettes/Serpscan_Website/it_should_behave_like_a_deletable_object/should_return_true_after_delete.yml +86 -0
  39. data/spec/fixtures/vcr_cassettes/Serpscan_Website/it_should_behave_like_a_findable_object/should_return_a_value_for_id.yml +46 -0
  40. data/spec/fixtures/vcr_cassettes/Serpscan_Website/it_should_behave_like_a_findable_object/should_return_a_value_for_url.yml +46 -0
  41. data/spec/fixtures/vcr_cassettes/Serpscan_Website/it_should_behave_like_a_listable_object/should_return_an_array_of_Serpscan_Website_objects.yml +46 -0
  42. data/spec/fixtures/vcr_cassettes/Serpscan_Website/it_should_behave_like_a_listable_object/should_return_an_array_of_objects.yml +46 -0
  43. data/spec/fixtures/vcr_cassettes/Serpscan_Website/keywords/should_return_a_paginated_array_of_keyword_objects.yml +663 -0
  44. data/spec/fixtures/vcr_cassettes/Serpscan_Website/keywords/should_return_an_array_of_keyword_objects.yml +90 -0
  45. data/spec/lib/serpscan/keyword_spec.rb +8 -0
  46. data/spec/lib/serpscan/search_engine_spec.rb +6 -0
  47. data/spec/lib/serpscan/website_spec.rb +32 -0
  48. data/spec/spec_helper.rb +24 -0
  49. data/spec/support/shared_examples/creatable.rb +7 -0
  50. data/spec/support/shared_examples/deletable.rb +7 -0
  51. data/spec/support/shared_examples/findable.rb +9 -0
  52. data/spec/support/shared_examples/listable.rb +7 -0
  53. metadata +240 -0
@@ -0,0 +1,86 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:5055/api/v1/keywords/1?token=123
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: 'OK '
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ X-Ua-Compatible:
24
+ - IE=Edge
25
+ Etag:
26
+ - '"227c5fa24bcc8a2adac7353eae5b60df"'
27
+ Cache-Control:
28
+ - max-age=0, private, must-revalidate
29
+ X-Request-Id:
30
+ - 7b465c281e6f9404297b8934ce642967
31
+ X-Runtime:
32
+ - '0.023961'
33
+ Server:
34
+ - WEBrick/1.3.1 (Ruby/1.9.3/2013-01-15)
35
+ Date:
36
+ - Sun, 22 Feb 2015 20:41:41 GMT
37
+ Content-Length:
38
+ - '185'
39
+ Connection:
40
+ - Keep-Alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"id":1,"phrase":"example keyword","current_rank":1,"initial_rank":100,"day_change":"+99","week_change":"+99","alltime_change":"+99","search_volume":"1000","search_engine_country_id":1}'
44
+ http_version:
45
+ recorded_at: Sun, 22 Feb 2015 20:41:41 GMT
46
+ - request:
47
+ method: delete
48
+ uri: http://localhost:5055/api/v1/keywords/1?token=123
49
+ body:
50
+ encoding: US-ASCII
51
+ string: ''
52
+ headers:
53
+ Accept:
54
+ - "*/*; q=0.5, application/xml"
55
+ Accept-Encoding:
56
+ - gzip, deflate
57
+ User-Agent:
58
+ - Ruby
59
+ response:
60
+ status:
61
+ code: 204
62
+ message: 'No Content '
63
+ headers:
64
+ X-Ua-Compatible:
65
+ - IE=Edge
66
+ Cache-Control:
67
+ - no-cache
68
+ X-Request-Id:
69
+ - 7dbd3aaa1b0988ee0a1dda27bf5e9240
70
+ X-Runtime:
71
+ - '0.212115'
72
+ Server:
73
+ - WEBrick/1.3.1 (Ruby/1.9.3/2013-01-15)
74
+ Date:
75
+ - Sun, 22 Feb 2015 20:41:41 GMT
76
+ Connection:
77
+ - close
78
+ Set-Cookie:
79
+ - _serps_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJWIxMTZlMGYxNmViYzU5Y2NkY2ZmNzMzZTc3N2Q4ZTlhBjsAVA%3D%3D--4cacd417745a3d96966dae09af6890f22873205a;
80
+ path=/; HttpOnly
81
+ body:
82
+ encoding: UTF-8
83
+ string: ''
84
+ http_version:
85
+ recorded_at: Sun, 22 Feb 2015 20:41:41 GMT
86
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:5055/api/v1/keywords/1?token=123
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: 'OK '
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ X-Ua-Compatible:
24
+ - IE=Edge
25
+ Etag:
26
+ - '"227c5fa24bcc8a2adac7353eae5b60df"'
27
+ Cache-Control:
28
+ - max-age=0, private, must-revalidate
29
+ X-Request-Id:
30
+ - 7c7cfceb9cb25a66222b707285759628
31
+ X-Runtime:
32
+ - '0.024772'
33
+ Server:
34
+ - WEBrick/1.3.1 (Ruby/1.9.3/2013-01-15)
35
+ Date:
36
+ - Sun, 22 Feb 2015 20:41:41 GMT
37
+ Content-Length:
38
+ - '185'
39
+ Connection:
40
+ - Keep-Alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"id":1,"phrase":"example keyword","current_rank":1,"initial_rank":100,"day_change":"+99","week_change":"+99","alltime_change":"+99","search_volume":"1000","search_engine_country_id":1}'
44
+ http_version:
45
+ recorded_at: Sun, 22 Feb 2015 20:41:41 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:5055/api/v1/keywords/1?token=123
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: 'OK '
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ X-Ua-Compatible:
24
+ - IE=Edge
25
+ Etag:
26
+ - '"227c5fa24bcc8a2adac7353eae5b60df"'
27
+ Cache-Control:
28
+ - max-age=0, private, must-revalidate
29
+ X-Request-Id:
30
+ - 5a6d70ca798aa8fba6dd1c1f21b728b8
31
+ X-Runtime:
32
+ - '0.027653'
33
+ Server:
34
+ - WEBrick/1.3.1 (Ruby/1.9.3/2013-01-15)
35
+ Date:
36
+ - Sun, 22 Feb 2015 20:41:41 GMT
37
+ Content-Length:
38
+ - '185'
39
+ Connection:
40
+ - Keep-Alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"id":1,"phrase":"example keyword","current_rank":1,"initial_rank":100,"day_change":"+99","week_change":"+99","alltime_change":"+99","search_volume":"1000","search_engine_country_id":1}'
44
+ http_version:
45
+ recorded_at: Sun, 22 Feb 2015 20:41:41 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:5055/api/v1/keywords/1?token=123
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: 'OK '
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ X-Ua-Compatible:
24
+ - IE=Edge
25
+ Etag:
26
+ - '"227c5fa24bcc8a2adac7353eae5b60df"'
27
+ Cache-Control:
28
+ - max-age=0, private, must-revalidate
29
+ X-Request-Id:
30
+ - d00d2f99e6b697b05fe5412b8039f2ac
31
+ X-Runtime:
32
+ - '0.024364'
33
+ Server:
34
+ - WEBrick/1.3.1 (Ruby/1.9.3/2013-01-15)
35
+ Date:
36
+ - Sun, 22 Feb 2015 20:41:41 GMT
37
+ Content-Length:
38
+ - '185'
39
+ Connection:
40
+ - Keep-Alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"id":1,"phrase":"example keyword","current_rank":1,"initial_rank":100,"day_change":"+99","week_change":"+99","alltime_change":"+99","search_volume":"1000","search_engine_country_id":1}'
44
+ http_version:
45
+ recorded_at: Sun, 22 Feb 2015 20:41:41 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:5055/api/v1/keywords/1?token=123
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: 'OK '
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ X-Ua-Compatible:
24
+ - IE=Edge
25
+ Etag:
26
+ - '"227c5fa24bcc8a2adac7353eae5b60df"'
27
+ Cache-Control:
28
+ - max-age=0, private, must-revalidate
29
+ X-Request-Id:
30
+ - 9707b63eb87a532b59312ee87111e9a5
31
+ X-Runtime:
32
+ - '0.425401'
33
+ Server:
34
+ - WEBrick/1.3.1 (Ruby/1.9.3/2013-01-15)
35
+ Date:
36
+ - Sun, 22 Feb 2015 20:41:41 GMT
37
+ Content-Length:
38
+ - '185'
39
+ Connection:
40
+ - Keep-Alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"id":1,"phrase":"example keyword","current_rank":1,"initial_rank":100,"day_change":"+99","week_change":"+99","alltime_change":"+99","search_volume":"1000","search_engine_country_id":1}'
44
+ http_version:
45
+ recorded_at: Sun, 22 Feb 2015 20:41:41 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:5055/api/v1/keywords/1?token=123
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: 'OK '
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ X-Ua-Compatible:
24
+ - IE=Edge
25
+ Etag:
26
+ - '"227c5fa24bcc8a2adac7353eae5b60df"'
27
+ Cache-Control:
28
+ - max-age=0, private, must-revalidate
29
+ X-Request-Id:
30
+ - ecd6e9a85d98938be3ff778f80e4e266
31
+ X-Runtime:
32
+ - '0.026342'
33
+ Server:
34
+ - WEBrick/1.3.1 (Ruby/1.9.3/2013-01-15)
35
+ Date:
36
+ - Sun, 22 Feb 2015 20:41:41 GMT
37
+ Content-Length:
38
+ - '185'
39
+ Connection:
40
+ - Keep-Alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"id":1,"phrase":"example keyword","current_rank":1,"initial_rank":100,"day_change":"+99","week_change":"+99","alltime_change":"+99","search_volume":"1000","search_engine_country_id":1}'
44
+ http_version:
45
+ recorded_at: Sun, 22 Feb 2015 20:41:41 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:5055/api/v1/keywords/1?token=123
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: 'OK '
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ X-Ua-Compatible:
24
+ - IE=Edge
25
+ Etag:
26
+ - '"227c5fa24bcc8a2adac7353eae5b60df"'
27
+ Cache-Control:
28
+ - max-age=0, private, must-revalidate
29
+ X-Request-Id:
30
+ - 09975df1bb2818f75cce85eb55bb1fbd
31
+ X-Runtime:
32
+ - '0.032369'
33
+ Server:
34
+ - WEBrick/1.3.1 (Ruby/1.9.3/2013-01-15)
35
+ Date:
36
+ - Sun, 22 Feb 2015 20:41:41 GMT
37
+ Content-Length:
38
+ - '185'
39
+ Connection:
40
+ - Keep-Alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"id":1,"phrase":"example keyword","current_rank":1,"initial_rank":100,"day_change":"+99","week_change":"+99","alltime_change":"+99","search_volume":"1000","search_engine_country_id":1}'
44
+ http_version:
45
+ recorded_at: Sun, 22 Feb 2015 20:41:41 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:5055/api/v1/keywords/1?token=123
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: 'OK '
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ X-Ua-Compatible:
24
+ - IE=Edge
25
+ Etag:
26
+ - '"227c5fa24bcc8a2adac7353eae5b60df"'
27
+ Cache-Control:
28
+ - max-age=0, private, must-revalidate
29
+ X-Request-Id:
30
+ - f2b688f1926d10e7cbd5059f8341edc7
31
+ X-Runtime:
32
+ - '0.026000'
33
+ Server:
34
+ - WEBrick/1.3.1 (Ruby/1.9.3/2013-01-15)
35
+ Date:
36
+ - Sun, 22 Feb 2015 20:41:41 GMT
37
+ Content-Length:
38
+ - '185'
39
+ Connection:
40
+ - Keep-Alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"id":1,"phrase":"example keyword","current_rank":1,"initial_rank":100,"day_change":"+99","week_change":"+99","alltime_change":"+99","search_volume":"1000","search_engine_country_id":1}'
44
+ http_version:
45
+ recorded_at: Sun, 22 Feb 2015 20:41:41 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:5055/api/v1/keywords/1?token=123
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: 'OK '
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ X-Ua-Compatible:
24
+ - IE=Edge
25
+ Etag:
26
+ - '"227c5fa24bcc8a2adac7353eae5b60df"'
27
+ Cache-Control:
28
+ - max-age=0, private, must-revalidate
29
+ X-Request-Id:
30
+ - cf4bed2e26c1931946f7878c168ca556
31
+ X-Runtime:
32
+ - '0.025082'
33
+ Server:
34
+ - WEBrick/1.3.1 (Ruby/1.9.3/2013-01-15)
35
+ Date:
36
+ - Sun, 22 Feb 2015 20:41:41 GMT
37
+ Content-Length:
38
+ - '185'
39
+ Connection:
40
+ - Keep-Alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"id":1,"phrase":"example keyword","current_rank":1,"initial_rank":100,"day_change":"+99","week_change":"+99","alltime_change":"+99","search_volume":"1000","search_engine_country_id":1}'
44
+ http_version:
45
+ recorded_at: Sun, 22 Feb 2015 20:41:41 GMT
46
+ recorded_with: VCR 2.9.3