tinyscrobbler 0.3.2 → 0.3.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.
Files changed (4) hide show
  1. data/Changelog +42 -0
  2. data/README.md +3 -5
  3. data/lib/tinyscrobbler.rb +16 -16
  4. metadata +26 -8
data/Changelog CHANGED
@@ -1,3 +1,45 @@
1
+ commit 5a7d314606c6a37b043ce0c69b60e36b3cf05244
2
+ Author: rogeriopvl <rogeriopvl@gmail.com>
3
+ Date: Mon Jul 5 23:05:54 2010 +0100
4
+
5
+ Bumped to version 0.3.3
6
+
7
+ commit ea43f41b38d28a29d83a8efd291843b0f2714454
8
+ Author: rogeriopvl <rogeriopvl@gmail.com>
9
+ Date: Mon Jul 5 22:55:20 2010 +0100
10
+
11
+ Added gemspec file.
12
+
13
+ commit d2b0ef9b18243e6734774b1832dd8e7d9dcb7875
14
+ Author: rogeriopvl <rogeriopvl@gmail.com>
15
+ Date: Mon Jul 5 22:54:12 2010 +0100
16
+
17
+ Changed tests to use the ruby unit test module. Fixed some array to string that could cause some problems. Removed gemspec from gitignore.
18
+
19
+ commit 1dfe63e0c043def99615f401085881eda50a75f7
20
+ Author: rogeriopvl <rogeriopvl@gmail.com>
21
+ Date: Mon Jul 5 09:30:43 2010 +0100
22
+
23
+ Fixing file permissions again...
24
+
25
+ commit 866b1f8873957bbb5607e059c2abc9356c68bef5
26
+ Author: rogeriopvl <rogeriopvl@gmail.com>
27
+ Date: Mon Jul 5 09:26:14 2010 +0100
28
+
29
+ File permissions...
30
+
31
+ commit 355de08bbf9973b14fc16689f25b1b0f057d64f6
32
+ Author: rogeriopvl <rogeriopvl@gmail.com>
33
+ Date: Wed Jun 30 23:40:49 2010 +0100
34
+
35
+ Updated readme on the installation section. It no longer uses gemcutter, but the oficial Rubygems repo.
36
+
37
+ commit b1bff8760a022f9e753f9b7fb6ee5774876af05f
38
+ Author: Rogerio Vicente <rogerpvl@gmail.com>
39
+ Date: Mon Feb 15 22:21:13 2010 +0000
40
+
41
+ Version 0.3.2
42
+
1
43
  commit 20e419aca78fce1d95b185e0da77965e61ea2746
2
44
  Author: Rogerio Vicente <rogerpvl@gmail.com>
3
45
  Date: Mon Feb 15 16:30:29 2010 +0000
data/README.md CHANGED
@@ -6,16 +6,14 @@ I'm currently learning ruby, so it's very likely that this is not the best ruby
6
6
 
7
7
  ## Installation
8
8
 
