flickr-objects 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +49 -63
- data/lib/flickr/api/abstract/params_processor.rb +68 -0
- data/lib/flickr/api/abstract.rb +113 -0
- data/lib/flickr/api/general.rb +75 -0
- data/lib/flickr/api/person.rb +91 -39
- data/lib/flickr/api/photo.rb +213 -108
- data/lib/flickr/api/set.rb +114 -55
- data/lib/flickr/api/upload_ticket.rb +17 -6
- data/lib/flickr/api.rb +90 -35
- data/lib/flickr/attributes.rb +200 -0
- data/lib/flickr/base_converter.rb +29 -0
- data/lib/flickr/client/data.rb +47 -0
- data/lib/flickr/client/oauth.rb +44 -0
- data/lib/flickr/client/upload.rb +55 -0
- data/lib/flickr/client.rb +77 -33
- data/lib/flickr/configuration.rb +85 -14
- data/lib/flickr/error.rb +58 -0
- data/lib/flickr/middleware.rb +52 -28
- data/lib/flickr/oauth.rb +89 -74
- data/lib/flickr/object/attribute_locations/list.rb +25 -0
- data/lib/flickr/object/attribute_locations/location.rb +29 -0
- data/lib/flickr/object/attribute_locations/permissions.rb +31 -0
- data/lib/flickr/object/attribute_locations/person/upload_status.rb +32 -0
- data/lib/flickr/object/attribute_locations/person.rb +78 -0
- data/lib/flickr/object/attribute_locations/photo/exif.rb +29 -0
- data/lib/flickr/object/attribute_locations/photo/note.rb +36 -0
- data/lib/flickr/object/attribute_locations/photo/tag.rb +23 -0
- data/lib/flickr/object/attribute_locations/photo.rb +164 -0
- data/lib/flickr/object/attribute_locations/set.rb +53 -0
- data/lib/flickr/object/attribute_locations/upload_ticket.rb +30 -0
- data/lib/flickr/object/attribute_locations/visibility.rb +24 -0
- data/lib/flickr/object/list/kaminari.rb +30 -0
- data/lib/flickr/object/list/normal.rb +27 -0
- data/lib/flickr/object/list/will_paginate.rb +31 -0
- data/lib/flickr/object/list.rb +87 -0
- data/lib/flickr/object/location.rb +35 -0
- data/lib/flickr/object/permissions.rb +18 -0
- data/lib/flickr/object/person/upload_status.rb +22 -0
- data/lib/flickr/object/person.rb +93 -0
- data/lib/flickr/object/photo/exif.rb +35 -0
- data/lib/flickr/object/photo/note.rb +20 -0
- data/lib/flickr/object/photo/size.rb +67 -0
- data/lib/flickr/object/photo/tag.rb +23 -0
- data/lib/flickr/object/photo.rb +349 -0
- data/lib/flickr/object/set.rb +114 -0
- data/lib/flickr/object/upload_ticket.rb +31 -0
- data/lib/flickr/object/visibility.rb +16 -0
- data/lib/flickr/object.rb +118 -27
- data/lib/flickr/sanitized_file.rb +70 -0
- data/lib/flickr/version.rb +4 -2
- data/lib/flickr.rb +69 -15
- metadata +89 -103
- data/lib/flickr/api/api_methods/flickr.rb +0 -5
- data/lib/flickr/api/api_methods/person.rb +0 -14
- data/lib/flickr/api/api_methods/photo.rb +0 -26
- data/lib/flickr/api/api_methods/set.rb +0 -18
- data/lib/flickr/api/api_methods/upload_ticket.rb +0 -5
- data/lib/flickr/api/flickr.rb +0 -35
- data/lib/flickr/api_caller.rb +0 -98
- data/lib/flickr/client/methods_client.rb +0 -22
- data/lib/flickr/client/upload_client.rb +0 -62
- data/lib/flickr/errors.rb +0 -19
- data/lib/flickr/helpers/base_58.rb +0 -15
- data/lib/flickr/helpers/boolean.rb +0 -4
- data/lib/flickr/helpers/core_ext.rb +0 -5
- data/lib/flickr/object/attribute/converter.rb +0 -49
- data/lib/flickr/object/attribute/finder.rb +0 -32
- data/lib/flickr/object/attribute.rb +0 -45
- data/lib/flickr/objects/attribute_values/list.rb +0 -10
- data/lib/flickr/objects/attribute_values/location.rb +0 -14
- data/lib/flickr/objects/attribute_values/note.rb +0 -11
- data/lib/flickr/objects/attribute_values/permissions.rb +0 -12
- data/lib/flickr/objects/attribute_values/person/upload_status.rb +0 -16
- data/lib/flickr/objects/attribute_values/person.rb +0 -24
- data/lib/flickr/objects/attribute_values/photo.rb +0 -84
- data/lib/flickr/objects/attribute_values/set.rb +0 -17
- data/lib/flickr/objects/attribute_values/tag.rb +0 -9
- data/lib/flickr/objects/attribute_values/upload_ticket.rb +0 -9
- data/lib/flickr/objects/attribute_values/visibility.rb +0 -10
- data/lib/flickr/objects/list.rb +0 -86
- data/lib/flickr/objects/location.rb +0 -26
- data/lib/flickr/objects/note.rb +0 -14
- data/lib/flickr/objects/permissions.rb +0 -14
- data/lib/flickr/objects/person/upload_status.rb +0 -14
- data/lib/flickr/objects/person.rb +0 -43
- data/lib/flickr/objects/photo.rb +0 -113
- data/lib/flickr/objects/set.rb +0 -29
- data/lib/flickr/objects/tag.rb +0 -17
- data/lib/flickr/objects/upload_ticket.rb +0 -18
- data/lib/flickr/objects/visibility.rb +0 -12
- data/lib/flickr/objects.rb +0 -25
@@ -1,15 +0,0 @@
|
|
1
|
-
class Flickr
|
2
|
-
module Base58
|
3
|
-
ALPHABET = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'.chars.to_a.freeze
|
4
|
-
|
5
|
-
def to_base58(value)
|
6
|
-
value = Integer(value)
|
7
|
-
begin
|
8
|
-
value, remainder = value.divmod(58)
|
9
|
-
result = ALPHABET[remainder] + (result || '')
|
10
|
-
end while value > 0
|
11
|
-
|
12
|
-
result
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require "date"
|
2
|
-
require "flickr/helpers/boolean"
|
3
|
-
|
4
|
-
class Flickr
|
5
|
-
class Object
|
6
|
-
class Attribute::Converter
|
7
|
-
def initialize(instance)
|
8
|
-
@instance = instance
|
9
|
-
end
|
10
|
-
|
11
|
-
def convert(value, type)
|
12
|
-
return value if value.nil?
|
13
|
-
|
14
|
-
if type.is_a?(Array)
|
15
|
-
return value.map {|item| convert(item, type.first) }
|
16
|
-
elsif Object.children.include?(type)
|
17
|
-
return type.new(value, @instance.client)
|
18
|
-
else
|
19
|
-
try_each(CONVERTERS[type]) do |converter|
|
20
|
-
return converter.call(value)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
value
|
25
|
-
end
|
26
|
-
|
27
|
-
CONVERTERS = {
|
28
|
-
::Object => [->(value) { value }],
|
29
|
-
String => [->(value) { String(value) }],
|
30
|
-
Time => [->(value) { Time.at(Integer(value)) }, ->(value) { DateTime.parse(value).to_time }],
|
31
|
-
Boolean => [->(value) { Integer(value) == 1 }],
|
32
|
-
Integer => [->(value) { Integer(value) }],
|
33
|
-
Float => [->(value) { Float(value) }],
|
34
|
-
Hash => [->(value) { value }],
|
35
|
-
}
|
36
|
-
|
37
|
-
private
|
38
|
-
|
39
|
-
def try_each(enum, &block)
|
40
|
-
enum.each do |element|
|
41
|
-
begin
|
42
|
-
yield element
|
43
|
-
rescue
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
class Flickr
|
2
|
-
class Object
|
3
|
-
class Attribute::Finder
|
4
|
-
def initialize(instance)
|
5
|
-
@instance = instance
|
6
|
-
end
|
7
|
-
|
8
|
-
def find(attribute)
|
9
|
-
attribute_values = @instance.class.attribute_values[attribute] || []
|
10
|
-
attribute_values << ->{ @hash.fetch(attribute.to_s) }
|
11
|
-
|
12
|
-
try_each(attribute_values) do |attribute_value|
|
13
|
-
result = @instance.instance_exec(&attribute_value)
|
14
|
-
return result unless result.nil?
|
15
|
-
end
|
16
|
-
|
17
|
-
nil
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def try_each(enum, &block)
|
23
|
-
enum.each do |element|
|
24
|
-
begin
|
25
|
-
yield element
|
26
|
-
rescue
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
class Flickr
|
2
|
-
class Object
|
3
|
-
module Attribute
|
4
|
-
def self.extended(base)
|
5
|
-
base.send(:include, InstanceMethods)
|
6
|
-
end
|
7
|
-
|
8
|
-
def attributes
|
9
|
-
@attributes ||= []
|
10
|
-
end
|
11
|
-
|
12
|
-
def attribute(name, type = ::Object, options = {})
|
13
|
-
attributes << name
|
14
|
-
|
15
|
-
define_method(name) do
|
16
|
-
retrieve_value(name, type)
|
17
|
-
end
|
18
|
-
|
19
|
-
Array(options[:aliases]).each do |alias_name|
|
20
|
-
alias_method alias_name, name
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
module InstanceMethods
|
25
|
-
def attribute_finder
|
26
|
-
Finder.new(self)
|
27
|
-
end
|
28
|
-
|
29
|
-
def attribute_converter
|
30
|
-
Converter.new(self)
|
31
|
-
end
|
32
|
-
|
33
|
-
def retrieve_value(name, type)
|
34
|
-
value = attribute_finder.find(name)
|
35
|
-
attribute_converter.convert(value, type)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
attr_accessor :attribute_values
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
require_relative "attribute/finder"
|
45
|
-
require_relative "attribute/converter"
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class Flickr
|
2
|
-
class Note < Object
|
3
|
-
self.attribute_values = {
|
4
|
-
author: [->{ {"id" => @hash.fetch("author"), "username" => @hash["authorname"]} }],
|
5
|
-
coordinates: [->{ [@hash.fetch("x"), @hash.fetch("y")] }],
|
6
|
-
width: [->{ @hash["w"] }],
|
7
|
-
height: [->{ @hash["h"] }],
|
8
|
-
content: [->{ @hash["_content"] }],
|
9
|
-
}
|
10
|
-
end
|
11
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class Flickr
|
2
|
-
class Permissions < Object
|
3
|
-
self.attribute_values = {
|
4
|
-
can_comment?: [->{ @hash["cancomment"] }, ->{ @hash["can_comment"] }],
|
5
|
-
can_add_meta?: [->{ @hash["canaddmeta"] }],
|
6
|
-
can_download?: [->{ @hash["candownload"] }],
|
7
|
-
can_blog?: [->{ @hash["canblog"] }],
|
8
|
-
can_print?: [->{ @hash["canprint"] }],
|
9
|
-
can_share?: [->{ @hash["canshare"] }],
|
10
|
-
}
|
11
|
-
end
|
12
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
class Flickr
|
2
|
-
class Person::UploadStatus < Object
|
3
|
-
class Month < Object
|
4
|
-
self.attribute_values = {
|
5
|
-
maximum: [->{ @hash["maxkb"] / 1024 }],
|
6
|
-
used: [->{ @hash["usedkb"] / 1024 }],
|
7
|
-
remaining: [->{ @hash["remainingkb"] / 1024 }],
|
8
|
-
}
|
9
|
-
end
|
10
|
-
|
11
|
-
self.attribute_values = {
|
12
|
-
current_month: [->{ @hash["bandwidth"].slice("maxkb", "usedkb", "remainingkb") }],
|
13
|
-
maximum_photo_size: [->{ @hash["filesize"]["maxmb"] }],
|
14
|
-
}
|
15
|
-
end
|
16
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
class Flickr
|
2
|
-
class Person < Object
|
3
|
-
self.attribute_values = {
|
4
|
-
id: [->{ @hash["nsid"] }],
|
5
|
-
nsid: [->{ id }],
|
6
|
-
username: [->{ @hash["username"]["_content"] }],
|
7
|
-
real_name: [->{ @hash["realname"] }, ->{ @hash["realname"]["_content"] }],
|
8
|
-
icon_server: [->{ @hash["iconserver"] }],
|
9
|
-
icon_farm: [->{ @hash["iconfarm"] }],
|
10
|
-
has_pro_account?: [->{ @hash["ispro"] }],
|
11
|
-
location: [->{ @hash["location"]["_content"] }],
|
12
|
-
time_zone: [->{ @hash["timezone"] }],
|
13
|
-
description: [->{ @hash["description"]["_content"] }],
|
14
|
-
photos_url: [->{ @hash["photosurl"]["_content"] }],
|
15
|
-
profile_url: [->{ @hash["profileurl"]["_content"] }],
|
16
|
-
mobile_url: [->{ @hash["mobileurl"]["_content"] }],
|
17
|
-
first_photo_taken: [->{ @hash["photos"]["firstdatetaken"]["_content"] }],
|
18
|
-
first_photo_uploaded: [->{ @hash["photos"]["firstdate"]["_content"] }],
|
19
|
-
favorited_at: [->{ @hash["favedate"] }],
|
20
|
-
photos_count: [->{ @hash["photos"]["count"]["_content"] }],
|
21
|
-
photo_views_count: [->{ @hash["photos"]["views"]["_content"] }],
|
22
|
-
}
|
23
|
-
end
|
24
|
-
end
|
@@ -1,84 +0,0 @@
|
|
1
|
-
class Flickr
|
2
|
-
class Photo < Object
|
3
|
-
self.attribute_values = {
|
4
|
-
uploaded_at: [->{ @hash["dateuploaded"] }, ->{ @hash["dateupload"] }],
|
5
|
-
favorite?: [->{ @hash["isfavorite"] }],
|
6
|
-
posted_at: [->{ @hash["dates"]["posted"] }],
|
7
|
-
taken_at: [->{ @hash["dates"]["taken"] }, ->{ @hash["datetaken"] }],
|
8
|
-
taken_at_granularity: [->{ @hash["dates"]["takengranularity"] }, ->{ @hash["datetakengranularity"] }],
|
9
|
-
updated_at: [->{ @hash["dates"]["lastupdate"] }, ->{ @hash["lastupdate"] }],
|
10
|
-
views_count: [->{ @hash["views"] }],
|
11
|
-
public_editability: [->{ @hash["publiceditability"] }],
|
12
|
-
comments_count: [->{ @hash["comments"]["_content"] }],
|
13
|
-
has_people?: [->{ @hash["people"]["haspeople"] }],
|
14
|
-
notes: [->{ @hash["notes"]["note"] }],
|
15
|
-
tags: [
|
16
|
-
->{ @hash["tags"]["tag"].map { |h| h.merge("photo_id" => @hash["id"]) } },
|
17
|
-
->{
|
18
|
-
[
|
19
|
-
*@hash["tags"].split(" ").map {|content| {"_content" => content, "machine_tag" => 0} },
|
20
|
-
*@hash["machine_tags"].split(" ").map {|content| {"_content" => content, "machine_tag" => 1} }
|
21
|
-
]
|
22
|
-
}
|
23
|
-
],
|
24
|
-
visibility: [->{ @hash["visibility"] }, ->{ @hash.slice("ispublic", "isfriend", "isfamily") if @hash["ispublic"] }],
|
25
|
-
title: [->{ @hash["title"]["_content"] }],
|
26
|
-
description: [->{ @hash["description"]["_content"] }],
|
27
|
-
owner: [
|
28
|
-
->{
|
29
|
-
if @hash["owner"].is_a?(String)
|
30
|
-
{
|
31
|
-
"id" => @hash["owner"],
|
32
|
-
"username" => @hash["ownername"] || @hash["username"],
|
33
|
-
"iconserver" => @hash["iconserver"],
|
34
|
-
"iconfarm" => @hash["iconfarm"],
|
35
|
-
}
|
36
|
-
end
|
37
|
-
}
|
38
|
-
],
|
39
|
-
path_alias: [->{ @hash["pathalias"] }],
|
40
|
-
location_visibility: [
|
41
|
-
->{ @hash["geoperms"] },
|
42
|
-
->{
|
43
|
-
{
|
44
|
-
"isfamily" => @hash.fetch("geo_is_family"),
|
45
|
-
"isfriend" => @hash.fetch("geo_is_friend"),
|
46
|
-
"iscontact" => @hash.fetch("geo_is_contact"),
|
47
|
-
"ispublic" => @hash.fetch("geo_is_public")
|
48
|
-
}
|
49
|
-
}
|
50
|
-
],
|
51
|
-
location: [->{ @hash.slice("latitude", "longitude", "accuracy", "context", "place_id", "woeid") if @hash["latitude"] }],
|
52
|
-
largest_size: [->{ SIZES.key(SIZES.values.reverse.find { |abbr| @hash["url_#{abbr}"] }) }],
|
53
|
-
available_sizes: [->{ SIZES.select { |_, abbr| @hash["url_#{abbr}"] }.keys }],
|
54
|
-
rotation: [->{ @hash["rotation"] }],
|
55
|
-
source_url: [
|
56
|
-
->{ @hash["url_#{SIZES[size]}"] },
|
57
|
-
->{ @hash["size"].find { |hash| hash["label"] == OTHER_SIZES[size] }["source"] }
|
58
|
-
],
|
59
|
-
height: [
|
60
|
-
->{ @hash["height_#{SIZES[size]}"] },
|
61
|
-
->{ @hash["size"].find { |hash| hash["label"] == OTHER_SIZES[size] }["height"] }
|
62
|
-
],
|
63
|
-
width: [
|
64
|
-
->{ @hash["width_#{SIZES[size]}"] },
|
65
|
-
->{ @hash["size"].find { |hash| hash["label"] == OTHER_SIZES[size] }["width"] }
|
66
|
-
],
|
67
|
-
}
|
68
|
-
|
69
|
-
OTHER_SIZES = {
|
70
|
-
"Square 75" => "Square",
|
71
|
-
"Thumbnail" => "Thumbnail",
|
72
|
-
"Square 150" => "Large Square",
|
73
|
-
"Small 240" => "Small",
|
74
|
-
"Small 320" => "Small 320",
|
75
|
-
"Medium 500" => "Medium",
|
76
|
-
"Medium 640" => "Medium 640",
|
77
|
-
"Medium 800" => "Medium 800",
|
78
|
-
"Large 1024" => "Large",
|
79
|
-
"Large 1600" => "Large 1600",
|
80
|
-
"Large 2048" => "Large 2048",
|
81
|
-
"Original" => "Original"
|
82
|
-
}
|
83
|
-
end
|
84
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class Flickr
|
2
|
-
class Set < Object
|
3
|
-
self.attribute_values = {
|
4
|
-
owner: [-> { {"id" => @hash.fetch("owner"), "username" => @hash["username"]} }],
|
5
|
-
url: [-> { "http://www.flickr.com/photos/#{owner.id}/sets/#{id}/" }],
|
6
|
-
photos_count: [-> { @hash["photos"] }, -> { @hash["count_photos"] }],
|
7
|
-
views_count: [-> { @hash["count_views"] }],
|
8
|
-
comments_count: [-> { @hash["count_comments"] }],
|
9
|
-
title: [-> { @hash["title"]["_content"] }],
|
10
|
-
description: [-> { @hash["description"]["_content"] }],
|
11
|
-
permissions: [-> { @hash.slice("can_comment") }],
|
12
|
-
created_at: [-> { @hash["date_create"] }],
|
13
|
-
updated_at: [-> { @hash["date_update"] }],
|
14
|
-
primary_photo: [-> { {"id" => @hash.fetch("primary")} }],
|
15
|
-
}
|
16
|
-
end
|
17
|
-
end
|
data/lib/flickr/objects/list.rb
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
class Flickr
|
2
|
-
case Flickr.configuration.pagination
|
3
|
-
when nil
|
4
|
-
|
5
|
-
class List < Array
|
6
|
-
extend Flickr::Object::Attribute
|
7
|
-
|
8
|
-
attribute :current_page, Integer
|
9
|
-
attribute :per_page, Integer
|
10
|
-
attribute :total_pages, Integer
|
11
|
-
attribute :total_entries, Integer
|
12
|
-
|
13
|
-
def initialize(objects, hash)
|
14
|
-
@hash = hash
|
15
|
-
super(objects)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
when :will_paginate
|
20
|
-
|
21
|
-
require "will_paginate/collection"
|
22
|
-
|
23
|
-
class List < WillPaginate::Collection
|
24
|
-
extend Flickr::Object::Attribute
|
25
|
-
|
26
|
-
def initialize(objects, hash)
|
27
|
-
@hash = hash
|
28
|
-
super(
|
29
|
-
retrieve_value(:current_page, Integer),
|
30
|
-
retrieve_value(:per_page, Integer),
|
31
|
-
retrieve_value(:total_entries, Integer)
|
32
|
-
)
|
33
|
-
replace(objects)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
when :kaminari
|
38
|
-
|
39
|
-
require "kaminari"
|
40
|
-
require "kaminari/models/array_extension"
|
41
|
-
|
42
|
-
class List < Kaminari::PaginatableArray
|
43
|
-
extend Flickr::Object::Attribute
|
44
|
-
|
45
|
-
def initialize(objects, hash)
|
46
|
-
@hash = hash
|
47
|
-
super(objects,
|
48
|
-
offset: retrieve_value(:current_page, Integer),
|
49
|
-
limit: retrieve_value(:per_page, Integer),
|
50
|
-
total_count: retrieve_value(:total_entries, Integer)
|
51
|
-
)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
else
|
56
|
-
raise Error, "supported paginations are :will_paginate or :kaminari (you put \":#{Flickr.configuration.pagination}\")"
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
require_relative "attribute_values/list"
|
61
|
-
|
62
|
-
class Flickr
|
63
|
-
class List
|
64
|
-
def find(id = nil)
|
65
|
-
if block_given?
|
66
|
-
super
|
67
|
-
else
|
68
|
-
if id.is_a?(Array)
|
69
|
-
ids = id.map(&:to_s)
|
70
|
-
select { |object| ids.include?(object.id) }
|
71
|
-
else
|
72
|
-
super() { |object| object.id == id.to_s }
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
def method_missing(name, *args, &block)
|
78
|
-
if name.to_s =~ /find_by_\w+/
|
79
|
-
attribute_name = name[/(?<=find_by_)\w+/]
|
80
|
-
find { |object| object.send(attribute_name) == args.first }
|
81
|
-
else
|
82
|
-
super
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require_relative "attribute_values/location"
|
2
|
-
|
3
|
-
class Flickr
|
4
|
-
class Location < Object
|
5
|
-
|
6
|
-
class Area < Object
|
7
|
-
attribute :name, String
|
8
|
-
attribute :place_id, String
|
9
|
-
attribute :woe_id, String
|
10
|
-
end
|
11
|
-
|
12
|
-
attribute :latitude, Float
|
13
|
-
attribute :longitude, Float
|
14
|
-
attribute :accuracy, Integer
|
15
|
-
attribute :context, Integer
|
16
|
-
attribute :place_id, String
|
17
|
-
attribute :woe_id, String
|
18
|
-
|
19
|
-
attribute :neighbourhood, Area
|
20
|
-
attribute :locality, Area
|
21
|
-
attribute :county, Area
|
22
|
-
attribute :region, Area
|
23
|
-
attribute :country, Area
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
data/lib/flickr/objects/note.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require_relative "attribute_values/note"
|
2
|
-
|
3
|
-
class Flickr
|
4
|
-
class Note < Object
|
5
|
-
|
6
|
-
attribute :id, String
|
7
|
-
attribute :author, Person
|
8
|
-
attribute :coordinates, Array[Integer]
|
9
|
-
attribute :width, Integer
|
10
|
-
attribute :height, Integer
|
11
|
-
attribute :content, String
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require_relative "attribute_values/permissions"
|
2
|
-
|
3
|
-
class Flickr
|
4
|
-
class Permissions < Object
|
5
|
-
|
6
|
-
attribute :can_comment?, Boolean
|
7
|
-
attribute :can_add_meta?, Boolean
|
8
|
-
attribute :can_download?, Boolean
|
9
|
-
attribute :can_blog?, Boolean
|
10
|
-
attribute :can_print?, Boolean
|
11
|
-
attribute :can_share?, Boolean
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require_relative "../attribute_values/person/upload_status"
|
2
|
-
|
3
|
-
class Flickr
|
4
|
-
class Person::UploadStatus < Object
|
5
|
-
class Month < Object
|
6
|
-
attribute :maximum, Integer
|
7
|
-
attribute :used, Integer
|
8
|
-
attribute :remaining, Integer
|
9
|
-
end
|
10
|
-
|
11
|
-
attribute :current_month, Month
|
12
|
-
attribute :maximum_photo_size, Integer
|
13
|
-
end
|
14
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
require_relative "attribute_values/person"
|
2
|
-
require "flickr/api/person"
|
3
|
-
|
4
|
-
class Flickr
|
5
|
-
class Person < Object
|
6
|
-
|
7
|
-
attribute :id, String
|
8
|
-
attribute :nsid, String
|
9
|
-
attribute :username, String
|
10
|
-
attribute :real_name, String
|
11
|
-
attribute :location, String
|
12
|
-
attribute :time_zone, Hash
|
13
|
-
attribute :description, String
|
14
|
-
attribute :has_pro_account?, Boolean
|
15
|
-
|
16
|
-
attribute :icon_server, Integer
|
17
|
-
attribute :icon_farm, Integer
|
18
|
-
|
19
|
-
attribute :photos_url, String
|
20
|
-
attribute :profile_url, String
|
21
|
-
attribute :mobile_url, String
|
22
|
-
|
23
|
-
attribute :first_photo_taken, Time
|
24
|
-
attribute :first_photo_uploaded, Time
|
25
|
-
attribute :favorited_at, Time
|
26
|
-
|
27
|
-
attribute :photos_count, Integer
|
28
|
-
attribute :photo_views_count, Integer
|
29
|
-
|
30
|
-
attribute :path_alias, String
|
31
|
-
|
32
|
-
def buddy_icon_url
|
33
|
-
if icon_farm && icon_server && id
|
34
|
-
if icon_server > 0
|
35
|
-
"http://farm#{icon_farm}.staticflickr.com/#{icon_server}/buddyicons/#{id}.jpg"
|
36
|
-
else
|
37
|
-
"http://www.flickr.com/images/buddyicon.jpg"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
end
|