bremen 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -41,28 +41,28 @@ call `.find` method with uid(unique key) or url.
41
41
 
42
42
  call `.search` method with keyword.
43
43
 
44
- Bremen::Youtube.find(keyword: 'Perfume')
44
+ Bremen::Youtube.search(keyword: 'Perfume')
45
45
 
46
46
  #### Optional params
47
47
 
48
48
  You can add optional parameters for filtering. But not supports all official API's filters.
49
49
 
50
- Bremen::Youtube.find(keyword: 'KyaryPamyuPamyu', order: 'relevance', limit: 10)
50
+ Bremen::Youtube.search(keyword: 'KyaryPamyuPamyu', order: 'relevance', limit: 10)
51
51
 
52
52
  ### Track object
53
53
 
54
54
  Retrieving methods return Track object(s).
55
55
 
56
- attribute | |
57
- --------------|------------------------|
58
- uid | unique key in a site |
59
- url | |
60
- title | |
61
- author | |
62
- length | duration of track |
63
- thumbnail_url | thumbnail image |
64
- created_at | released datetime |
65
- updated_at | modified datetime |
56
+ attribute |type |description |
57
+ -------------|-------------|--------------------------|
58
+ uid |String |unique key in a site |
59
+ url |String | |
60
+ title |String | |
61
+ author |Author Object|uid/url/name/thumbnail_url|
62
+ length |Integer |duration of track |
63
+ thumbnail_url|String |thumbnail image |
64
+ created_at |Time |released datetime |
65
+ updated_at |Time |modified datetime |
66
66
 
67
67
  ## API References
68
68
 
@@ -0,0 +1,11 @@
1
+ module Bremen
2
+ class Author
3
+ attr_accessor :uid, :url, :name, :thumbnail_url
4
+
5
+ def initialize attrs = {}
6
+ attrs.each do |key, value|
7
+ send("#{key}=", value) if respond_to?(key)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -34,7 +34,12 @@ module Bremen
34
34
  uid: hash['key'],
35
35
  url: hash['url'],
36
36
  title: hash['name'],
37
- author: hash['user']['name'],
37
+ author: Bremen::Author.new({
38
+ uid: hash['user']['key'],
39
+ url: hash['user']['url'],
40
+ name: hash['user']['name'],
41
+ thumbnail_url: hash['user']['pictures']['medium'],
42
+ }),
38
43
  length: hash['audio_length'].to_i,
39
44
  thumbnail_url: hash['pictures']['medium'],
40
45
  created_at: created_at,
@@ -42,6 +42,9 @@ module Bremen
42
42
  uid: uid,
43
43
  url: "#{BASE_URL}watch/#{uid}",
44
44
  title: CGI.unescape(response.scan(%r{<meta property="og:title" content="(.+)">}).flatten.first.to_s),
45
+ author: Bremen::Author.new({
46
+ name: response.scan(%r{<strong itemprop="name">(.+)</strong>}).flatten.first,
47
+ }),
45
48
  length: response.scan(%r{<meta property="video:duration" content="(\d+)">}).flatten.first.to_i,
46
49
  thumbnail_url: response.scan(%r{<meta property="og:image" content="(.+)">}).flatten.first,
47
50
  created_at: created_at,
@@ -43,7 +43,12 @@ module Bremen
43
43
  uid: hash['id'],
44
44
  url: hash['permalink_url'],
45
45
  title: hash['title'],
46
- author: hash['user']['username'],
46
+ author: Bremen::Author.new({
47
+ uid: hash['user']['id'],
48
+ url: hash['user']['permalink_url'],
49
+ name: hash['user']['username'],
50
+ thumbnail_url: hash['user']['avatar_url'].sub(%r{\?.*}, ''),
51
+ }),
47
52
  length: (hash['duration'].to_i / 1000).round,
48
53
  thumbnail_url: hash['artwork_url'] ? hash['artwork_url'].sub(%r{\?.*}, '') : nil,
49
54
  created_at: Time.parse(hash['created_at']),
@@ -1,3 +1,5 @@
1
+ require 'bremen/author'
2
+
1
3
  module Bremen
2
4
  module Track
3
5
  attr_accessor :uid, :url, :title, :author, :thumbnail_url, :length, :created_at, :updated_at
