├── .gitignore
├── .project
├── .travis.yml
├── LICENSE.txt
├── README.md
├── library
└── com.soundcloud.api-1.3.1-all.jar
├── pom.xml
├── repo
└── com
│ └── soundcloud
│ └── api
│ ├── 1.3.1-all
│ ├── api-1.3.1-all.jar
│ ├── api-1.3.1-all.jar.md5
│ ├── api-1.3.1-all.jar.sha1
│ ├── api-1.3.1-all.pom
│ ├── api-1.3.1-all.pom.md5
│ └── api-1.3.1-all.pom.sha1
│ ├── maven-metadata-local.xml
│ ├── maven-metadata-local.xml.md5
│ └── maven-metadata-local.xml.sha1
├── src
├── main
│ └── java
│ │ └── de
│ │ └── voidplus
│ │ └── soundcloud
│ │ ├── Comment.java
│ │ ├── Group.java
│ │ ├── Playlist.java
│ │ ├── SoundCloud.java
│ │ ├── Track.java
│ │ └── User.java
└── test
│ └── java
│ └── de
│ └── voidplus
│ └── soundcloud
│ └── SoundCloudTest.java
└── target
├── soundcloud-0.2.1-jar-with-dependencies.jar
└── soundcloud-0.2.1.jar
/.gitignore:
--------------------------------------------------------------------------------
1 | # os files
2 | Thumbs.db
3 | Desktop.ini
4 | .DS_Store
5 | .svn
6 | ._*
7 | .Spotlight-V100
8 | .Trashes
9 |
10 | # java
11 | .classpath
12 |
13 | # eclipse
14 | .metadata
15 | .settings
16 |
17 | # intellij
18 | *.iml
19 | .idea/
20 | *.ipr
21 | *.iws
22 | out/
23 | .idea_modules/
24 | com_crashlytics_export_strings.xml
25 | crashlytics.properties
26 | crashlytics-build.properties
27 |
28 | # project
29 | target/archive-tmp
30 | target/classes
31 | target/generated-sources
32 | target/generated-test-sources
33 | target/maven-archiver
34 | target/maven-status
35 | target/surefire-reports
36 | target/test-classes
37 | target/MANIFEST.MF
38 |
39 | # sensitive env settings
40 | src/test/java/de/voidplus/soundcloud/Settings.java
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | soundcloud-java-library
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.m2e.core.maven2Builder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.m2e.core.maven2Nature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | branches:
3 | only:
4 | - dev
5 | - master
6 | jdk:
7 | - oraclejdk8
8 | - oraclejdk7
9 | - openjdk6
10 | - openjdk7
11 | - oraclejdk7
12 | env:
13 | global:
14 | - secure: CkTpaU75H56w7/9FKhVPOfFe7SRdmnKNe2IrMTDhOwoVA52gPDhX5Z8K2Aql01QF/FtciqAW3ZtzjMUqQWBQmYSaIf47JuRIs2pHFvb+hBVkc1WjNiKzyR8JZQXv73kYiAKoauYhaQBRGWVo+VP1W7tr1w4q7oWpQqhFRnkE4wQ=
15 | - secure: fxwa1xU9OF+0JRkX8jovLMDM+4Wm0Yz1uLAgwZ5jJ7JUm9kw7VnLvguECtBs/gSgpeTnXFd6Sfk2Er9MdinXfNRyrA0aetx3VEHBXB7CzX7YXdCRj1OrBv/XpR2FtAHXSnFYaSS7K03nZFwZq/upUmCrIQCsxrCn6SYXgmHkM8k=
16 | - secure: ApirEqwtUB+uE4fP9Qwa2iJ4XEtmw3eH7WlBa3OlAsTQ9+GfJGXKhW0IMByHyXtCeKWN+6zdZZP+Kb0Y1yA87dU5fUFmeUkvbQVFs5NyC9e8cJpea2htxH6HhypNm01xhZ5I8X/BZxj0bZfwhkQVjaVnElJfoR9wv6gWgj33QPQ=
17 | - secure: i+l02Eke63nMmWN/u3hDAZ7q3ljASK2SYPDp9xF3ou9JZgl6HYRvFdTWRgtxU03TXGlaK7fEFFc8AOG3Lx27peiPvhRwp0LfQd2ehl3Gg1ry/6mVGdffw7I3z5wBceH0yb9KkMXtqBsKLE74xSx6CkPM9d7QHL1U7PILMO5g3qQ=
18 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright 2012-2015, Darius Morawiec (http://voidplus.de/)
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SoundCloud Java library [](https://travis-ci.org/nok/soundcloud-java-library)
2 |
3 | Unofficial Java library, which simplifies the use of the official [SoundCloud Java API wrapper](https://github.com/soundcloud/java-api-wrapper).
4 |
5 |
6 | ## Table of Contents
7 |
8 | - [**Notice**](#notice)
9 | - [Download](#download)
10 | - [Dependencies](#dependencies)
11 | - [Usage](#usage)
12 | - [Initialization](#initialization)
13 | - [API](#api)
14 | - [REST](#rest)
15 | - [GET](#get)
16 | - [PUT](#put)
17 | - [POST](#post)
18 | - [DELETE](#delete)
19 | - [Examples](#examples)
20 | - [Processing](#processing)
21 | - [Questions?](#questions)
22 | - [License](#license)
23 |
24 |
25 | ## Notice
26 |
27 | **SoundCloud [dropped the support](https://github.com/soundcloud/java-api-wrapper#important-notice) for the official [SoundCloud Java API wrapper](https://github.com/soundcloud/java-api-wrapper), which is a primary dependency.**
28 |
29 |
30 | ## Download
31 |
32 | - [soundcloud-0.2.1-jar-with-dependencies.jar](target/soundcloud-0.2.1-jar-with-dependencies.jar?raw=true) (see the list of [dependencies](#dependencies))
33 | - [soundcloud-0.2.1.jar](target/soundcloud-0.2.1.jar?raw=true)
34 |
35 |
36 | ## Dependencies
37 |
38 | Open and read the [pom.xml file](pom.xml) for all necessary dependencies.
39 |
40 | There are several internal dependencies:
41 |
42 | - [java-api-wrapper-1.3.1-all.jar](https://github.com/soundcloud/java-api-wrapper/) (```gradle jarAll```) by [SoundCloud](https://github.com/soundcloud)
43 | - [com.google.code.gson](http://code.google.com/p/google-gson/) by [Google](https://github.com/google)
44 | - [com.googlecode.json-simple](http://code.google.com/p/json-simple/)
45 |
46 |
47 | ## Usage
48 |
49 | ### Initialization
50 |
51 | Add the library jar to your classpath, import it and create a new instance of `SoundCloud`. Finally connect with specified [application settings](http://soundcloud.com/you/apps) and your personal [login](https://soundcloud.com/login/forgot) data.
52 |
53 | ```java
54 | import de.voidplus.soundcloud.*;
55 | ```
56 | ```java
57 | SoundCloud soundcloud = new SoundCloud(
58 | "appClientId",
59 | "appClientSecret"
60 | );
61 |
62 | // Or, if you need any permissions:
63 |
64 | SoundCloud soundcloud = new SoundCloud(
65 | "appClientId",
66 | "appClientSecret",
67 | "userLoginMail",
68 | "userLoginPass"
69 | );
70 |
71 | // Or:
72 |
73 | SoundCloud soundcloud = new SoundCloud(
74 | "appClientId",
75 | "appClientSecret"
76 | );
77 | soundcloud.login(
78 | "userLoginMail",
79 | "userLoginPass"
80 | );
81 | ```
82 |
83 | ### API
84 |
85 | The service of [Apigee](https://apigee.com/embed/console/soundcloud) is proper for learning and testing the official [SoundCloud API](http://developers.soundcloud.com/docs/api/reference). All API calls are mapped to REST methods:
86 |
87 | ```java
88 | public get( String path [, String[] filters] ) :T // GET
89 | public put( String path [, Object value] ) :T // PUT
90 | public post( String path, Object value ) :T // POST
91 | public delete( String path ) Boolean // DELETE
92 | ```
93 |
94 | ### REST
95 |
96 | You can use the following API calls and/or helpers ("→" ⇔ HTTP 303 See Other Redirect):
97 |
98 | #### GET
99 |
100 | User[.java](src/de/voidplus/soundcloud/User.java):
101 |
102 | ```java
103 | User get("me") // /me
104 | getMe()
105 |
106 | ArrayList get("users") // /users
107 | getUsers([Integer offset, Integer limit])
108 |
109 | User get("users/{contact_id}") // /users/{contact_id}
110 | getUser({contact_id})
111 |
112 | ArrayList get("me/followings") // /me/followings
113 | getMeFollowing([Integer offset, Integer limit])
114 | User get("me/followings/{contact_id}") // /me/followings/{contact_id}
115 | getMeFollowing({contact_id}) // → /users/{contact_id}
116 |
117 | ArrayList get("me/followers") // /me/followers
118 | getMeFollowers([Integer offset, Integer limit])
119 | User get("me/followers/{contact_id}") // /me/followers/{contact_id}
120 | getMeFollower({contact_id}) // → /users/{contact_id}
121 |
122 | ArrayList get("groups/{group_id}/users") // /groups/{group_id}/users
123 | ArrayList get("groups/{group_id}/moderators") // /groups/{group_id}/moderators
124 | ArrayList get("groups/{group_id}/members") // /groups/{group_id}/members
125 | ArrayList get("groups/{group_id}/contributors") // /groups/{group_id}/contributors
126 | // 2271 = SoundCloud Sweetness ;)
127 | ```
128 |
129 | Track[.java](src/de/voidplus/soundcloud/Track.java):
130 |
131 | ```java
132 | Track get("tracks/{track_id}") // /tracks/{track_id}
133 | getTrack({track_id})
134 |
135 | ArrayList