picasa 0.3.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/.gitignore +1 -0
  2. data/.travis.yml +6 -1
  3. data/Gemfile +6 -0
  4. data/README.md +16 -24
  5. data/Rakefile +1 -1
  6. data/lib/picasa.rb +18 -12
  7. data/lib/picasa/api/album.rb +45 -0
  8. data/lib/picasa/client.rb +14 -0
  9. data/lib/picasa/connection.rb +86 -0
  10. data/lib/picasa/exceptions.rb +17 -0
  11. data/lib/picasa/presenter/album.rb +76 -0
  12. data/lib/picasa/presenter/album_list.rb +60 -0
  13. data/lib/picasa/presenter/author.rb +15 -0
  14. data/lib/picasa/presenter/base.rb +29 -0
  15. data/lib/picasa/presenter/link.rb +19 -0
  16. data/lib/picasa/presenter/media.rb +27 -0
  17. data/lib/picasa/presenter/photo.rb +79 -0
  18. data/lib/picasa/presenter/thumbnail.rb +19 -0
  19. data/lib/picasa/utils.rb +44 -0
  20. data/lib/picasa/version.rb +1 -1
  21. data/picasa.gemspec +4 -15
  22. data/test/api/album_test.rb +24 -0
  23. data/test/client_test.rb +14 -0
  24. data/test/connection_test.rb +71 -0
  25. data/test/fixtures/album/album-list-with-tag.txt +105 -0
  26. data/test/fixtures/album/album-list.txt +105 -0
  27. data/test/fixtures/album/album-show-with-max-results.txt +131 -0
  28. data/test/fixtures/album/album-show-with-tag-and-many-photos.txt +156 -0
  29. data/test/fixtures/album/album-show-with-tag-and-one-photo.txt +105 -0
  30. data/test/fixtures/album/album-show.txt +169 -0
  31. data/test/fixtures/auth/failure.txt +12 -0
  32. data/test/fixtures/auth/success.txt +14 -0
  33. data/test/fixtures/json.txt +435 -0
  34. data/test/fixtures/photo/photo-list-all-with-q.txt +556 -0
  35. data/test/fixtures/photo/photo-list-all.txt +623 -0
  36. data/test/fixtures/photo/photo-list-user.txt +388 -0
  37. data/test/fixtures/presenters/album_list.xml +88 -0
  38. data/test/fixtures/presenters/album_show.xml +152 -0
  39. data/test/fixtures/presenters/album_show_with_one_photo.xml +88 -0
  40. data/test/fixtures/tag/tag-list-album.txt +77 -0
  41. data/test/fixtures/tag/tag-list-photo.txt +72 -0
  42. data/test/fixtures/tag/tag-list.txt +68 -0
  43. data/test/helper.rb +12 -6
  44. data/test/presenter/album_list_test.rb +67 -0
  45. data/test/presenter/album_test.rb +173 -0
  46. data/test/presenter/author_test.rb +17 -0
  47. data/test/presenter/base_test.rb +27 -0
  48. data/test/presenter/link_test.rb +21 -0
  49. data/test/presenter/media_test.rb +29 -0
  50. data/test/presenter/photo_test.rb +81 -0
  51. data/test/presenter/thumbnail_test.rb +24 -0
  52. data/test/utils_test.rb +84 -0
  53. metadata +66 -31
  54. data/lib/picasa/config.rb +0 -15
  55. data/lib/picasa/web_albums.rb +0 -56
  56. data/test/fixtures/albums +0 -15
  57. data/test/fixtures/photos +0 -15
  58. data/test/test_config.rb +0 -12
  59. data/test/test_web_albums.rb +0 -44