9
- In order to install Tinyscrobbler you have to download the latest gem from [gemcutter.org](http://gemcutter.org). If you've never installed a gem from gemcutter you need to add it to your sources:
10
-
11
- $ gem sources -a http://gemcutter.org
12
-
13
- Then install the gem just like any other:
9
+ To install Tinyscrobbler use rubygems:
14
10
 
15
11
  $ gem install tinyscrobbler
16
12
 
17
13
  Depending on your system, you might need to use `sudo` to execute gem commands.
18
14
 
15
+ **Rubygems page:** [http://rubygems.org/gems/tinyscrobbler](http://rubygems.org/gems/tinyscrobbler)
16
+
19
17
  ## How to use
20
18
 
21
19
  Some code example on how to use tinyscrobbler:
@@ -28,7 +28,7 @@ module Tinyscrobbler
28
28
  class Client
29
29
 
30
30
  CLIENT_ID = 'tny'
31
- CLIENT_VERSION = '0.3.2'
31
+ CLIENT_VERSION = '0.3.3'
32
32
 
33
33
  HANDSHAKE_BASE_URL = "http://post.audioscrobbler.com/?hs=true&p=1.2.1&c=#{CLIENT_ID}&v=#{CLIENT_VERSION}"
34
34
 
@@ -76,12 +76,12 @@ module Tinyscrobbler
76
76
 
77
77
  def now_playing(track)
78
78
  params = "s=#{@session_id}"
79
- params << "&a=#{URI.escape(track['artistname'])}"
80
- params << "&t=#{URI.escape(track['track'])}"
81
- params << "&b=#{URI.escape(track['album'])}"
82
- params << "&l=#{URI.escape(track['secs'])}"
83
- params << "&n=#{URI.escape(track['tracknumber'])}"
84
- params << "&m=#{URI.escape(track['mbtrackid'])}"
79
+ params << "&a=#{URI.escape(track['artistname'].to_s)}"
80
+ params << "&t=#{URI.escape(track['track'].to_s)}"
81
+ params << "&b=#{URI.escape(track['album'].to_s)}"
82
+ params << "&l=#{URI.escape(track['secs'].to_s)}"
83
+ params << "&n=#{URI.escape(track['tracknumber'].to_s)}"
84
+ params << "&m=#{URI.escape(track['mbtrackid'].to_s)}"
85
85
 
86
86
  send_submission(@now_playing_url, params)
87
87
  end
@@ -134,15 +134,15 @@ module Tinyscrobbler
134
134
  params = "s=#{@session_id}"
135
135
  counter = 0
136
136
  @queue.each do |item|
137
- params << "&a[#{counter}]=#{URI.escape(item['artistname'])}"
138
- params << "&t[#{counter}]=#{URI.escape(item['track'])}"
139
- params << "&i[#{counter}]=#{URI.escape(item['time'])}"
140
- params << "&o[#{counter}]=#{URI.escape(item['source'])}"
141
- params << "&r[#{counter}]=#{URI.escape(item['rating'])}"
142
- params << "&l[#{counter}]=#{URI.escape(item['secs'])}"
143
- params << "&b[#{counter}]=#{URI.escape(item['album'])}"
144
- params << "&n[#{counter}]=#{URI.escape(item['tracknumber'])}"
145
- params << "&m[#{counter}]=#{URI.escape(item['mbtrackid'])}"
137
+ params << "&a[#{counter}]=#{URI.escape(item['artistname'].to_s)}"
138
+ params << "&t[#{counter}]=#{URI.escape(item['track'].to_s)}"
139
+ params << "&i[#{counter}]=#{URI.escape(item['time'].to_s)}"
140
+ params << "&o[#{counter}]=#{URI.escape(item['source'].to_s)}"
141
+ params << "&r[#{counter}]=#{URI.escape(item['rating'].to_s)}"
142
+ params << "&l[#{counter}]=#{URI.escape(item['secs'].to_s)}"
143
+ params << "&b[#{counter}]=#{URI.escape(item['album'].to_s)}"
144
+ params << "&n[#{counter}]=#{URI.escape(item['tracknumber'].to_s)}"
145
+ params << "&m[#{counter}]=#{URI.escape(item['mbtrackid'].to_s)}"
146
146
  counter+=1
147
147
  end
148
148
 
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tinyscrobbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ hash: 21
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 3
9
+ - 3
10
+ version: 0.3.3
5
11
  platform: ruby
6
12
  authors:
7
13
  - "Rog\xC3\xA9rio Vicente"
@@ -14,14 +20,20 @@ default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: ruby-mp3info
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 29
30
+ segments:
31
+ - 0
32
+ - 6
33
+ - 13
23
34
  version: 0.6.13
24
- version:
35
+ type: :runtime
36
+ version_requirements: *id001
25
37
  description:
26
38
  email: rogeriopvl@gmail.com
27
39
  executables: []
@@ -47,21 +59,27 @@ rdoc_options: []
47
59
  require_paths:
48
60
  - lib
49
61
  required_ruby_version: !ruby/object:Gem::Requirement
62
+ none: false
50
63
  requirements:
51
64
  - - ">="
52
65
  - !ruby/object:Gem::Version
66
+ hash: 3
67
+ segments:
68
+ - 0
53
69
  version: "0"
54
- version:
55
70
  required_rubygems_version: !ruby/object:Gem::Requirement
71
+ none: false
56
72
  requirements:
57
73
  - - ">="
58
74
  - !ruby/object:Gem::Version
75
+ hash: 3
76
+ segments:
77
+ - 0
59
78
  version: "0"
60
- version:
61
79
  requirements: []
62
80
 
63
81
  rubyforge_project:
64
- rubygems_version: 1.3.5
82
+ rubygems_version: 1.3.7
65
83
  signing_key:
66
84
  specification_version: 3
67
85
  summary: A very lightweight last.fm scrobbler library written in ruby.