rantscript
Advanced tools
+1
-1
| { | ||
| "name": "rantscript", | ||
| "version": "1.3.5", | ||
| "version": "1.3.6", | ||
| "description": "A JavaScript wrapper for the FULL devRant API", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
+49
-0
@@ -164,2 +164,25 @@ 'use strict'; | ||
| function editRant(text, rant_id, token, imagePath) { | ||
| const url = `${variables['API']}/rants/${rant_id}`; | ||
| const token_id = token["id"]; | ||
| const token_key = token["key"]; | ||
| const user_id = token["user_id"]; | ||
| const parameters = { | ||
| app: 3, | ||
| plat: 2, | ||
| rant: text, | ||
| token_id: token_id, | ||
| token_key: token_key, | ||
| user_id: user_id | ||
| }; | ||
| if(imagePath !== undefined && imagePath !== null) { | ||
| return http.POST_FILE(url, parameters, imagePath); | ||
| } else { | ||
| return http.POST(url, parameters); | ||
| } | ||
| } | ||
| function postComment(text, rant_id, token, imagePath) { | ||
@@ -439,2 +462,27 @@ const url = `${variables['API']}/devrant/rants/${rant_id}/comments`; | ||
| function listWeekly(token) { | ||
| const url = `${variables['API']}/devrant/weekly-list`; | ||
| let parameters = { | ||
| app: 3, | ||
| plat: 2, | ||
| }; | ||
| if (token != null && token != undefined) { | ||
| const token_id = token["id"]; | ||
| const token_key = token["key"]; | ||
| const user_id = token["user_id"]; | ||
| parameters = { | ||
| app: 3, | ||
| plat: 2, | ||
| token_id, token_key, user_id | ||
| }; | ||
| } | ||
| return http | ||
| .GET(url, parameters) | ||
| .then(data => data.weeks); | ||
| } | ||
| function surpriseRant(token) { | ||
@@ -474,2 +522,3 @@ const url = `${variables['API']}/devrant/rants/surprise`; | ||
| weekly, | ||
| listWeekly, | ||
| favorite, | ||
@@ -476,0 +525,0 @@ subscribe, |
+1
-1
@@ -16,5 +16,5 @@ var devrant = require('./src/index.js'); | ||
| devrant | ||
| .weeklyRants('recent', 1, 0) | ||
| .listWeekly() | ||
| .then((res)=>{ | ||
| console.log(res) | ||
| }) |
98147
0.95%597
7.18%