-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthentication.js
More file actions
45 lines (39 loc) · 1.25 KB
/
authentication.js
File metadata and controls
45 lines (39 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const tumblrLib = require("tumblr.js");
const electron = require("electron");
const request = require("request");
const {ipcRenderer} = electron;
var tumblr;
const credentials = require("./credentials.json");
const site = "amethystproductions.tumblr.com"
module.exports = {
Authenticate: Authenticate,
Upload: (description) => Upload(description)
};
function Authenticate(){
//tumblr = new Tumblr();
//window.location.href = "https://www.deviantart.com/oauth2/authorize";
// request.post(
// "https://www.deviantart.com/oauth2/authorize",
// {
// response_type: "token",
// client_id: credentials.deviantart.client_id,
// redirect_uri: "https://amethystproductions.github.io",
// state: "test"
// },
// (data) => console.log(data)
// );
}
function Upload(description)
{
tumblr.client.createTextPost(site, {title: "Title", body: "Body"});
}
class Tumblr {
constructor() {
this.client = tumblrLib.createClient({
consumer_key: credentials.tumblr.consumer_key,
consumer_secret: credentials.tumblr.consumer_secret,
token: credentials.tumblr.token,
token_secret: credentials.tumblr.token_secret
});
}
}