purdie 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +8 -6
  3. data/README.md +38 -22
  4. data/_config/defaults.yaml +10 -0
  5. data/_data/flickr.yaml +4 -0
  6. data/_data/soundcloud.yaml +7 -0
  7. data/features/flickr-album.feature +23 -0
  8. data/features/flickr-different-size.feature +28 -0
  9. data/features/soundcloud-set.feature +41 -0
  10. data/features/soundcloud.feature +0 -1
  11. data/features/support/fixtures/vcr/A_URL_we_don_t_understand/Handle_a_URL_we_don_t_recognise.yml +16 -16
  12. data/features/support/fixtures/vcr/First_contact_with_the_Real_World/Generate_YAML_for_the_Raw_Funk_Maharishi.yml +191 -276
  13. data/features/support/fixtures/vcr/Flickr/Generate_Flickr_YAML.yml +16 -16
  14. data/features/support/fixtures/vcr/Flickr_album/Generate_Flickr_YAML_for_an_album.yml +1035 -0
  15. data/features/support/fixtures/vcr/Handle_comments/Handle_comments_in_a_source_file.yml +75 -206
  16. data/features/support/fixtures/vcr/Purdie/Generate_several_YAML.yml +177 -213
  17. data/features/support/fixtures/vcr/Select_a_file_to_process/Choose_file_to_process.yml +56 -188
  18. data/features/support/fixtures/vcr/Set_Flickr_picturesize/Generate_Flickr_YAML.yml +125 -0
  19. data/features/support/fixtures/vcr/Soundcloud/Generate_SoundCloud_YAML.yml +56 -188
  20. data/features/support/fixtures/vcr/Soundcloud/Generate_SoundCloud_YAML_for_multiple_tracks.yml +140 -181
  21. data/features/support/fixtures/vcr/Soundcloud_set/Generate_YAML_for_a_SoundCloud_set.yml +436 -0
  22. data/features/support/fixtures/vcr/Vimeo/Generate_Vimeo_YAML.yml +23 -11
  23. data/features/support/fixtures/vcr/YouTube/Generate_YouTube_YAML.yml +970 -0
  24. data/features/support/vcr.rb +7 -5
  25. data/features/youtube.feature +20 -0
  26. data/lib/purdie/bernard.rb +35 -17
  27. data/lib/purdie/cli.rb +1 -1
  28. data/lib/purdie/helpers.rb +24 -0
  29. data/lib/purdie/ingester.rb +25 -10
  30. data/lib/purdie/services/flickr.rb +48 -5
  31. data/lib/purdie/services/soundcloud.rb +13 -21
  32. data/lib/purdie/services/vimeo.rb +4 -3
  33. data/lib/purdie/services/youtube.rb +64 -0
  34. data/lib/purdie/source_list.rb +46 -0
  35. data/lib/purdie/version.rb +1 -1
  36. data/lib/purdie.rb +4 -21
  37. data/list +1 -0
  38. data/purdie.gemspec +3 -1
  39. data/spec/helpers_spec.rb +31 -0
  40. data/spec/purdie_spec.rb +0 -24
  41. data/spec/services/flickr_spec.rb +33 -1
  42. data/spec/services/soundcloud_spec.rb +10 -8
  43. data/spec/services/youtube_spec.rb +27 -0
  44. data/spec/source_list_spec.rb +64 -0
  45. data/spec/support/fixtures/soundcloud.sounds +4 -0
  46. data/spec/support/fixtures/with-comments.source +3 -0
  47. data/spec/support/vcr_setup.rb +3 -1
  48. data/spec/vcr/Purdie_Services_Flickr/distills_data_for_a_regular_photo.yml +15 -15
  49. data/spec/vcr/Purdie_Services_Flickr/falls_back_to_the_default_photographer_name.yml +16 -16
  50. data/spec/vcr/Purdie_Services_Flickr/ingests_data_for_a_photo_without_a_specific_photographer_tag.yml +16 -16
  51. data/spec/vcr/Purdie_Services_Flickr/resolve_a_set/resolves_a_set_from_a_url.yml +518 -0
  52. data/spec/vcr/Purdie_Services_SoundCloud/connects_to_SoundCloud.yml +62 -67
  53. data/spec/vcr/Purdie_Services_SoundCloud/distills_the_data.yml +53 -183
  54. data/spec/vcr/Purdie_Services_SoundCloud/extracts_a_track.yml +50 -194
  55. data/spec/vcr/Purdie_Services_SoundCloud/ingests_a_track.yml +48 -186
  56. data/spec/vcr/Purdie_Services_SoundCloud/resolve_a_set/resolves_a_set_from_a_url.yml +103 -0
  57. data/spec/vcr/Purdie_Services_Vimeo/gets_a_video.yml +23 -11
  58. data/spec/vcr/Purdie_Services_Vimeo/ingests_a_video.yml +23 -11
  59. data/spec/vcr/Purdie_Services_YouTube/gets_a_video.yml +970 -0
  60. data/spec/vcr/Purdie_Services_YouTube/ingests_a_video.yml +970 -0
  61. data/spec/vcr/Purdie_SourceList/resolve_sets/constructs_a_list_from_a_set_URL.yml +518 -0
  62. data/spec/vcr/Purdie_SourceList/resolve_sets/resolves_a_Flickr_set.yml +518 -0
  63. data/spec/vcr/Purdie_SourceList/resolve_sets/resolves_a_SoundCloud_set.yml +103 -0
  64. data/spec/vcr/Purdie_SourceList/resolves_a_Flickr_set.yml +518 -0
  65. data/wtf.log +1 -0
  66. metadata +81 -14
  67. data/features/support/fixtures/vcr/Handle_no__sources_directory/Handle_no__sources_directory.yml +0 -346
  68. data/spec/vcr/Purdie_Services_SoundCloud/deals_with_a_troublesome_bawbag.yml +0 -230
  69. data/spec/vcr/Purdie_Services_SoundCloud/refines_the_data.yml +0 -230
  70. data/spec/vcr/Purdie_Services_Vimeo/distills_a_video.yml +0 -41
  71. data/spec/vcr/Purdie_Services_Vimeo/refines_a_video.yml +0 -41
