twitter-photos 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,6 +21,10 @@ class TwitterPhoto
21
21
  @tweet = "No tweet for this photo." if @tweet.blank?
22
22
  end
23
23
 
24
+ # Find all TwitterPhoto objects with the username of the given value.
25
+ # @example Find all TwitterPhoto objects where the username == 'bookis'
26
+ # TwitterPhoto.find_by_username('bookis')
27
+ # @param [String] username
24
28
  def self.find_by_username(username)
25
29
  found = []
26
30
  ObjectSpace.each_object(TwitterPhoto) { |o|
@@ -29,7 +33,22 @@ class TwitterPhoto
29
33
  found.sort_by {|x| x.date}
30
34
  end
31
35
 
32
- def self.get_photos_by(username, options={})
36
+ # Fetch photos from Twitpic, yFrog, Twitgoo, and TweetPhoto.
37
+ #
38
+ # @example Find photos by @bookis only from yfrog and twitpic
39
+ # TwitterPhoto.get_photos_by('bookis', :tweetphoto => false, :yfrog => true, :twitpic => true, :twitgoo => false)
40
+ #
41
+ # @option options [true, false] :tweetphoto
42
+ # @option options [true, false] :twitpic
43
+ # @option options [true, false] :yfrog
44
+ # @option options [true, false] :twitgoo
45
+ #
46
+ # @return [TwitterPhoto] collection.
47
+ # @param [String] username
48
+ # Accepts any twitter username
49
+ # @param [Hash] options
50
+ # exclude photo services (optional)
51
+ def self.get_photos_by(username, options={:twitpic => true, :yfrog => true, :tweetphoto => true, :twitgoo => true})
33
52
  @pix = []
34
53
  hydra = Typhoeus::Hydra.new
35
54
 
@@ -128,6 +147,8 @@ class TwitterPhoto
128
147
  end
129
148
  end
130
149
 
150
+ private
151
+
131
152
  module TimeMod
132
153
  def time_ago_to_date(tweet_date)
133
154
  date = DateTime.now
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - bookis
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-23 00:00:00 -07:00
17
+ date: 2010-05-24 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -57,6 +57,39 @@ files:
57
57
  - README.rdoc
58
58
  - Rakefile
59
59
  - VERSION
60
+ - doc/DateTime.html
61
+ - doc/LICENSE.html
62
+ - doc/README_rdoc.html
63
+ - doc/TimeMod.html
64
+ - doc/TwitterPhoto.html
65
+ - doc/created.rid
66
+ - doc/images/brick.png
67
+ - doc/images/brick_link.png
68
+ - doc/images/bug.png
69
+ - doc/images/bullet_black.png
70
+ - doc/images/bullet_toggle_minus.png
71
+ - doc/images/bullet_toggle_plus.png
72
+ - doc/images/date.png
73
+ - doc/images/find.png
74
+ - doc/images/loadingAnimation.gif
75
+ - doc/images/macFFBgHack.png
76
+ - doc/images/package.png
77
+ - doc/images/page_green.png
78
+ - doc/images/page_white_text.png
79
+ - doc/images/page_white_width.png
80
+ - doc/images/plugin.png
81
+ - doc/images/ruby.png
82
+ - doc/images/tag_green.png
83
+ - doc/images/wrench.png
84
+ - doc/images/wrench_orange.png
85
+ - doc/images/zoom.png
86
+ - doc/index.html
87
+ - doc/js/darkfish.js
88
+ - doc/js/jquery.js
89
+ - doc/js/quicksearch.js
90
+ - doc/js/thickbox-compressed.js
91
+ - doc/lib/twitter-photos_rb.html
92
+ - doc/rdoc.css
60
93
  - lib/twitter-photos.rb
61
94
  - test/test_helper.rb
62
95
  - test/twitter-photos_test.rb