@@ -0,0 +1,29 @@
1
+ module Picasa
2
+ module Presenter
3
+ class Base
4
+ include Utils
5
+
6
+ attr_reader :parsed_body
7
+
8
+ def initialize(parsed_body)
9
+ @parsed_body = parsed_body
10
+ end
11
+
12
+ def inspect
13
+ inspection = methods_to_inspect.map do |method|
14
+ value = send(method)
15
+ value = value.nil? ? "nil" : value.inspect
16
+ "#{method}: #{value}"
17
+ end.join(", ")
18
+ "#<#{self.class} #{inspection}>"
19
+ end
20
+
21
+ private
22
+
23
+ def methods_to_inspect
24
+ # Ruby 1.8.7 workaround
25
+ (public_methods - Object.methods).map { |m| m.to_sym } - [:parsed_body]
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,19 @@
1
+ require "picasa/presenter/base"
2
+
3
+ module Picasa
4
+ module Presenter
5
+ class Link < Base
6
+ def rel
7
+ @rel ||= safe_retrieve(parsed_body, "rel")
8
+ end
9
+
10
+ def type
11
+ @type ||= safe_retrieve(parsed_body, "type")
12
+ end
13
+
14
+ def href
15
+ @href ||= safe_retrieve(parsed_body, "href")
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,27 @@
1
+ require "picasa/presenter/base"
2
+
3
+ module Picasa
4
+ module Presenter
5
+ class Media < Base
6
+ def thumbnails
7
+ @thumbnails ||= array_wrap(safe_retrieve(parsed_body, "thumbnail")).map { |thumbnail| Thumbnail.new(thumbnail) }
8
+ end
9
+
10
+ def credit
11
+ @credit ||= safe_retrieve(parsed_body, "credit")
12
+ end
13
+
14
+ def description
15
+ @description ||= safe_retrieve(parsed_body, "description")
16
+ end
17
+
18
+ def keywords
19
+ @keywords ||= safe_retrieve(parsed_body, "keywords")
20
+ end
21
+
22
+ def title
23
+ @title ||= safe_retrieve(parsed_body, "title", "__content__")
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,79 @@
1
+ require "picasa/presenter/base"
2
+
3
+ module Picasa
4
+ module Presenter
5
+ class Photo < Base
6
+ def links
7
+ @links ||= safe_retrieve(parsed_body, "link").map { |link| Link.new(link) }
8
+ end
9
+
10
+ def media
11
+ @media ||= Media.new(safe_retrieve(parsed_body, "group"))
12
+ end
13
+
14
+ def id
15
+ @id ||= array_wrap(safe_retrieve(parsed_body, "id"))[1]
16
+ end
17
+
18
+ def published
19
+ @published ||= map_to_date(safe_retrieve(parsed_body, "published"))
20
+ end
21
+
22
+ def updated
23
+ @updated ||= map_to_date(safe_retrieve(parsed_body, "updated"))
24
+ end
25
+
26
+ def title
27
+ @title ||= safe_retrieve(parsed_body, "title")
28
+ end
29
+
30
+ def summary
31
+ @summary ||= safe_retrieve(parsed_body, "summary")
32
+ end
33
+
34
+ def album_id
35
+ @album_id ||= safe_retrieve(parsed_body, "albumid")
36
+ end
37
+
38
+ def access
39
+ @access ||= safe_retrieve(parsed_body, "access")
40
+ end
41
+
42
+ def width
43
+ @width ||= map_to_integer(safe_retrieve(parsed_body, "width"))
44
+ end
45
+
46
+ def height
47
+ @height ||= map_to_integer(safe_retrieve(parsed_body, "height"))
48
+ end
49
+
50
+ def size
51
+ @size ||= map_to_integer(safe_retrieve(parsed_body, "size"))
52
+ end
53
+
54
+ def checksum
55
+ @checksum ||= safe_retrieve(parsed_body, "checksum")
56
+ end
57
+
58
+ def timestamp
59
+ @timestamp ||= safe_retrieve(parsed_body, "timestamp")
60
+ end
61
+
62
+ def image_version
63
+ @image_version ||= map_to_integer(safe_retrieve(parsed_body, "imageVersion"))
64
+ end
65
+
66
+ def commenting_enabled
67
+ @commenting_enabled ||= map_to_boolean(safe_retrieve(parsed_body, "commentingEnabled"))
68
+ end
69
+
70
+ def comment_count
71
+ @comment_count ||= map_to_integer(safe_retrieve(parsed_body, "commentCount"))
72
+ end
73
+
74
+ def license
75
+ @license ||= safe_retrieve(parsed_body, "license", "__content__")
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,19 @@
1
+ require "picasa/presenter/base"
2
+
3
+ module Picasa
4
+ module Presenter
5
+ class Thumbnail < Base
6
+ def url
7
+ @url ||= safe_retrieve(parsed_body, "url")
8
+ end
9
+
10
+ def width
11
+ @width ||= map_to_integer(safe_retrieve(parsed_body, "width"))
12
+ end
13
+
14
+ def height
15
+ @height ||= map_to_integer(safe_retrieve(parsed_body, "height"))
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,44 @@
1
+ require "date"
2
+
3
+ module Picasa
4
+ module Utils
5
+ def safe_retrieve(hash, *keys)
6
+ return if !hash.kind_of?(Hash) || !hash.has_key?(keys.first)
7
+
8
+ if keys.size == 1
9
+ hash[keys.first]
10
+ elsif keys.size > 1
11
+ Utils.safe_retrieve(hash[keys.first], *keys[1..-1])
12
+ end
13
+ end
14
+
15
+ # Ported from ActiveSupport
16
+ def array_wrap(object)
17
+ if object.nil?
18
+ []
19
+ elsif object.respond_to?(:to_ary)
20
+ object.to_ary || [object]
21
+ else
22
+ [object]
23
+ end
24
+ end
25
+
26
+ def map_to_integer(value)
27
+ value && value.to_i
28
+ end
29
+
30
+ def map_to_date(value)
31
+ value && DateTime.parse(value)
32
+ end
33
+
34
+ def map_to_boolean(value)
35
+ return unless value
36
+ case value
37
+ when "true" then true
38
+ when "false" then false
39
+ end
40
+ end
41
+
42
+ module_function :safe_retrieve, :array_wrap, :map_to_integer, :map_to_boolean, :map_to_date
43
+ end
44
+ end
@@ -1,3 +1,3 @@
1
1
  module Picasa
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  end
data/picasa.gemspec CHANGED
@@ -12,22 +12,11 @@ Gem::Specification.new do |gem|
12
12
  gem.files = `git ls-files`.split("\n")
