muri 0.0.7 → 0.0.8
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.textile +5 -5
- data/VERSION.yml +1 -1
- data/lib/muri/base.rb +1 -1
- data/lib/muri/filters/facebook.rb +1 -1
- data/lib/muri/filters/flickr.rb +3 -1
- data/muri.gemspec +6 -6
- data/test/error_test.rb +4 -0
- data/test/facebook_test.rb +1 -1
- metadata +5 -5
data/README.textile
CHANGED
|
@@ -35,7 +35,7 @@ Using muri is just as easy!
|
|
|
35
35
|
</code>
|
|
36
36
|
</pre>
|
|
37
37
|
|
|
38
|
-
If @a.valid?@ you are good to go. If not, either the URI host was not recognized, or the path/parameters provided along with a known URI host were not recognized. When these two types of errors are encountered, an exception is caught and returned in @a.errors@ as either "Muri::NoParser" or "Muri::UnrecognizedURI". If you don't care about the type of error, just
|
|
38
|
+
If @a.valid?@ you are good to go. If not, either the URI host was not recognized, or the path/parameters provided along with a known URI host were not recognized. When these two types of errors are encountered, an exception is caught and returned in @a.errors@ as either "Muri::NoParser" or "Muri::UnrecognizedURI" (or potentially "URI::BadURIError" or "URI::InvalidURIError" if the URI passed is bad). If you don't care about the type of error, just whether the URI was parsed, @a.valid?@ will give you a boolean answer.
|
|
39
39
|
|
|
40
40
|
Assuming the URI was successfully parsed (thus @a.valid? == true@), all media types share several common attributes:
|
|
41
41
|
|
|
@@ -62,7 +62,7 @@ Assuming the URI was successfully parsed (thus @a.valid? == true@), all media ty
|
|
|
62
62
|
|
|
63
63
|
* Services with a @media_api_id@ also have a @media_api_type@, which indicates what sort of API call should be made (be it 'photo', 'video', 'media', 'set', 'album', or 'playlist', depending on URI type)
|
|
64
64
|
|
|
65
|
-
* A direct media url for Youtube, Photobucket, Twitpic,
|
|
65
|
+
* A direct media url for Youtube, Photobucket, Twitpic, Imageshack (@http://img#{num}.imageshack.us/img#{num}/#{NUMBER}/#{IMAGENAME}@ format) and flickr (@http://farm#{num}.static.flickr.com/@ format)
|
|
66
66
|
|
|
67
67
|
<pre>
|
|
68
68
|
<code>
|
|
@@ -70,7 +70,7 @@ Assuming the URI was successfully parsed (thus @a.valid? == true@), all media ty
|
|
|
70
70
|
</code>
|
|
71
71
|
</pre>
|
|
72
72
|
|
|
73
|
-
* A media landing website url for Youtube, Photobucket, Imageshack, Vimeo, Twitpic, and Flickr (flickr
|
|
73
|
+
* A media landing website url for Facebook (images, not video), Youtube, Photobucket, Imageshack, Vimeo, Twitpic, and Flickr (flickr returns the @http://flic.kr/p/#{ID}@ short url)
|
|
74
74
|
|
|
75
75
|
<pre>
|
|
76
76
|
<code>
|
|
@@ -78,7 +78,7 @@ Assuming the URI was successfully parsed (thus @a.valid? == true@), all media ty
|
|
|
78
78
|
</code>
|
|
79
79
|
</pre>
|
|
80
80
|
|
|
81
|
-
* Content type for Imageshack, Photobucket and Flickr
|
|
81
|
+
* Content type for Imageshack, Photobucket and Flickr (flickr in the @http://farm#{num}.static.flickr.com/@ format)
|
|
82
82
|
|
|
83
83
|
<pre>
|
|
84
84
|
<code>
|
|
@@ -86,7 +86,7 @@ Assuming the URI was successfully parsed (thus @a.valid? == true@), all media ty
|
|
|
86
86
|
</code>
|
|
87
87
|
</pre>
|
|
88
88
|
|
|
89
|
-
* Thumbnails URL for Youtube Photobucket, Twitpic, and Flickr (flickr in the @http://farm#{num}.static.flickr.com/@ format)
|
|
89
|
+
* Thumbnails URL for Youtube, Photobucket, Twitpic, and Flickr (flickr in the @http://farm#{num}.static.flickr.com/@ format)
|
|
90
90
|
|
|
91
91
|
<pre>
|
|
92
92
|
<code>
|
data/VERSION.yml
CHANGED
data/lib/muri/base.rb
CHANGED
|
@@ -34,7 +34,7 @@ class Muri
|
|
|
34
34
|
@info[:website] = "#{url_common}/photo.php?pid=#{@info[:media_id]}&l=#{share_key}&id=#{media_creator}"
|
|
35
35
|
|
|
36
36
|
# The media_api_id is the PID which can be searched for in the facebook photos table
|
|
37
|
-
@info[:media_api_id] = (media_creator << 32) + @info[:media_id]
|
|
37
|
+
@info[:media_api_id] = (media_creator.to_i << 32) + @info[:media_id].to_i
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
data/lib/muri/filters/flickr.rb
CHANGED
|
@@ -34,7 +34,9 @@ class Muri
|
|
|
34
34
|
# end
|
|
35
35
|
# end
|
|
36
36
|
# @info[:content_type] = $6
|
|
37
|
-
|
|
37
|
+
url_prefix = "http://farm#{farm}.static.flickr.com/#{server_id}/#{@info[:media_id]}_#{media_secret}"
|
|
38
|
+
@info[:media_url] = "#{url_prefix}.jpg"
|
|
39
|
+
@info[:media_thumbnail] = "#{url_prefix}_t.jpg"
|
|
38
40
|
elsif (@url.host + @url.path) =~ /^flic\.kr\/p\/([a-z0-9]*)/i
|
|
39
41
|
@info[:media_id] = self.class.decode58($1)
|
|
40
42
|
@info[:media_api_type] = FLICKR_PHOTO
|
data/muri.gemspec
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{muri}
|
|
8
|
-
s.version = "0.0.
|
|
8
|
+
s.version = "0.0.8"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["William Schneider"]
|
|
@@ -46,13 +46,13 @@ Gem::Specification.new do |s|
|
|
|
46
46
|
s.rubygems_version = %q{1.3.5}
|
|
47
47
|
s.summary = %q{Media URI Parser}
|
|
48
48
|
s.test_files = [
|
|
49
|
-
"test/
|
|
50
|
-
"test/facebook_test.rb",
|
|
51
|
-
"test/flickr_test.rb",
|
|
52
|
-
"test/imageshack_test.rb",
|
|
53
|
-
"test/photobucket_test.rb",
|
|
49
|
+
"test/facebook_test.rb",
|
|
54
50
|
"test/twitpic_test.rb",
|
|
51
|
+
"test/photobucket_test.rb",
|
|
55
52
|
"test/vimeo_test.rb",
|
|
53
|
+
"test/imageshack_test.rb",
|
|
54
|
+
"test/error_test.rb",
|
|
55
|
+
"test/flickr_test.rb",
|
|
56
56
|
"test/youtube_test.rb"
|
|
57
57
|
]
|
|
58
58
|
|
data/test/error_test.rb
CHANGED
data/test/facebook_test.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: muri
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- William Schneider
|
|
@@ -74,11 +74,11 @@ signing_key:
|
|
|
74
74
|
specification_version: 3
|
|
75
75
|
summary: Media URI Parser
|
|
76
76
|
test_files:
|
|
77
|
-
- test/error_test.rb
|
|
78
77
|
- test/facebook_test.rb
|
|
79
|
-
- test/flickr_test.rb
|
|
80
|
-
- test/imageshack_test.rb
|
|
81
|
-
- test/photobucket_test.rb
|
|
82
78
|
- test/twitpic_test.rb
|
|
79
|
+
- test/photobucket_test.rb
|
|
83
80
|
- test/vimeo_test.rb
|
|
81
|
+
- test/imageshack_test.rb
|
|
82
|
+
- test/error_test.rb
|
|
83
|
+
- test/flickr_test.rb
|
|
84
84
|
- test/youtube_test.rb
|