soundcloud-ruby-api-wrapper 0.2.1 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/soundcloud/models/track.rb +24 -12
  3. data/lib/soundcloud.rb +1 -2
  4. data/ruby-api-wrapper.gemspec +2 -33
  5. data/spec/soundcloud_comment_spec.rb +1 -1
  6. data/spec/soundcloud_event_spec.rb +1 -1
  7. data/spec/soundcloud_playlist_spec.rb +1 -2
  8. data/spec/soundcloud_spec.rb +1 -1
  9. data/spec/soundcloud_track_spec.rb +19 -4
  10. data/spec/soundcloud_user_spec.rb +1 -1
  11. metadata +2 -33
  12. data/doc/classes/Soundcloud/Models/Comment.html +0 -197
  13. data/doc/classes/Soundcloud/Models/Comment.src/M000007.html +0 -22
  14. data/doc/classes/Soundcloud/Models/Event.html +0 -190
  15. data/doc/classes/Soundcloud/Models/Event.src/M000009.html +0 -18
  16. data/doc/classes/Soundcloud/Models/Playlist.html +0 -220
  17. data/doc/classes/Soundcloud/Models/Playlist.src/M000009.html +0 -20
  18. data/doc/classes/Soundcloud/Models/Playlist.src/M000010.html +0 -20
  19. data/doc/classes/Soundcloud/Models/Track.html +0 -348
  20. data/doc/classes/Soundcloud/Models/Track.src/M000003.html +0 -29
  21. data/doc/classes/Soundcloud/Models/Track.src/M000004.html +0 -18
  22. data/doc/classes/Soundcloud/Models/Track.src/M000005.html +0 -22
  23. data/doc/classes/Soundcloud/Models/Track.src/M000006.html +0 -28
  24. data/doc/classes/Soundcloud/Models/User.html +0 -284
  25. data/doc/classes/Soundcloud/Models/User.src/M000008.html +0 -18
  26. data/doc/classes/Soundcloud/Models.html +0 -135
  27. data/doc/classes/Soundcloud.html +0 -213
  28. data/doc/classes/Soundcloud.src/M000001.html +0 -24
  29. data/doc/classes/Soundcloud.src/M000002.html +0 -19
  30. data/doc/created.rid +0 -1
  31. data/doc/files/lib/soundcloud/models/base_rb.html +0 -101
  32. data/doc/files/lib/soundcloud/models/comment_rb.html +0 -101
  33. data/doc/files/lib/soundcloud/models/event_rb.html +0 -101
  34. data/doc/files/lib/soundcloud/models/playlist_rb.html +0 -101
  35. data/doc/files/lib/soundcloud/models/track_rb.html +0 -101
  36. data/doc/files/lib/soundcloud/models/user_rb.html +0 -101
  37. data/doc/files/lib/soundcloud_rb.html +0 -127
  38. data/doc/fr_class_index.html +0 -33
  39. data/doc/fr_file_index.html +0 -33
  40. data/doc/fr_method_index.html +0 -36
  41. data/doc/index.html +0 -24
  42. data/doc/rdoc-style.css +0 -208