13
13
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
14
  gem.name = "picasa"
15
- gem.require_paths = ['lib']
15
+ gem.require_paths = ["lib"]
16
16
  gem.version = Picasa::VERSION
17
17
 
18
- gem.add_dependency "xml-simple"
19
- gem.add_development_dependency "fakeweb"
18
+ gem.add_dependency "multi_xml"
20
19
 
21
- gem.post_install_message = %{
22
- *************************************************************************
23
-
24
- Version 0.4 of this gem will be totaly rewritten.
25
- Gem syntax will change with backwards incompatibilities.
26
- If you don't want to update your code, please specify in your Gemfile:
27
- gem "picasa", "~> 0.3.0"
28
-
29
- Follow https://github.com/morgoth/picasa for updates.
30
-
31
- *************************************************************************
32
- }
20
+ gem.add_development_dependency "webmock"
21
+ gem.add_development_dependency "mocha"
33
22
  end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require "helper"
3
+
4
+ describe Picasa::API::Album do
5
+ describe "#list" do
6
+ it "gives correct parsed body fragment" do
7
+ stub_request(:get, "https://picasaweb.google.com/data/feed/api/user/w.wnetrzak").to_return(fixture("album/album-list.txt"))
8
+
9
+ album_list = Picasa::API::Album.new(:user_id => "w.wnetrzak").list
10
+
11
+ assert_equal 2, album_list.total_results
12
+ end
13
+ end
14
+
15
+ describe "#show" do
16
+ it "gives correct parsed body fragment" do
17
+ stub_request(:get, "https://picasaweb.google.com/data/feed/api/user/w.wnetrzak/albumid/5243667126168669553").to_return(fixture("album/album-show.txt"))
18
+
19
+ album_show = Picasa::API::Album.new(:user_id => "w.wnetrzak").show("5243667126168669553")
20
+
21
+ assert_equal "Wojciech Wnętrzak", album_show.author.name
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,14 @@
1
+ require "helper"
2
+
3
+ describe Picasa::Client do
4
+ it "has credentials" do
5
+ client = Picasa::Client.new(:user_id => "john.doe")
6
+ assert_equal({:user_id => "john.doe"}, client.credentials)
7
+ end
8
+
9
+ it "raises ArgumentError when user_id is missing" do
10
+ assert_raises(Picasa::ArgumentError, /user_id/) do
11
+ Picasa::Client.new
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,71 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require "helper"
3
+
4
+ describe Picasa::Connection do
5
+ before do
6
+ @connection = Picasa::Connection.new(:user_id => "joe.doe")
7
+ end
8
+
9
+ describe "#inline_params" do
10
+ it "converts params to inline style" do
11
+ params = @connection.inline_params({:alt => "json", :kind => "photo"})
12
+ # make ruby 1.8 tests pass
13
+ assert_equal "alt=json", params.split("&").sort[0]
14
+ assert_equal "kind=photo", params.split("&").sort[1]
15
+ end
16
+
17
+ it "changes param keys underscore to dash" do
18
+ params = @connection.inline_params({:max_results => 10})
19
+ assert_equal "max-results=10", params
20
+ end
21
+
22
+ it "escapes values" do
23
+ params = @connection.inline_params({:kind => "żółć"})
24
+ assert_equal "kind=%C5%BC%C3%B3%C5%82%C4%87", params
25
+ end
26
+ end
27
+
28
+ describe "#path_with_params" do
29
+ it "returns path when no params provided" do
30
+ path = @connection.path_with_params("/data/feed/api")
31
+ assert_equal "/data/feed/api", path
32
+ end
33
+
34
+ it "adds params to path" do
35
+ path = @connection.path_with_params("/data/feed/api", {:q => "bomb"})
36
+ assert_equal "/data/feed/api?q=bomb", path
37
+ end
38
+ end
39
+
40
+ describe "authentication" do
41
+ it "successfully authenticates" do
42
+ connection = Picasa::Connection.new(:user_id => "john.doe@domain.com", :password => "secret")
43
+ uri = URI.parse("/data/feed/api/user/#{connection.user_id}")
44
+
45
+ stub_request(:post, "https://www.google.com/accounts/ClientLogin").to_return(fixture("auth/success.txt"))
46
+ stub_request(:get, "https://picasaweb.google.com/data/feed/api/user/john.doe@domain.com").to_return(fixture("album/album-list.txt"))
47
+
48
+ connection.expects(:authenticate).returns(:result)
49
+ refute_nil connection.get(uri.path)
50
+ end
51
+
52
+ it "raises ArgumentError when invalid email given" do
53
+ connection = Picasa::Connection.new(:user_id => "john.doe", :password => "secret")
54
+
55
+ assert_raises(Picasa::ArgumentError) do
56
+ connection.get("/")
57
+ end
58
+ end
59
+
60
+ it "raises an ResponseError when authentication failed" do
61
+ connection = Picasa::Connection.new(:user_id => "john.doe@domain.com", :password => "secret")
62
+ uri = URI.parse("/data/feed/api/user/#{connection.user_id}")
63
+
64
+ stub_request(:post, "https://www.google.com/accounts/ClientLogin").to_return(fixture("auth/failure.txt"))
65
+
66
+ assert_raises(Picasa::ResponseError) do
67
+ connection.get(uri.path)
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,105 @@
1
+ HTTP/1.1 200 OK
2
+ Expires: Mon, 05 Dec 2011 19:18:21 GMT
3
+ Date: Mon, 05 Dec 2011 19:18:21 GMT
4
+ Cache-Control: private, max-age=0, must-revalidate, no-transform
5
+ Set-Cookie: _rtok=JfOWbv9ilfmB; Path=/; Secure; HttpOnly
6
+ Set-Cookie: S=photos_html=gA8kpkA3OJJn4_tnnq1H7w; Domain=.google.com; Path=/; Secure; HttpOnly
7
+ Content-Type: application/atom+xml; charset=UTF-8; type=feed
8
+ Vary: Accept, X-GData-Authorization, GData-Version, Cookie
9
+ GData-Version: 2.0
10
+ ETag: W/"CEIFQngzeSp7ImA9WhRQEUw."
11
+ Last-Modified: Mon, 05 Dec 2011 19:15:13 GMT
12
+ X-Content-Type-Options: nosniff
13
+ X-Frame-Options: SAMEORIGIN
14
+ X-XSS-Protection: 1; mode=block
15
+ Server: GSE
16
+ Transfer-Encoding: chunked
17
+
18
+ <?xml version='1.0' encoding='UTF-8'?>
19
+ <feed xmlns='http://www.w3.org/2005/Atom' xmlns:gphoto='http://schemas.google.com/photos/2007' xmlns:media='http://search.yahoo.com/mrss/' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='W/&quot;CEIFQngzeSp7ImA9WhRQEUw.&quot;'>
20
+ <id>https://picasaweb.google.com/data/feed/user/106136347770555028022</id>
21
+ <updated>2011-12-05T19:15:13.681Z</updated>
22
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/photos/2007#user'/>
23
+ <title>106136347770555028022</title>
24
+ <subtitle/>
25
+ <icon>https://lh3.googleusercontent.com/-6ezHc54U8x0/AAAAAAAAAAI/AAAAAAAAAAA/PBuxm7Ehn6E/s64-c/106136347770555028022.jpg</icon>
26
+ <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://picasaweb.google.com/data/feed/api/user/106136347770555028022'/>
27
+ <link rel='alternate' type='text/html' href='https://picasaweb.google.com/106136347770555028022'/>
28
+ <link rel='http://schemas.google.com/photos/2007#slideshow' type='application/x-shockwave-flash' href='https://picasaweb.google.com/s/c/bin/slideshow.swf?host=picasaweb.google.com&amp;RGB=0x000000&amp;feed=https%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2F106136347770555028022%3Falt%3Drss'/>
29
+ <link rel='self' type='application/atom+xml' href='https://picasaweb.google.com/data/feed/api/user/106136347770555028022?start-index=1&amp;max-results=1000&amp;tag=ziemniaki'/>
30
+ <author>
31
+ <name>Wojciech Wnętrzak</name>
32
+ <uri>https://picasaweb.google.com/106136347770555028022</uri>
33
+ </author>
34
+ <generator version='1.00' uri='http://picasaweb.google.com/'>Picasaweb</generator>
35
+ <openSearch:totalResults>2</openSearch:totalResults>
36
+ <openSearch:startIndex>1</openSearch:startIndex>
37
+ <openSearch:itemsPerPage>1000</openSearch:itemsPerPage>
38
+ <gphoto:user>106136347770555028022</gphoto:user>
39
+ <gphoto:nickname>Wojciech Wnętrzak</gphoto:nickname>
40
+ <gphoto:thumbnail>https://lh3.googleusercontent.com/-6ezHc54U8x0/AAAAAAAAAAI/AAAAAAAAAAA/PBuxm7Ehn6E/s64-c/106136347770555028022.jpg</gphoto:thumbnail>
41
+ <entry gd:etag='&quot;YDsqeyI.&quot;'>
42
+ <id>https://picasaweb.google.com/data/entry/user/106136347770555028022/albumid/5243667126168669553</id>
43
+ <published>2008-09-08T07:00:00.000Z</published>
44
+ <updated>2011-12-05T19:12:04.255Z</updated>
45
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/photos/2007#album'/>
46
+ <title>test2</title>
47
+ <summary/>
48
+ <rights>public</rights>
49
+ <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://picasaweb.google.com/data/feed/api/user/106136347770555028022/albumid/5243667126168669553'/>
50
+ <link rel='alternate' type='text/html' href='https://picasaweb.google.com/106136347770555028022/Test2'/>
51
+ <link rel='self' type='application/atom+xml' href='https://picasaweb.google.com/data/entry/api/user/106136347770555028022/albumid/5243667126168669553'/>
52
+ <author>
53
+ <name>Wojciech Wnętrzak</name>
54
+ <uri>https://picasaweb.google.com/106136347770555028022</uri>
55
+ </author>
56
+ <gphoto:id>5243667126168669553</gphoto:id>
57
+ <gphoto:name>Test2</gphoto:name>
58
+ <gphoto:location/>
59
+ <gphoto:access>public</gphoto:access>
60
+ <gphoto:timestamp>1220857200000</gphoto:timestamp>
61
+ <gphoto:numphotos>3</gphoto:numphotos>
62
+ <gphoto:user>106136347770555028022</gphoto:user>
63
+ <gphoto:nickname>Wojciech Wnętrzak</gphoto:nickname>
64
+ <media:group>
65
+ <media:content url='https://lh6.googleusercontent.com/-u_2FJXbbliU/SMU_eBetTXE/AAAAAAAAAkU/3XThNVnAM-4/Test2.jpg' type='image/jpeg' medium='image'/>
66
+ <media:credit>Wojciech Wnętrzak</media:credit>
67
+ <media:description type='plain'/>
68
+ <media:keywords/>
69
+ <media:thumbnail url='https://lh6.googleusercontent.com/-u_2FJXbbliU/SMU_eBetTXE/AAAAAAAAAkU/3XThNVnAM-4/s160-c/Test2.jpg' height='160' width='160'/>
70
+ <media:title type='plain'>test2</media:title>
71
+ </media:group>
72
+ </entry>
73
+ <entry gd:etag='&quot;YDUqeyI.&quot;'>
74
+ <id>https://picasaweb.google.com/data/entry/user/106136347770555028022/albumid/5239555770355467953</id>
75
+ <published>2008-08-28T07:00:00.000Z</published>
76
+ <updated>2011-07-30T07:16:41.444Z</updated>
77
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/photos/2007#album'/>
78
+ <title>test</title>
79
+ <summary>Opis albumu</summary>
80
+ <rights>public</rights>
81
+ <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://picasaweb.google.com/data/feed/api/user/106136347770555028022/albumid/5239555770355467953'/>
82
+ <link rel='alternate' type='text/html' href='https://picasaweb.google.com/106136347770555028022/Test'/>
83
+ <link rel='self' type='application/atom+xml' href='https://picasaweb.google.com/data/entry/api/user/106136347770555028022/albumid/5239555770355467953'/>
84
+ <author>
85
+ <name>Wojciech Wnętrzak</name>
86
+ <uri>https://picasaweb.google.com/106136347770555028022</uri>
87
+ </author>
88
+ <gphoto:id>5239555770355467953</gphoto:id>
89
+ <gphoto:name>Test</gphoto:name>
90
+ <gphoto:location>gdzieś</gphoto:location>
91
+ <gphoto:access>public</gphoto:access>
92
+ <gphoto:timestamp>1219906800000</gphoto:timestamp>
93
+ <gphoto:numphotos>6</gphoto:numphotos>
94
+ <gphoto:user>106136347770555028022</gphoto:user>
95
+ <gphoto:nickname>Wojciech Wnętrzak</gphoto:nickname>
96
+ <media:group>
97
+ <media:content url='https://lh6.googleusercontent.com/-ZqXRf3HicvI/SLakNnjixrE/AAAAAAAAAkc/3EAZ0eF3-CQ/Test.jpg' type='image/jpeg' medium='image'/>
98
+ <media:credit>Wojciech Wnętrzak</media:credit>
99
+ <media:description type='plain'>Opis albumu</media:description>
100
+ <media:keywords/>
101
+ <media:thumbnail url='https://lh6.googleusercontent.com/-ZqXRf3HicvI/SLakNnjixrE/AAAAAAAAAkc/3EAZ0eF3-CQ/s160-c/Test.jpg' height='160' width='160'/>
102
+ <media:title type='plain'>test</media:title>
103
+ </media:group>
104
+ </entry>
105
+ </feed>