@@ -1,3 +1,3 @@
1
1
  module Bremen
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -33,11 +33,16 @@ module Bremen
33
33
 
34
34
  def from_api hash = {}
35
35
  uid = hash['id']['$t'].sub('http://gdata.youtube.com/feeds/api/videos/', '')
36
+ author = hash['author'].first
36
37
  new({
37
38
  uid: uid,
38
39
  url: "http://www.youtube.com/watch?v=#{uid}",
39
40
  title: hash['title']['$t'],
40
- author: hash['author'].first['name']['$t'],
41
+ author: Bremen::Author.new({
42
+ uid: author.key?('yt$userId') ? author['yt$userId']['$t'] : nil,
43
+ url: author['uri']['$t'].sub('gdata.youtube.com/feeds/api/users/', 'www.youtube.com/channel/UC'),
44
+ name: author['name']['$t'],
45
+ }),
41
46
  length: hash['media$group']['yt$duration']['seconds'].to_i,
42
47
  thumbnail_url: hash['media$group']['media$thumbnail'][0]['url'],
43
48
  created_at: Time.parse(hash['published']['$t']),
@@ -3,16 +3,16 @@
3
3
  "next": "http://api.mixcloud.com/search/?q=searchword&type=cloudcast&limit=1&offset=1"
4
4
  },
5
5
  "data": [
6
- {
7
- "listener_count": 111,
8
- "name": "Title",
9
- "tags": [
10
6
  {
11
- "url": "http://www.mixcloud.com/tag/tag1/",
12
- "name": "Inna",
13
- "key": "/tag/tag1/"
14
- }
15
- ],
7
+ "listener_count": 111,
8
+ "name": "Title",
9
+ "tags": [
10
+ {
11
+ "url": "http://www.mixcloud.com/tag/tag1/",
12
+ "name": "tag1",
13
+ "key": "/tag/tag1/"
14
+ }
15
+ ],
16
16
  "url": "http://www.mixcloud.com/author/title/",
17
17
  "pictures": {
18
18
  "medium": "http://images-mix.netdna-ssl.com/w/100/h/100/q/85/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
@@ -41,10 +41,10 @@
41
41
  }
42
42
  },
43
43
  "key": "/author/title/",
44
- "created_time": "2011-06-12T10:40:19Z",
44
+ "created_time": "2012-01-01T00:00:00Z",
45
45
  "audio_length": 1111,
46
46
  "slug": "title",
47
47
  "favorite_count": 11
48
- }
48
+ }
49
49
  ]
50
50
  }
@@ -2,42 +2,42 @@
2
2
  "listener_count": 111,
3
3
  "name": "Title",
4
4
  "tags": [
5
- {
5
+ {
6
6
  "url": "http://www.mixcloud.com/tag/tag1/",
7
7
  "name": "Inna",
8
8
  "key": "/tag/tag1/"
9
- }
9
+ }
10
10
  ],
11
- "url": "http://www.mixcloud.com/author/title/",
11
+ "url": "http://www.mixcloud.com/author/title/",
12
+ "pictures": {
13
+ "medium": "http://images-mix.netdna-ssl.com/w/100/h/100/q/85/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
14
+ "extra_large": "http://images-mix.netdna-ssl.com/w/600/h/600/q/85/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
15
+ "large": "http://images-mix.netdna-ssl.com/w/300/h/300/q/85/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
16
+ "medium_mobile": "http://images-mix.netdna-ssl.com/w/80/h/80/q/75/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
17
+ "small": "http://images-mix.netdna-ssl.com/w/25/h/25/q/85/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
18
+ "thumbnail": "http://images-mix.netdna-ssl.com/w/50/h/50/q/85/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png"
19
+ },
20
+ "updated_time": "2012-01-01T00:00:00Z",
21
+ "play_count": 1111,
22
+ "comment_count": 1,
23
+ "percentage_music": 100,
24
+ "user": {
25
+ "url": "http://www.mixcloud.com/author/",
26
+ "username": "author",
27
+ "name": "Author",
28
+ "key": "/author/",
12
29
  "pictures": {
13
- "medium": "http://images-mix.netdna-ssl.com/w/100/h/100/q/85/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
14
- "extra_large": "http://images-mix.netdna-ssl.com/w/600/h/600/q/85/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
15
- "large": "http://images-mix.netdna-ssl.com/w/300/h/300/q/85/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
16
- "medium_mobile": "http://images-mix.netdna-ssl.com/w/80/h/80/q/75/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
17
- "small": "http://images-mix.netdna-ssl.com/w/25/h/25/q/85/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
18
- "thumbnail": "http://images-mix.netdna-ssl.com/w/50/h/50/q/85/upload/images/extaudio/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png"
19
- },
20
- "updated_time": "2012-01-01T00:00:00Z",
21
- "play_count": 1111,
22
- "comment_count": 1,
23
- "percentage_music": 100,
24
- "user": {
25
- "url": "http://www.mixcloud.com/author/",
26
- "username": "author",
27
- "name": "Author",
28
- "key": "/author/",
29
- "pictures": {
30
- "medium": "http://images-mix.netdna-ssl.com/w/100/h/100/q/85/upload/images/profile/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
31
- "extra_large": "http://images-mix.netdna-ssl.com/w/600/h/600/q/85/upload/images/profile/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
32
- "large": "http://images-mix.netdna-ssl.com/w/300/h/300/q/85/upload/images/profile/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
33
- "medium_mobile": "http://images-mix.netdna-ssl.com/w/80/h/80/q/75/upload/images/profile/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
34
- "small": "http://images-mix.netdna-ssl.com/w/25/h/25/q/85/upload/images/profile/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
35
- "thumbnail": "http://images-mix.netdna-ssl.com/w/50/h/50/q/85/upload/images/profile/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.png"
36
- }
37
- },
38
- "key": "/author/title/",
39
- "created_time": "2011-06-12T10:40:19Z",
40
- "audio_length": 1111,
41
- "slug": "title",
42
- "favorite_count": 11
30
+ "medium": "http://images-mix.netdna-ssl.com/w/100/h/100/q/85/upload/images/profile/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
31
+ "extra_large": "http://images-mix.netdna-ssl.com/w/600/h/600/q/85/upload/images/profile/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
32
+ "large": "http://images-mix.netdna-ssl.com/w/300/h/300/q/85/upload/images/profile/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
33
+ "medium_mobile": "http://images-mix.netdna-ssl.com/w/80/h/80/q/75/upload/images/profile/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
34
+ "small": "http://images-mix.netdna-ssl.com/w/25/h/25/q/85/upload/images/profile/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.png",
35
+ "thumbnail": "http://images-mix.netdna-ssl.com/w/50/h/50/q/85/upload/images/profile/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.png"
36
+ }
37
+ },
38
+ "key": "/author/title/",
39
+ "created_time": "2011-06-12T10:40:19Z",
40
+ "audio_length": 1111,
41
+ "slug": "title",
42
+ "favorite_count": 11
43
43
  }
