Advertisement
Guest User

Untitled

a guest
Apr 6th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. SOUNDCLOUDAPI = require('soundcloud-nodejs-api-wrapper');
  2. var JACCESS = require('jsonfile');
  3.  
  4. var SCcredentials = {
  5. client_id : 'a1bba234127704809008652469007c47', // Soundcloud app client id
  6. client_secret : '6eead97a7561d9b609a4df0b2bdef82e', // SoundCloud app secret
  7. username : 'ronkrt.mobile@gmail.com', // SoundCloud Username
  8. password : '' // Soundcloud Password
  9. };
  10.  
  11. var SCconfig = {
  12. gSections : [
  13. 'comments', // Get Profile Comments for user (prase for tipping)
  14. 'followers', // Get Follower information (User IDS)
  15. 'tracks' // Get Track Information (Track IDS)
  16. ],
  17. gInfo : [
  18. '14859705', // SoundPosition
  19. '4182848', // Rouviere
  20. '83205644' // thecypherfunks
  21. ]
  22.  
  23. };
  24.  
  25. var SOUNDCLOUDAPIC = new SOUNDCLOUDAPI(SCcredentials);
  26.  
  27. var SCCLIENT = SOUNDCLOUDAPIC.client();
  28.  
  29. SCCLIENT.exchange_token(function(err, result) {
  30.  
  31. var SCACCESSTOKEN = arguments[3].access_token;
  32.  
  33. console.log('Full API auth response was:');
  34. console.log(arguments);
  35.  
  36. var SCCNEW = SOUNDCLOUDAPIC.client({access_token : SCACCESSTOKEN});
  37.  
  38. for (i = 0; i < SCconfig.gSections.length; i++) {
  39. // Add code
  40. console.log(SCconfig.gSections[i]);
  41. }
  42. for (i = 0; i < SCconfig.gInfo.length; i++) {
  43. // Add code
  44. console.log(SCconfig.gInfo[i]);
  45. }
  46. SCconfig.gSections.forEach(function (item) {
  47. // Add code
  48. });
  49.  
  50. SCCNEW.get('/users/14859705/comments', {limit : 10000000}, function(err, result) {
  51. if (err) console.error(err); // check for an error
  52. var file = './14859705-profile-comments.json' // create a profile comments json file
  53. JACCESS.writeFileSync(file, result, {spaces: 2}) // Write the file to disk with json Spacing of 2
  54. });
  55.  
  56.  
  57. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement