{"_id":"4shared","_rev":"7-d9023d5004918c281a5a47b4d4b5447d","name":"4shared","description":"This is small lib, for using 4shared resorces in nodejs","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"4shared","version":"1.0.0","description":"This is small lib, for using 4shared resorces in nodejs","main":"index.js","directories":{"example":"examples","test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://bboysathish@bitbucket.org/bboysathish/4shared.git"},"keywords":["4shared","shared"],"author":{"name":"sathish kumar","email":"sathishwelcomez@ymail.com"},"license":"MIT","dependencies":{"oauth":"^0.9.12","request":"^2.51.0"},"devDependencies":{"express":"^4.11.0","grunt":"^0.4.5","grunt-contrib-jshint":"^0.10.0","grunt-mocha-test":"^0.12.7","mocha":"^2.1.0"},"gitHead":"3631353ca933482d0c47b2f2e30cc997d92c9ac6","_id":"4shared@1.0.0","_shasum":"0e1d2e55d9c44a4123fef6fde0bedb4351941cda","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"bboysathish","email":"sathishwelcomez@ymail.com"},"maintainers":[{"name":"bboysathish","email":"sathishwelcomez@ymail.com"}],"dist":{"shasum":"0e1d2e55d9c44a4123fef6fde0bedb4351941cda","tarball":"https://registry.npmjs.org/4shared/-/4shared-1.0.0.tgz","integrity":"sha512-vqJ6fMruVwAJgerrdpvOY22Ia66G1YJUs0IMLwqAWtLAdP+v0ck/D13DxdWyBEHD9wRR2ervRYniIGLaMegvZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB17A0Hn7+rFDlULt+jxjPg5hG3TyDU9RQrm9tqBKPZIAiBvni38DeBcWWBbZxHCBCUshjSNgc2waSQyL6PIXULD3g=="}]}},"1.0.1":{"name":"4shared","version":"1.0.1","description":"This is small lib, for using 4shared resorces in nodejs","main":"index.js","directories":{"example":"examples","test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://bboysathish@bitbucket.org/bboysathish/4shared.git"},"keywords":["4shared","shared"],"author":{"name":"sathish kumar","email":"sathishwelcomez@ymail.com"},"license":"MIT","dependencies":{"oauth":"^0.9.12","request":"^2.51.0"},"devDependencies":{"express":"^4.11.0","grunt":"^0.4.5","grunt-contrib-jshint":"^0.10.0","grunt-mocha-test":"^0.12.7","mocha":"^2.1.0"},"gitHead":"f639e1b90e72d45baa9d0a1c5a7efe29750a995c","_id":"4shared@1.0.1","_shasum":"4b11e364c35ca68576446d67000bf5dc444ef17e","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"bboysathish","email":"sathishwelcomez@ymail.com"},"maintainers":[{"name":"bboysathish","email":"sathishwelcomez@ymail.com"}],"dist":{"shasum":"4b11e364c35ca68576446d67000bf5dc444ef17e","tarball":"https://registry.npmjs.org/4shared/-/4shared-1.0.1.tgz","integrity":"sha512-zxJpPiL+MUd3OHQBgzx3XsEThWCyp2FHcvIyB0w4WLYKMr2/28ATaJkCduEyn33n1CB0lE5MlV7Id2L1/SqtRA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIENQFGrWg2NCuiLrkIe5kkbe0Ife6RyyHFtNtkwWItW5AiEA6Q+8QyQYsIlT++JqA4mSXEvZWQiGIS1UVLVsyC7wGgk="}]}}},"readme":"# 4Shared-API / fourShared API (www.4shared.com)\r\n\r\nThis is API Wrapper Library for Consuming 4Shared API usin NodeJS.Please visit the below link for more info [4Shared_Docs]\r\n\r\n  - All API's implemented.\r\n  - All API's are only for Authenticated, Except FileSearch.\r\n  \r\n##### Search, Filter & Sorting:\r\nCategories:\r\n    - Music -1 \r\n    - Video - 2\r\n    - Photo - 3\r\n    - Archieves - 4\r\n    - Books/Office - 5\r\n    - Programs - 6\r\n    - Web - 7\r\n    - Mobile - 8\r\n    - Android - 10\r\n\r\nSample use of Libarary is also, in the examples [folder].\r\nJust Replace your keys there, to start testing the application.\r\n\r\n### Version\r\n1.0.0\r\n\r\n### Tech\r\n\r\n4Shared Uses OAuth Library for Authentication & Authorization\r\n\r\n* [OAuth] - Authentication & Authorization\r\n* [Grunt] - for JS Hint & Testing \r\n* [Express] - for Sample use of Lib Functionality\r\n\r\n### Installation\r\n\r\nYou need npm installed globally:\r\n\r\n```sh\r\n$ npm install -g npm\r\n```\r\nAfter that install the module as below,\r\n```sh\r\n$ npm install 4shared\r\n```\r\n\r\n### Example\r\n\r\nFirst Tab:\r\n```sh\r\nvar fourSharedApi = require('../index');\r\nvar express = require('express');\r\nvar app = express();\r\nvar fs = require('fs');\r\n\r\n\r\nvar fileId = \"\";\r\nvar rootFolder = \"\";\r\nvar folderID = \"\";\r\nvar userID= \"\";\r\n\r\nvar client = new fourSharedApi({\r\n\t\"oauth_consumer_key\": \"xxxx\",\r\n\t\"oauth_secret_key\": \"xxxx\",\r\n\t\"callback\": \"http://localhost:8080/callback\",\r\n\t\"access_token\": \"optional\",\r\n\t\"access_secret\": \"optional\",\r\n\t\"authorized\": true\r\n});\r\n\r\nclient.on('error', function(err) {\r\n\tconsole.log(err);\r\n});\r\n\r\nclient.on('connected', function(is) {\r\n\tconsole.log(is);\r\n});\r\n\r\napp.get('/start', function(req, res) {\r\n\tclient.authenticate(function(err, data) {\r\n\t\tif (err) throw err;\r\n\t\tres.redirect('https://api.4shared.com/v0/oauth/authorize?oauth_token=' + data.token);\r\n\t});\r\n});\r\n\r\napp.get('/callback', function(req, res) {\r\n\tclient.callback(function(err, data) {\r\n\t\tif (err) throw err;\r\n\t\tres.json(data);\r\n\t});\r\n});\r\n\r\napp.get('/filesearch', function(req, res) {\r\n\tclient.fileSearch(function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body)\r\n\t});\r\n});\r\n\r\napp.get('/filesearchparams', function(req, res) {\r\n\tvar queryOpts = {\r\n\t\tcategory: \"2\",\r\n\t\tquery: \"Sky\"\r\n\t};\r\n\tclient.fileSearch(queryOpts, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body)\r\n\t});\r\n});\r\n\r\napp.get('/userinfo', function(req, res) {\r\n\tclient.userInfo(function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\trootFolder = JSON.parse(body).rootFolderId;\r\n\t\tuserID = JSON.parse(body).id;\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\napp.get('/uploadFile', function(req, res) {\r\n\tvar formData = {\r\n\t\tfolderId: \"2iVI6yt1\",\r\n\t\tdescription: \"testing\",\r\n\t\ttags: \"test\",\r\n\t\tfile: fs.createReadStream(__dirname + '/origin.js')\r\n\t};\r\n\r\n\tclient.uploadFile(formData, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tfileId = JSON.parse(body).id;\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\napp.get('/updateFile', function(req, res) {\r\n\tvar formData2 = {\r\n\t\tfile: fs.createReadStream(__dirname + '/replacement.js')\r\n\t}\r\n\tconsole.log(fileId);\r\n\tclient.updateFile(fileId, formData2, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\napp.get('/updateFileInfo', function(req, res) {\r\n\tvar dad = {\r\n\t\tname: \"nameisChanged\"\r\n\t}\r\n\tconsole.log(fileId);\r\n\tclient.updateFileInfo(fileId, dad, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\napp.get('/fileinfo', function(req, res) {\r\n\tclient.getfileInfo(fileId, false, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body);\r\n\t});\r\n})\r\n\r\napp.get('/updateUserInfo', function(req, res) {\r\n\tvar data = {\r\n\t\tfirstName: \"UpdateUser\",\r\n\t\tdescription: \"Hi How Are Yu!!\"\r\n\t};\r\n\tclient.updateUserInfo(data, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\napp.get('/userfiles', function(req, res) {\r\n\tclient.userFiles(function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\napp.get('/getOwnerInfo', function(req, res) {\r\n\tclient.getOwnerInfo(userID, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\napp.get('/foldersInfo', function(req, res) {\r\n\tconsole.log(rootFolder);\r\n\tclient.foldersInfo(rootFolder, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\napp.get('/childrenFolderInfo', function(req, res) {\r\n\tclient.childrenFolderInfo(rootFolder, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\napp.get('/listFilesInFolder', function(req, res) {\r\n\tclient.listFilesInFolder(rootFolder, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\napp.get('/createFolder', function(req, res) {\r\n\tvar foldata = {\r\n\t\tparentId: \"2iVI6yt1\",\r\n\t\tname: \"testFolder\",\r\n\t\tdescription: \"test Folder..\"\r\n\t}\r\n\tclient.createFolder(foldata, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tfolderID = JSON.parse(body).id;\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\napp.get('/updateFolderInfo', function(req, res) {\r\n\tvar foldata = {\r\n\t\tname: \"testFolderUpdated\",\r\n\t\tdescription: \"test Folder..\"\r\n\t}\r\n\tclient.updateFolderInfo(folderID, foldata, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\n\r\napp.get('/deleteFolder', function(req, res) {\r\n\tclient.deleteFolder(folderID, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\napp.get('/deleteFile', function(req, res) {\r\n\tclient.deleteFile(fileId, function(err, resp, body) {\r\n\t\tconsole.log(err);\r\n\t\tres.send(body);\r\n\t});\r\n});\r\n\r\nvar server = app.listen(8080,function(){\r\n\tconsole.log(\"Server Started\");\r\n});\r\n```\r\n\r\n### Todo's\r\n\r\n - Write Tests\r\n - Add Code Comments\r\n\r\nLicense\r\n----\r\n\r\nMIT\r\n\r\n[4Shared_Docs]:http://www.4shared.com/developer/docs/\r\n[folder]:https://bitbucket.org/bboysathish/4shared/src/7a1c9427dc4d6bf326a6254c5bf9c7f60aacdc1d/examples/all.js?at=master\r\n[Grunt]:http://gruntjs.com/\r\n[express]:http://expressjs.com\r\n[OAuth]:https://www.npmjs.com/package/oauth","maintainers":[{"name":"bboysathish","email":"sathishwelcomez@ymail.com"}],"time":{"modified":"2022-06-12T14:07:53.017Z","created":"2015-01-22T11:39:04.758Z","1.0.0":"2015-01-22T11:39:04.758Z","1.0.1":"2015-01-22T11:44:24.547Z"},"keywords":["4shared","shared"],"repository":{"type":"git","url":"https://bboysathish@bitbucket.org/bboysathish/4shared.git"},"author":{"name":"sathish kumar","email":"sathishwelcomez@ymail.com"},"license":"MIT","readmeFilename":"README.md","users":{"bboysathish":true}}