starthq / search

Search provider API docs & integration implementations.
https://starthq.com
32 stars 26 forks source link

soundcloud.js #90

Closed ramkumargithub closed 9 years ago

ramkumargithub commented 9 years ago

SoundCloud support

olegp commented 9 years ago

Would've been nice to let me comment on this before merging :)

I think having to make users enter the API key manually isn't a very user friendly solution. It might be worth scraping the results from server generated HTML for the mobile web version of the site instead (m.soundcloud.com).

olegp commented 9 years ago

Also, search does work even if you're not signed in without the API key using this endpoint:

https://api.soundcloud.com/search/suggest?q=t&highlight_mode=offsets&limit=5&offset=0&linked_partitioning=1

One last point is that you should have multiple queries going out for different types of results. At the moment you're just lumping all the different types together, when in fact you should have separate requests for "contacts" (users), "audio" (tracks) etc.

ramkumargithub commented 9 years ago

My apologies if I have not followed the right process (I am new to using github).

1) PageSource for this link "https://soundcloud.com/search/people?q=rahman" does not provide actual content of the files/sourceLinks. So I have used "https://api.soundcloud.com/playlists?client_id=YOUR_CLIENT_ID&q=rahman"

2) The api.soundcloud.com is a public Rest API provided by the SoundCloud for developers. I have used this in another mobile application project.

3) I am not quite sure if the tags for parsing the JSON request, that I have used are correct. But if I am able to run it on the server I could fix the minor corrections (may be needed)

4) I created only one set of results i.e. artists as of now could be extended to albums, tracks and users too.

olegp commented 9 years ago

When it comes to 1) some research shows that there is a constant client ID you can use instead of the user specific one: "b45b1aa10f1ac2941910a7f0d10f8e28"

With regards to 3), there is no need to run this code on the server. You can test it from a browser with the StartHQ extension installed, like Chrome or Firefox. The exact steps to do this are described in the developer docs.

ramkumargithub commented 9 years ago

Code change for SoundCloud.js is now committed. Thanks