scrobbler 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +1 -0
- data/README.rdoc +5 -1
- data/examples/track.rb +5 -1
- data/lib/scrobbler/rest.rb +6 -2
- data/lib/scrobbler/version.rb +1 -1
- data/scrobbler.gemspec +2 -4
- metadata +5 -3
data/History.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
* v 0.2.3: changed the way things get escaped in hopes that it would fix some problems some were having
|
1
2
|
* v 0.2.2: a bunch of changes from titanous, mostly refactoring
|
2
3
|
* v 0.2.0: added support for scrobbling tracks and now playing submission (Titanous)
|
3
4
|
* v 0.1.0: initial release
|
data/README.rdoc
CHANGED
@@ -104,4 +104,8 @@ Below is just a sampling of how easy this lib is to use.
|
|
104
104
|
:track_number => 1)
|
105
105
|
|
106
106
|
playing.submit!
|
107
|
-
puts "Playing Submission Status: #{playing.status}"
|
107
|
+
puts "Playing Submission Status: #{playing.status}"
|
108
|
+
|
109
|
+
== Docs
|
110
|
+
|
111
|
+
http://rdoc.info/projects/jnunemaker/scrobbler
|
data/examples/track.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'scrobbler'))
|
2
|
+
require 'pp'
|
2
3
|
|
3
4
|
track = Scrobbler::Track.new('Carrie Underwood', 'Before He Cheats')
|
4
5
|
puts 'Fans'
|
5
6
|
puts "=" * 4
|
6
|
-
track.fans.each { |u| puts "(#{u.weight}) #{u.username}" }
|
7
|
+
track.fans.each { |u| puts "(#{u.weight}) #{u.username}" }
|
8
|
+
|
9
|
+
track = Scrobbler::Track.new('U2 & Green Day', 'The Saints Are Coming')
|
10
|
+
pp track.tags
|
data/lib/scrobbler/rest.rb
CHANGED
@@ -21,8 +21,7 @@ module Scrobbler
|
|
21
21
|
url = URI.join(@base_url, resource)
|
22
22
|
|
23
23
|
if args
|
24
|
-
|
25
|
-
url.query = args.map { |k,v| "%s=%s" % [URI.encode(k.to_s), URI.encode(v.to_s)] }.join("&")
|
24
|
+
url.query = args.map { |k,v| "%s=%s" % [escape(k.to_s), escape(v.to_s)] }.join("&")
|
26
25
|
end
|
27
26
|
|
28
27
|
case method
|
@@ -42,6 +41,11 @@ module Scrobbler
|
|
42
41
|
res = http.start() { |conn| conn.request(req) }
|
43
42
|
res.body
|
44
43
|
end
|
44
|
+
|
45
|
+
private
|
46
|
+
def escape(str)
|
47
|
+
URI.escape(str, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
|
48
|
+
end
|
45
49
|
end
|
46
50
|
end
|
47
51
|
end
|
data/lib/scrobbler/version.rb
CHANGED
data/scrobbler.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{scrobbler}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["John Nunemaker, Jonathan Rudenberg"]
|
9
|
-
s.date = %q{
|
9
|
+
s.date = %q{2009-04-13}
|
10
10
|
s.description = %q{wrapper for audioscrobbler (last.fm) web services}
|
11
11
|
s.email = %q{nunemaker@gmail.com}
|
12
12
|
s.extra_rdoc_files = ["lib/scrobbler/album.rb", "lib/scrobbler/artist.rb", "lib/scrobbler/base.rb", "lib/scrobbler/chart.rb", "lib/scrobbler/playing.rb", "lib/scrobbler/rest.rb", "lib/scrobbler/scrobble.rb", "lib/scrobbler/simpleauth.rb", "lib/scrobbler/tag.rb", "lib/scrobbler/track.rb", "lib/scrobbler/user.rb", "lib/scrobbler/version.rb", "lib/scrobbler.rb", "README.rdoc"]
|
@@ -31,11 +31,9 @@ Gem::Specification.new do |s|
|
|
31
31
|
else
|
32
32
|
s.add_dependency(%q<hpricot>, [">= 0.4.86"])
|
33
33
|
s.add_dependency(%q<activesupport>, [">= 1.4.2"])
|
34
|
-
s.add_dependency(%q<echoe>, [">= 0"])
|
35
34
|
end
|
36
35
|
else
|
37
36
|
s.add_dependency(%q<hpricot>, [">= 0.4.86"])
|
38
37
|
s.add_dependency(%q<activesupport>, [">= 1.4.2"])
|
39
|
-
s.add_dependency(%q<echoe>, [">= 0"])
|
40
38
|
end
|
41
39
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrobbler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker, Jonathan Rudenberg
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-04-13 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -133,6 +133,8 @@ files:
|
|
133
133
|
- test/unit/user_test.rb
|
134
134
|
has_rdoc: true
|
135
135
|
homepage: http://scrobbler.rubyforge.org
|
136
|
+
licenses: []
|
137
|
+
|
136
138
|
post_install_message:
|
137
139
|
rdoc_options:
|
138
140
|
- --line-numbers
|
@@ -158,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
160
|
requirements: []
|
159
161
|
|
160
162
|
rubyforge_project: scrobbler
|
161
|
-
rubygems_version: 1.3.
|
163
|
+
rubygems_version: 1.3.5
|
162
164
|
signing_key:
|
163
165
|
specification_version: 2
|
164
166
|
summary: wrapper for audioscrobbler (last.fm) web services
|