twitter-photos 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/lib/twitter-photos.rb +10 -1
- metadata +2 -2
data/README.rdoc
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.3
|
data/lib/twitter-photos.rb
CHANGED
|
@@ -33,6 +33,15 @@ class TwitterPhoto
|
|
|
33
33
|
found.sort_by {|x| x.date}
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
# Delete all TwitterPhoto objects with the username of the given value.
|
|
37
|
+
# @example Delete all TwitterPhoto objects where the username == 'bookis'
|
|
38
|
+
# TwitterPhoto.delete('bookis')
|
|
39
|
+
# @param [String] username
|
|
40
|
+
|
|
41
|
+
def delete(username)
|
|
42
|
+
TwitterPhoto.find_by_username(username).each{|x| x=nil}
|
|
43
|
+
end
|
|
44
|
+
|
|
36
45
|
# Fetch photos from Twitpic, yFrog, Twitgoo, and TweetPhoto.
|
|
37
46
|
#
|
|
38
47
|
# @example Find photos by @bookis only from yfrog and twitpic
|
|
@@ -49,7 +58,7 @@ class TwitterPhoto
|
|
|
49
58
|
# @param [Hash] options
|
|
50
59
|
# exclude photo services (optional)
|
|
51
60
|
def self.get_photos_by(username, options={:twitpic => true, :yfrog => true, :tweetphoto => true, :twitgoo => true})
|
|
52
|
-
|
|
61
|
+
TwitterPhoto.delete(username)
|
|
53
62
|
hydra = Typhoeus::Hydra.new
|
|
54
63
|
|
|
55
64
|
twitpic_request = Typhoeus::Request.new("#{TWITPIC_URL}/photos/#{username}", :timeout => 5000)
|