Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guillaumemorin/algolia-soundcloud-connector
node connector to send soundcloud data to algolia's servers
https://github.com/guillaumemorin/algolia-soundcloud-connector
Last synced: about 1 month ago
JSON representation
node connector to send soundcloud data to algolia's servers
- Host: GitHub
- URL: https://github.com/guillaumemorin/algolia-soundcloud-connector
- Owner: guillaumemorin
- Created: 2014-12-17T16:16:50.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-29T10:07:36.000Z (about 9 years ago)
- Last Synced: 2024-11-18T23:40:34.219Z (about 2 months ago)
- Language: JavaScript
- Size: 837 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
algolia-soundcloud-connector
============================[![NPM Downloads][http://img.shields.io/npm/v/reflux.svg]][https://www.npmjs.com/package/algolia-soundcloud-connector]
node connector to send soundcloud data on algolia's servers
https://www.npmjs.com/package/algolia-soundcloud-connector**Table of Contents**
- [Installation](#installation)
- [Configuration](#configuration)## Installation
The recommended way is through NPM
$ npm install algolia-soundcloud-connector
Otherwise, you can check it in your repository and then expose it:
$ git clone git://github.com/guillaumemorin/algolia-soundcloud-connector.git node_modules/algolia-soundcloud-connector/
And install dependency modules written on `package.json`.
Then you can `require` it:
require('algolia-soundcloud-connector')
## Configuration
You first need to set your Algolia and Soundcloud credentials in conf.js
You can find them on [your Algolia account](http://www.algolia.com/users/edit) and on your [Soundcloud developer account](http://soundcloud.com/you/apps).
soundcloud: {
client_id: 'CLIENT_ID',
secret: 'SECRET',
callback_url: 'CALLBACK_URL'
},
algolia: {
client_id: 'CLIENT_ID',
secret: 'SECRET',
init_index: 'soundcloud',
attributes_to_index: ['username', 'city'],
custom_ranking: ['desc(followers)']
}attributes_to_index and custom_ranking options are described on [Algolia's doc Ranking & Relevance section](https://www.algolia.com/doc/node#RankingRelevance)
After configuration completed, you need to get an access token from soundcloud connect flow.
You can get one with algolia-soundcloud-connector auth method if you already have the "code" from connect flow callback. Please have a look to soundcloud [developer guide](https://developers.soundcloud.com/docs/api/sdks#authentication) and [README.md](https://github.com/khilnani/soundclouder.js/tree/master/test) of soundclouder test setup script.Once you get your Access Token, you can set it with the setAccessToken method below and pass as a callback the sendData method (with the soundcloud api method you want to get data from) to send soundcloud data to Algolia' server.
var connector = require('algolia-soundcloud-connector');
connector.setAccessToken('ACCESS_TOKEN', connector.sendData, '/me/followers');
All soundcloud api methods are listed on [soundcloud api console](https://developers.soundcloud.com/console/)