@@ -15,8 +15,8 @@ http_interactions:
15
15
  - FlickRaw/0.9.8
16
16
  Authorization:
17
17
  - OAuth realm="https://api.flickr.com/services/rest/", oauth_consumer_key="<FLICKR_API_KEY>",
18
- oauth_nonce="v7zr90fYXXzMro5%2FWLOHPQAxDfRkRUu7nWZELKIRfrs%3D", oauth_signature="<FLICKR_SECRET>%26",
19
- oauth_signature_method="PLAINTEXT", oauth_timestamp="1425290381", oauth_token="",
18
+ oauth_nonce="jGRDygLjXdnc51xHcey9QN4pyuIFU%2F0FLudnedV%2FfFc%3D", oauth_signature="<FLICKR_SECRET>%26",
19
+ oauth_signature_method="PLAINTEXT", oauth_timestamp="1426006403", oauth_token="",
20
20
  oauth_version="1.0"
21
21
  Content-Type:
22
22
  - application/x-www-form-urlencoded
@@ -26,7 +26,7 @@ http_interactions:
26
26
  message: OK
27
27
  headers:
28
28
  Date:
29
- - Mon, 02 Mar 2015 09:59:42 GMT
29
+ - Tue, 10 Mar 2015 16:53:23 GMT
30
30
  Content-Type:
31
31
  - application/json
32
32
  Content-Length:
@@ -38,14 +38,14 @@ http_interactions:
38
38
  Cache-Control:
39
39
  - private
40
40
  X-Served-By:
41
- - www330.flickr.bf1.yahoo.com
41
+ - www253.flickr.bf1.yahoo.com
42
42
  Vary:
43
43
  - Accept-Encoding
44
44
  Age:
45
- - '1'
45
+ - '0'
46
46
  Via:
47
- - http/1.1 fts115.flickr.bf1.yahoo.com (ApacheTrafficServer/4.0.2 [cMsSf ]),
48
- http/1.1 r17.ycpi.dea.yahoo.net (ApacheTrafficServer [cMsSf ])
47
+ - http/1.1 fts121.flickr.bf1.yahoo.com (ApacheTrafficServer/4.0.2 [cMsSf ]),
48
+ http/1.1 r08.ycpi.dea.yahoo.net (ApacheTrafficServer [cMsSf ])
49
49
  Server:
50
50
  - ATS
51
51
  Connection:
@@ -55,10 +55,10 @@ http_interactions:
55
55
  string: '{"photo":{"id":"15631479625","secret":"b6168ee903","server":"3933","farm":4,"dateuploaded":"1414326010","isfavorite":0,"license":"1","safety_level":"0","rotation":0,"originalsecret":"3191340cdb","originalformat":"jpg","owner":{"nsid":"128943844@N06","username":"rawfunkmaharishi","realname":"Raw
56
56
  Funk Maharishi","location":"","iconserver":"3933","iconfarm":4,"path_alias":"rawfunkmaharishi"},"title":{"_content":"The
57
57
  Comedy, October 2014"},"description":{"_content":""},"visibility":{"ispublic":1,"isfriend":0,"isfamily":0},"dates":{"posted":"1414326010","taken":"2014-10-22
