dustin-r2flickr 0.1.1.6 → 0.1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README +12 -4
- data/examples/album_test.rb +2 -2
- data/examples/loadr.rb +24 -24
- data/examples/relatedness.rb +52 -52
- data/examples/setdumpr.rb +18 -18
- data/lib/flickr/auth.rb +52 -53
- data/lib/flickr/base.rb +734 -736
- data/lib/flickr/blogs.rb +22 -22
- data/lib/flickr/favorites.rb +55 -55
- data/lib/flickr/groups.rb +67 -66
- data/lib/flickr/interestingness.rb +15 -15
- data/lib/flickr/licenses.rb +19 -19
- data/lib/flickr/notes.rb +18 -18
- data/lib/flickr/people.rb +64 -64
- data/lib/flickr/photos.rb +262 -259
- data/lib/flickr/photosets.rb +87 -89
- data/lib/flickr/pools.rb +62 -59
- data/lib/flickr/reflection.rb +76 -76
- data/lib/flickr/tags.rb +49 -49
- data/lib/flickr/test.rb +15 -14
- data/lib/flickr/token_cache.rb +20 -20
- data/lib/flickr/transform.rb +7 -5
- data/lib/flickr/upload.rb +186 -186
- data/lib/flickr/urls.rb +41 -40
- metadata +1 -1
data/lib/flickr/urls.rb
CHANGED
@@ -1,49 +1,50 @@
|
|
1
1
|
require 'flickr/base'
|
2
2
|
|
3
3
|
class Flickr::Urls < Flickr::APIBase
|
4
|
-
def getGroup(group)
|
5
|
-
group = group.nsid if group.class == Flickr::Group
|
6
|
-
res = @flickr.call_method('flickr.urls.getGroup',
|
7
|
-
'group_id' => group)
|
8
|
-
return res.elements['/group'].attributes['url']
|
9
|
-
end
|
10
4
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
5
|
+
def getGroup(group)
|
6
|
+
group = group.nsid if group.class == Flickr::Group
|
7
|
+
res = @flickr.call_method('flickr.urls.getGroup',
|
8
|
+
'group_id' => group)
|
9
|
+
return res.elements['/group'].attributes['url']
|
10
|
+
end
|
18
11
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
12
|
+
def getUserPhotos(user)
|
13
|
+
user = user.nsid if user.respond_to?(:nsid)
|
14
|
+
args = {}
|
15
|
+
args['user_id'] = user if user
|
16
|
+
res = @flickr.call_method('flickr.urls.getUserPhotos',args)
|
17
|
+
return res.elements['/user'].attributes['url']
|
18
|
+
end
|
26
19
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
20
|
+
def getUserProfile(user)
|
21
|
+
user = user.nsid if user.respond_to?(:nsid)
|
22
|
+
args = {}
|
23
|
+
args['user_id'] = user if user
|
24
|
+
res = @flickr.call_method('flickr.urls.getUserProfile',args)
|
25
|
+
return res.elements['/user'].attributes['url']
|
26
|
+
end
|
31
27
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
return g
|
37
|
-
end
|
28
|
+
def lookupGroup(url)
|
29
|
+
res = @flickr.call_method('flickr.urls.lookupGroup','url'=>url)
|
30
|
+
els = res.elements
|
31
|
+
nsid = els['/group'].attributes['id']
|
38
32
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
33
|
+
g = @flickr.group_cache_lookup(nsid) ||
|
34
|
+
Flickr::Group.new(@flickr,nsid,
|
35
|
+
els['/group/groupname'].text)
|
36
|
+
@flickr.group_cache_store(g)
|
37
|
+
return g
|
38
|
+
end
|
39
|
+
|
40
|
+
def lookupUser(url)
|
41
|
+
res = @flickr.call_method('flickr.urls.lookupUser','url'=>url)
|
42
|
+
els = res.elements
|
43
|
+
nsid = els['/user'].attributes['id']
|
44
|
+
p = @flickr.person_cache_lookup(nsid) ||
|
45
|
+
Flickr::Person.new(@flickr,nsid,
|
46
|
+
els['/user/username'].text)
|
47
|
+
@flickr.person_cache_store(p)
|
48
|
+
return p
|
49
|
+
end
|
49
50
|
end
|