@@ -1,55 +1,55 @@
1
1
  [
2
- {
3
- "artwork_url": "http://i1.sndcdn.com/artworks-000011111111-1cfbic-large.jpg?5c687d0",
4
- "attachments_uri": "http://api.soundcloud.com/tracks/11111111/attachments",
5
- "bpm": null,
6
- "comment_count": 0,
7
- "commentable": true,
8
- "created_at": "2012/01/01 00:08:00 +0000",
9
- "description": "",
10
- "download_count": 0,
11
- "downloadable": false,
12
- "duration": 111111,
13
- "embeddable_by": "all",
14
- "favoritings_count": 0,
15
- "genre": "Garage",
16
- "id": 11111111,
17
- "isrc": "",
18
- "key_signature": "",
19
- "kind": "track",
20
- "label_id": null,
21
- "label_name": "",
22
- "license": "all-rights-reserved",
23
- "original_content_size": 1111111,
24
- "original_format": "mp3",
25
- "permalink": "permalink",
26
- "permalink_url": "http://soundcloud.com/author/permalink",
27
- "playback_count": 4,
28
- "purchase_title": null,
29
- "purchase_url": null,
30
- "release": "",
31
- "release_day": null,
32
- "release_month": null,
33
- "release_year": null,
34
- "sharing": "public",
35
- "state": "finished",
36
- "stream_url": "http://api.soundcloud.com/tracks/11111111/stream",
37
- "streamable": true,
38
- "tag_list": "tag1 tag2 tag3",
39
- "title": "Title",
40
- "track_type": "",
41
- "uri": "http://api.soundcloud.com/tracks/11111111",
42
- "user": {
43
- "avatar_url": "http://i1.sndcdn.com/avatars-000011111111-zzjvpd-large.jpg?5c687d0",
2
+ {
3
+ "artwork_url": "http://i1.sndcdn.com/artworks-000011111111-1cfbic-large.jpg?5c687d0",
4
+ "attachments_uri": "http://api.soundcloud.com/tracks/11111111/attachments",
5
+ "bpm": null,
6
+ "comment_count": 0,
7
+ "commentable": true,
8
+ "created_at": "2012/01/01 00:08:00 +0000",
9
+ "description": "",
10
+ "download_count": 0,
11
+ "downloadable": false,
12
+ "duration": 111111,
13
+ "embeddable_by": "all",
14
+ "favoritings_count": 0,
15
+ "genre": "Garage",
44
16
  "id": 11111111,
45
- "kind": "user",
46
- "permalink": "author",
47
- "permalink_url": "http://soundcloud.com/author",
48
- "uri": "http://api.soundcloud.com/users/11111111",
49
- "username": "Author"
50
- },
51
- "user_id": 11111111,
52
- "video_url": null,
53
- "waveform_url": "http://w1.sndcdn.com/XXXXXXXXXXXX_m.png"
54
- }
17
+ "isrc": "",
18
+ "key_signature": "",
19
+ "kind": "track",
20
+ "label_id": null,
21
+ "label_name": "",
22
+ "license": "all-rights-reserved",
23
+ "original_content_size": 1111111,
24
+ "original_format": "mp3",
25
+ "permalink": "permalink",
26
+ "permalink_url": "http://soundcloud.com/author/permalink",
27
+ "playback_count": 4,
28
+ "purchase_title": null,
29
+ "purchase_url": null,
30
+ "release": "",
31
+ "release_day": null,
32
+ "release_month": null,
33
+ "release_year": null,
34
+ "sharing": "public",
35
+ "state": "finished",
36
+ "stream_url": "http://api.soundcloud.com/tracks/11111111/stream",
37
+ "streamable": true,
38
+ "tag_list": "tag1 tag2 tag3",
39
+ "title": "Title",
40
+ "track_type": "",
41
+ "uri": "http://api.soundcloud.com/tracks/11111111",
42
+ "user": {
43
+ "avatar_url": "http://i1.sndcdn.com/avatars-000011111111-zzjvpd-large.jpg?5c687d0",
44
+ "id": 11111111,
45
+ "kind": "user",
46
+ "permalink": "author",
47
+ "permalink_url": "http://soundcloud.com/author",
48
+ "uri": "http://api.soundcloud.com/users/11111111",
49
+ "username": "Author"
50
+ },
51
+ "user_id": 11111111,
52
+ "video_url": null,
53
+ "waveform_url": "http://w1.sndcdn.com/XXXXXXXXXXXX_m.png"
54
+ }
55
55
  ]
@@ -2,34 +2,34 @@
2
2
  "encoding": "UTF-8",