58
- 15:54:24","takengranularity":"0","takenunknown":"0","lastupdate":"1416111853"},"views":"92","editability":{"cancomment":0,"canaddmeta":0},"publiceditability":{"cancomment":1,"canaddmeta":0},"usage":{"candownload":1,"canblog":0,"canprint":0,"canshare":1},"comments":{"_content":"0"},"notes":{"note":[]},"people":{"haspeople":0},"tags":{"tag":[{"id":"128898522-15631479625-1422028","author":"128943844@N06","authorname":"rawfunkmaharishi","raw":"the
58
+ 15:54:24","takengranularity":"0","takenunknown":"0","lastupdate":"1416111853"},"views":"94","editability":{"cancomment":0,"canaddmeta":0},"publiceditability":{"cancomment":1,"canaddmeta":0},"usage":{"candownload":1,"canblog":0,"canprint":0,"canshare":1},"comments":{"_content":"0"},"notes":{"note":[]},"people":{"haspeople":0},"tags":{"tag":[{"id":"128898522-15631479625-1422028","author":"128943844@N06","authorname":"rawfunkmaharishi","raw":"the
59
59
  comedy","_content":"thecomedy","machine_tag":0},{"id":"128898522-15631479625-17975","author":"128943844@N06","authorname":"rawfunkmaharishi","raw":"gigs","_content":"gigs","machine_tag":0},{"id":"128898522-15631479625-228989594","author":"128943844@N06","authorname":"rawfunkmaharishi","raw":"photographer:kim","_content":"photographerkim","machine_tag":0}]},"urls":{"url":[{"type":"photopage","_content":"https:\/\/www.flickr.com\/photos\/rawfunkmaharishi\/15631479625\/"}]},"media":"photo"},"stat":"ok"}'
60
60
  http_version:
61
- recorded_at: Mon, 02 Mar 2015 09:59:42 GMT
61
+ recorded_at: Tue, 10 Mar 2015 16:53:23 GMT
62
62
  - request:
63
63
  method: post
64
64
  uri: https://api.flickr.com/services/rest/
@@ -74,8 +74,8 @@ http_interactions:
74
74
  - FlickRaw/0.9.8
75
75
  Authorization:
76
76
  - OAuth realm="https://api.flickr.com/services/rest/", oauth_consumer_key="<FLICKR_API_KEY>",
77
- oauth_nonce="PKyYl0JL6%2BViCo7u4SpYJRBix10MiOKoT3NeVOyhZyU%3D", oauth_signature="<FLICKR_SECRET>%26",
78
- oauth_signature_method="PLAINTEXT", oauth_timestamp="1425290382", oauth_token="",
77
+ oauth_nonce="HvF6oBbU46ePJNtl7YXkWXE962gAZIzzD%2BO%2Bgka0b5M%3D", oauth_signature="<FLICKR_SECRET>%26",
78
+ oauth_signature_method="PLAINTEXT", oauth_timestamp="1426006403", oauth_token="",
79
79
  oauth_version="1.0"
80
80
  Content-Type:
81
81
  - application/x-www-form-urlencoded
@@ -85,7 +85,7 @@ http_interactions:
85
85
  message: OK
86
86
  headers:
87
87
  Date:
88
- - Mon, 02 Mar 2015 09:59:42 GMT
88
+ - Tue, 10 Mar 2015 16:53:23 GMT
89
89
  Content-Type:
90
90
  - application/json
91
91
  Content-Length:
@@ -97,14 +97,14 @@ http_interactions:
97
97
  Cache-Control:
98
98
  - private
99
99
  X-Served-By:
100
- - www302.flickr.bf1.yahoo.com
100
+ - www323.flickr.bf1.yahoo.com
101
101
  Vary:
102
102
  - Accept-Encoding
103
103
  Age:
104
104
  - '0'
105
105
  Via:
106
- - http/1.1 fts122.flickr.bf1.yahoo.com (ApacheTrafficServer/4.0.2 [cMsSf ]),
107
- http/1.1 r12.ycpi.dea.yahoo.net (ApacheTrafficServer [cMsSf ])
106
+ - http/1.1 fts104.flickr.bf1.yahoo.com (ApacheTrafficServer/4.0.2 [cMsSf ]),
107
+ http/1.1 r18.ycpi.dea.yahoo.net (ApacheTrafficServer [cMsSf ])
108
108
  Server:
109
109
  - ATS
110
110
  Connection:
@@ -121,5 +121,5 @@ http_interactions:
121
121
  known copyright restrictions","url":"https:\/\/www.flickr.com\/commons\/usage\/"},{"id":"8","name":"United
122
122
  States Government Work","url":"http:\/\/www.usa.gov\/copyright.shtml"}]},"stat":"ok"}'
123
123
  http_version:
124
- recorded_at: Mon, 02 Mar 2015 09:59:42 GMT
124
+ recorded_at: Tue, 10 Mar 2015 16:53:23 GMT
125
125
  recorded_with: VCR 2.9.3