@@ -1,28 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>create (Soundcloud::Models::Track)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/soundcloud/models/track.rb, line 123</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span>
15
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@asset_data</span>.<span class="ruby-identifier">nil?</span>
16
- <span class="ruby-keyword kw">super</span>
17
- <span class="ruby-keyword kw">else</span>
18
- <span class="ruby-comment cmt">#post asset_data </span>
19
- <span class="ruby-identifier">params</span> = {<span class="ruby-value str">'track[title]'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">title</span>,<span class="ruby-value str">'track[sharing]'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sharing</span>}
20
- <span class="ruby-identifier">response</span> = <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">handle_response</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">send_multipart_request</span>(<span class="ruby-identifier">:post</span>,<span class="ruby-value str">'/tracks'</span>,<span class="ruby-value str">'track[asset_data]'</span>,<span class="ruby-ivar">@asset_data</span>,<span class="ruby-identifier">params</span>))
21
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">id</span> = <span class="ruby-identifier">id_from_response</span>(<span class="ruby-identifier">response</span>)
22
- <span class="ruby-ivar">@asset_data</span> = <span class="ruby-keyword kw">nil</span>
23
- <span class="ruby-comment cmt"># second, 'normal' update request</span>
24
- <span class="ruby-identifier">update</span>
25
- <span class="ruby-keyword kw">end</span>
26
- <span class="ruby-keyword kw">end</span></pre>
27
- </body>
28
- </html>
@@ -1,284 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: Soundcloud::Models::User</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">Soundcloud::Models::User</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../../files/lib/soundcloud/models/user_rb.html">
59
- lib/soundcloud/models/user.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- Base
69
- </td>
70
- </tr>
71
- </table>
72
- </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
- <div id="description">
82
- <p>
83
- SC API Attributes (as of 26/05/09):
84
- </p>
85
- <ul>
86
- <li>id
87
-
88
- </li>
89
- <li>username
90
-
91
- </li>
92
- <li>full_name
93
-
94
- </li>
95
- <li>description
96
-
97
- </li>
98
- <li>city
99
-
100
- </li>
101
- <li>country
102
-
103
- </li>
104
- <li>discogs_name
105
-
106
- </li>
107
- <li>myspace_name
108
-
109
- </li>
110
- <li>website
111
-
112
- </li>
113
- <li>website_title
114
-
115
- </li>
116
- <li>online
117
-
118
- </li>
119
- <li>avatar_url
120
-
121
- </li>
122
- <li>permalink_url
123
-
124
- </li>
125
- <li>uri
126
-
127
- </li>
128
- <li>track_count
129
-
130
- </li>
131
- </ul>
132
- <p>
133
- Custom Wrapper Attributes/Methods:
134
- </p>
135
- <ul>
136
- <li>tracks
137
-
138
- </li>
139
- <li>contacts
140
-
141
- </li>
142
- <li>comments
143
-
144
- </li>
145
- <li>favorites
146
-
147
- </li>
148
- <li>playlists
149
-
150
- </li>
151
- <li>fans
152
-
153
- </li>
154
- <li>is_contact?
155
-
156
- </li>
157
- <li>add_contact!
158
-
159
- </li>
160
- <li>remove_contact!
161
-
162
- </li>
163
- <li>has_favorite?(track/track_id)
164
-
165
- </li>
166
- <li>has_contact?(user/user_id)
167
-
168
- </li>
169
- </ul>
170
- <p>
171
- Look up the resource attributes and filtering usage here:
172
- </p>
173
- <p>
174
- <a
175
- href="http://wiki.github.com/soundcloud/api/documentation#user">wiki.github.com/soundcloud/api/documentation#user</a>
176
- </p>
177
- <p>
178
- Custom Wrapper Class Methods
179
- </p>
180
- <ul>
181
- <li><a href="User.html#M000008">find_me</a>
182
-
183
- </li>
184
- </ul>
185
- <p>
186
- Examples:
187
- </p>
188
- <pre>
189
- # gets the logged-in user
190
- me = client.User.find_me
191
-
192
- # gets the user with username userABC
193
- user = sc_client.User.find('userABC')
194
-
195
- # finds all users named joe and print their usernames
196
- joes = sc_client.User.find(:all, :params=&gt; {:q =&gt; &quot;joe&quot;})
197
- joes.each do |user|
198
- p user.username
199
- end
200
-
201
- # checks if the first user named joe is following the second user named joe
202
- joe1 = joes.first
203
- joe2 = joes[1]
204
- joe1.has_contact?(joe2)
205
-
206
- # makes the loggedin user following joe2
207
- joe2.add_contact!
208
-
209
- # Display 50 (Soundcloud API limit) tracks of a user
210
- user = sc_client.User.find('some-user')
211
- user.tracks.each do |track|
212
- p track.title
213
- end
214
-
215
- # Get all fans of a user
216
- fans = []
217
- limit = 50
218
- begin
219
- some_fans = famous_dj.fans({:offset =&gt; fans.count, :limit =&gt; limit})
220
- fans += some_fans
221
- end while some_fans.count &gt;= limit
222
- </pre>
223
-
224
- </div>
225
-
226
-
227
- </div>
228
-
229
- <div id="method-list">
230
- <h3 class="section-bar">Methods</h3>
231
-
232
- <div class="name-list">
233
- <a href="#M000008">find_me</a>&nbsp;&nbsp;
234
- </div>
235
- </div>
236
-
237
- </div>
238
-
239
-
240
- <!-- if includes -->
241
-
242
- <div id="section">
243
-
244
-
245
-
246
-
247
-
248
-
249
-
250
-
251
- <!-- if method_list -->
252
- <div id="methods">
253
- <h3 class="section-bar">Public Class methods</h3>
254
-
255
- <div id="method-M000008" class="method-detail">
256
- <a name="M000008"></a>
257
-
258
- <div class="method-heading">
259
- <a href="User.src/M000008.html" target="Code" class="method-signature"
260
- onclick="popupCode('User.src/M000008.html');return false;">
261
- <span class="method-name">find_me</span><span class="method-args">()</span>
262
- </a>
263
- </div>
264
-
265
- <div class="method-description">
266
- <p>
267
- Convenience method to find the logged in user
268
- </p>
269
- </div>
270
- </div>
271
-
272
-
273
- </div>
274
-
275
-
276
- </div>
277
-
278
-
279
- <div id="validator-badges">
280
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
281
- </div>
282
-
283
- </body>
284
- </html>
@@ -1,18 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>find_me (Soundcloud::Models::User)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/soundcloud/models/user.rb, line 88</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">find_me</span>
15
- <span class="ruby-identifier">find</span>(<span class="ruby-identifier">:one</span>, <span class="ruby-identifier">:from</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'/me'</span>)
16
- <span class="ruby-keyword kw">end</span></pre>
17
- </body>
18
- </html>
@@ -1,135 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Module: Soundcloud::Models</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Module</strong></td>
53
- <td class="class-name-in-header">Soundcloud::Models</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/soundcloud/models/base_rb.html">
59
- lib/soundcloud/models/base.rb
60
- </a>
61
- <br />
62
- <a href="../../files/lib/soundcloud/models/comment_rb.html">
63
- lib/soundcloud/models/comment.rb
64
- </a>
65
- <br />
66
- <a href="../../files/lib/soundcloud/models/track_rb.html">
67
- lib/soundcloud/models/track.rb
68
- </a>
69
- <br />
70
- <a href="../../files/lib/soundcloud/models/user_rb.html">
71
- lib/soundcloud/models/user.rb
72
- </a>
73
- <br />
74
- <a href="../../files/lib/soundcloud/models/playlist_rb.html">
75
- lib/soundcloud/models/playlist.rb
76
- </a>
77
- <br />
78
- <a href="../../files/lib/soundcloud/models/event_rb.html">
79
- lib/soundcloud/models/event.rb
80
- </a>
81
- <br />
82
- </td>
83
- </tr>
84
-
85
- </table>
86
- </div>
87
- <!-- banner header -->
88
-
89
- <div id="bodyContent">
90
-
91
-
92
-
93
- <div id="contextContent">
94
-
95
-
96
-
97
- </div>
98
-
99
-
100
- </div>
101
-
102
-
103
- <!-- if includes -->
104
-
105
- <div id="section">
106
-
107
- <div id="class-list">
108
- <h3 class="section-bar">Classes and Modules</h3>
109
-
110
- Class <a href="Models/Comment.html" class="link">Soundcloud::Models::Comment</a><br />
111
- Class <a href="Models/Event.html" class="link">Soundcloud::Models::Event</a><br />
112
- Class <a href="Models/Playlist.html" class="link">Soundcloud::Models::Playlist</a><br />
113
- Class <a href="Models/Track.html" class="link">Soundcloud::Models::Track</a><br />
114
- Class <a href="Models/User.html" class="link">Soundcloud::Models::User</a><br />
115
-
116
- </div>
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
- <!-- if method_list -->
125
-
126
-
127
- </div>
128
-
129
-
130
- <div id="validator-badges">
131
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
132
- </div>
133
-
134
- </body>
135
- </html>