3
3
  "feed": {
4
4
  "author": [
5
- {
6
- "name": {
7
- "$t": "YouTube"
8
- },
9
- "uri": {
10
- "$t": "http://www.youtube.com/"
5
+ {
6
+ "name": {
7
+ "$t": "YouTube"
8
+ },
9
+ "uri": {
10
+ "$t": "http://www.youtube.com/"
11
+ }
11
12
  }
12
- }
13
13
  ],
14
- "category": [
14
+ "category": [
15
15
  {
16
16
  "scheme": "http://schemas.google.com/g/2005#kind",
17
17
  "term": "http://gdata.youtube.com/schemas/2007#video"
18
18
  }
19
19
  ],
20
- "entry": [
20
+ "entry": [
21
21
  {
22
22
  "author": [
23
- {
24
- "name": {
25
- "$t": "Author"
26
- },
27
- "uri": {
28
- "$t": "http://gdata.youtube.com/feeds/api/users/Author"
23
+ {
24
+ "name": {
25
+ "$t": "Author"
26
+ },
27
+ "uri": {
28
+ "$t": "http://gdata.youtube.com/feeds/api/users/Author"
29
+ }
29
30
  }
30
- }
31
31
  ],
32
- "category": [
32
+ "category": [
33
33
  {
34
34
  "scheme": "http://schemas.google.com/g/2005#kind",
35
35
  "term": "http://gdata.youtube.com/schemas/2007#video"
@@ -40,152 +40,152 @@
40
40
  "term": "Music"
41
41
  }
42
42
  ],
43
- "content": {
44
- "$t": "This is a description.",
45
- "type": "text"
46
- },
47
- "gd$comments": {
48
- "gd$feedLink": {
49
- "countHint": 0,
50
- "href": "http://gdata.youtube.com/feeds/api/videos/XXXXXXXXXXX/comments",
51
- "rel": "http://gdata.youtube.com/schemas/2007#comments"
52
- }
53
- },
54
- "id": {
55
- "$t": "http://gdata.youtube.com/feeds/api/videos/XXXXXXXXXXX"
56
- },
57
- "link": [
43
+ "content": {
44
+ "$t": "This is a description.",
45
+ "type": "text"
46
+ },
47
+ "gd$comments": {
48
+ "gd$feedLink": {
49
+ "countHint": 0,
50
+ "href": "http://gdata.youtube.com/feeds/api/videos/XXXXXXXXXXX/comments",
51
+ "rel": "http://gdata.youtube.com/schemas/2007#comments"
52
+ }
53
+ },
54
+ "id": {
55
+ "$t": "http://gdata.youtube.com/feeds/api/videos/XXXXXXXXXXX"
56
+ },
57
+ "link": [
58
+ {
59
+ "href": "http://www.youtube.com/watch?v=XXXXXXXXXXX&feature=youtube_gdata",
60
+ "rel": "alternate",
61
+ "type": "text/html"
62
+ },
63
+ {
64
+ "href": "http://gdata.youtube.com/feeds/api/videos/XXXXXXXXXXX/responses",
65
+ "rel": "http://gdata.youtube.com/schemas/2007#video.responses",
66
+ "type": "application/atom+xml"
67
+ },
68
+ {
69
+ "href": "http://gdata.youtube.com/feeds/api/videos/XXXXXXXXXXX/related",
70
+ "rel": "http://gdata.youtube.com/schemas/2007#video.related",
71
+ "type": "application/atom+xml"
72
+ },
73
+ {
74
+ "href": "http://m.youtube.com/details?v=XXXXXXXXXXX",
75
+ "rel": "http://gdata.youtube.com/schemas/2007#mobile",
76
+ "type": "text/html"
77
+ },
78
+ {
79
+ "href": "http://gdata.youtube.com/feeds/api/videos/XXXXXXXXXXX",
80
+ "rel": "self",
81
+ "type": "application/atom+xml"
82
+ }
83
+ ],
84
+ "media$group": {
85
+ "media$category": [
58
86
  {
59
- "href": "http://www.youtube.com/watch?v=XXXXXXXXXXX&feature=youtube_gdata",
60
- "rel": "alternate",
61
- "type": "text/html"
62
- },
87
+ "$t": "Music",
88
+ "label": "Music",
89
+ "scheme": "http://gdata.youtube.com/schemas/2007/categories.cat"
90
+ }
91
+ ],
92
+ "media$content": [
63
93
  {
64
- "href": "http://gdata.youtube.com/feeds/api/videos/XXXXXXXXXXX/responses",
65
- "rel": "http://gdata.youtube.com/schemas/2007#video.responses",
66
- "type": "application/atom+xml"
94
+ "duration": 308,
95
+ "expression": "full",
96
+ "isDefault": "true",
97
+ "medium": "video",
98
+ "type": "application/x-shockwave-flash",
99
+ "url": "http://www.youtube.com/v/XXXXXXXXXXX?version=3&f=videos&app=youtube_gdata",
100
+ "yt$format": 5
67
101
  },
68
102
  {
69
- "href": "http://gdata.youtube.com/feeds/api/videos/XXXXXXXXXXX/related",
70
- "rel": "http://gdata.youtube.com/schemas/2007#video.related",
71
- "type": "application/atom+xml"
103
+ "duration": 308,
104
+ "expression": "full",
105
+ "medium": "video",
106
+ "type": "video/3gpp",
107
+ "url": "rtsp://v8.cache4.c.youtube.com/CiILENy73wIaGQn8RbFfqUC_OxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp",
108
+ "yt$format": 1
72
109
  },
73
110
  {
74
- "href": "http://m.youtube.com/details?v=XXXXXXXXXXX",
75
- "rel": "http://gdata.youtube.com/schemas/2007#mobile",
76
- "type": "text/html"
77
- },
111
+ "duration": 308,
112
+ "expression": "full",
113
+ "medium": "video",
114
+ "type": "video/3gpp",
115
+ "url": "rtsp://v1.cache7.c.youtube.com/CiILENy73wIaGQn8RbFfqUC_OxMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp",
116
+ "yt$format": 6
117
+ }
118
+ ],
119
+ "media$description": {
120
+ "$t": "This is a description.",
121
+ "type": "plain"
122
+ },
123
+ "media$keywords": {},
124
+ "media$player": [
78
125
  {
79
- "href": "http://gdata.youtube.com/feeds/api/videos/XXXXXXXXXXX",
80
- "rel": "self",
81
- "type": "application/atom+xml"
126
+ "url": "http://www.youtube.com/watch?v=XXXXXXXXXXX&feature=youtube_gdata_player"
82
127
  }
83
128
  ],
84
- "media$group": {
85
- "media$category": [
86
- {
87
- "$t": "Music",
88
- "label": "Music",
89
- "scheme": "http://gdata.youtube.com/schemas/2007/categories.cat"
90
- }
91
- ],
92
- "media$content": [
93
- {
94
- "duration": 308,
95
- "expression": "full",
96
- "isDefault": "true",
97
- "medium": "video",
98
- "type": "application/x-shockwave-flash",
99
- "url": "http://www.youtube.com/v/XXXXXXXXXXX?version=3&f=videos&app=youtube_gdata",
100
- "yt$format": 5
101
- },
102
- {
103
- "duration": 308,
104
- "expression": "full",
105
- "medium": "video",
106
- "type": "video/3gpp",
107
- "url": "rtsp://v8.cache4.c.youtube.com/CiILENy73wIaGQn8RbFfqUC_OxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp",
108
- "yt$format": 1
109
- },
110
- {
111
- "duration": 308,
112
- "expression": "full",
113
- "medium": "video",
114
- "type": "video/3gpp",
115
- "url": "rtsp://v1.cache7.c.youtube.com/CiILENy73wIaGQn8RbFfqUC_OxMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp",
116
- "yt$format": 6
117
- }
118
- ],
119
- "media$description": {
120
- "$t": "This is a description.",
121
- "type": "plain"
122
- },
123
- "media$keywords": {},
124
- "media$player": [
125
- {
126
- "url": "http://www.youtube.com/watch?v=XXXXXXXXXXX&feature=youtube_gdata_player"
127
- }
128
- ],
129
- "media$thumbnail": [
130
- {
131
- "height": 360,
132
- "time": "00:02:34",
133
- "url": "http://i.ytimg.com/vi/XXXXXXXXXXX/0.jpg",
134
- "width": 480
135
- },
136
- {
137
- "height": 90,
138
- "time": "00:01:17",
139
- "url": "http://i.ytimg.com/vi/XXXXXXXXXXX/1.jpg",
140
- "width": 120
141
- },
142
- {
143
- "height": 90,
144
- "time": "00:02:34",
145
- "url": "http://i.ytimg.com/vi/XXXXXXXXXXX/2.jpg",
146
- "width": 120
147
- },
148
- {
149
- "height": 90,
150
- "time": "00:03:51",
151
- "url": "http://i.ytimg.com/vi/XXXXXXXXXXX/3.jpg",
152
- "width": 120
153
- }
154
- ],
155
- "media$title": {
156
- "$t": "Title",
157
- "type": "plain"
158
- },
159
- "yt$duration": {
160
- "seconds": "308"
161
- }
162
- },
163
- "published": {
164
- "$t": "2012-01-01T00:50:00.000Z"
129
+ "media$thumbnail": [
130
+ {
131
+ "height": 360,
132
+ "time": "00:02:34",
133
+ "url": "http://i.ytimg.com/vi/XXXXXXXXXXX/0.jpg",
134
+ "width": 480
165
135
  },
166
- "title": {
167
- "$t": "Title",
168
- "type": "text"
136
+ {
137
+ "height": 90,
138
+ "time": "00:01:17",
139
+ "url": "http://i.ytimg.com/vi/XXXXXXXXXXX/1.jpg",
140
+ "width": 120
169
141
  },
170
- "updated": {
171
- "$t": "2012-01-01T00:50:00.000Z"
142
+ {
143
+ "height": 90,
144
+ "time": "00:02:34",
145
+ "url": "http://i.ytimg.com/vi/XXXXXXXXXXX/2.jpg",
146
+ "width": 120
172
147
  },
173
- "yt$hd": {},
174
- "yt$statistics": {
175
- "favoriteCount": "0",
176
- "viewCount": "1"
148
+ {
149
+ "height": 90,
150
+ "time": "00:03:51",
151
+ "url": "http://i.ytimg.com/vi/XXXXXXXXXXX/3.jpg",
152
+ "width": 120
177
153
  }
178
- }
179
- ],
180
- "generator": {
181
- "$t": "YouTube data API",
182
- "uri": "http://gdata.youtube.com",
183
- "version": "2.1"
154
+ ],
155
+ "media$title": {
156
+ "$t": "Title",
157
+ "type": "plain"
158
+ },
159
+ "yt$duration": {
160
+ "seconds": "308"
161
+ }
162
+ },
163
+ "published": {
164
+ "$t": "2012-01-01T00:50:00.000Z"
184
165
  },
185
- "id": {
186
- "$t": "http://gdata.youtube.com/feeds/api/videos"
166
+ "title": {
167
+ "$t": "Title",
168
+ "type": "text"
169
+ },
170
+ "updated": {
171
+ "$t": "2012-01-01T00:50:00.000Z"
187
172
  },
188
- "link": [
173
+ "yt$hd": {},
174
+ "yt$statistics": {
175
+ "favoriteCount": "0",
176
+ "viewCount": "1"
177
+ }
178
+ }
179
+ ],
180
+ "generator": {
181
+ "$t": "YouTube data API",
182
+ "uri": "http://gdata.youtube.com",
183
+ "version": "2.1"
184
+ },
185
+ "id": {
186
+ "$t": "http://gdata.youtube.com/feeds/api/videos"
187
+ },
188
+ "link": [
189
189
  {
190
190
  "href": "http://www.youtube.com",
191
191
  "rel": "alternate",
@@ -212,30 +212,30 @@
212
212
  "type": "application/atom+xml"
213
213
  }
214
214
  ],
215
- "logo": {
216
- "$t": "http://www.youtube.com/img/pic_youtubelogo_123x63.gif"
217
- },
218
- "openSearch$itemsPerPage": {
219
- "$t": 1
220
- },
221
- "openSearch$startIndex": {
222
- "$t": 1
223
- },
224
- "openSearch$totalResults": {
225
- "$t": 1111
226
- },
227
- "title": {
228
- "$t": "Videos matching: searchword",
229
- "type": "text"
230
- },
231
- "updated": {
232
- "$t": "2012-01-01T00:50:00.000Z"
233
- },
234
- "xmlns": "http://www.w3.org/2005/Atom",
235
- "xmlns$gd": "http://schemas.google.com/g/2005",
236
- "xmlns$media": "http://search.yahoo.com/mrss/",
237
- "xmlns$openSearch": "http://a9.com/-/spec/opensearchrss/1.0/",
238
- "xmlns$yt": "http://gdata.youtube.com/schemas/2007"
215
+ "logo": {
216
+ "$t": "http://www.youtube.com/img/pic_youtubelogo_123x63.gif"
217
+ },
218
+ "openSearch$itemsPerPage": {
219
+ "$t": 1
220
+ },
221
+ "openSearch$startIndex": {
222
+ "$t": 1
223
+ },
224
+ "openSearch$totalResults": {
225
+ "$t": 1111
226
+ },
227
+ "title": {
228
+ "$t": "Videos matching: searchword",
229
+ "type": "text"
230
+ },
231
+ "updated": {
232
+ "$t": "2012-01-01T00:50:00.000Z"
233
+ },
234
+ "xmlns": "http://www.w3.org/2005/Atom",
235
+ "xmlns$gd": "http://schemas.google.com/g/2005",
236
+ "xmlns$media": "http://search.yahoo.com/mrss/",
237
+ "xmlns$openSearch": "http://a9.com/-/spec/opensearchrss/1.0/",
238
+ "xmlns$yt": "http://gdata.youtube.com/schemas/2007"
239
239
  },
240
240
  "version": "1.0"
241
241
  }