Skip to content

Commit

Permalink
node 16, dont use custom tumblr.js
Browse files Browse the repository at this point in the history
  • Loading branch information
cubeghost committed Jan 31, 2024
1 parent f17894a commit 15d8471
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 279 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"watch:test": "mocha --watch --recursive \"./src/**/tests/*.js\""
},
"engines": {
"node": "14.x"
"node": "16.x"
},
"dependencies": {
"@babel/runtime": "^7.7.4",
Expand All @@ -42,7 +42,7 @@
"redis": "^2.8.0",
"sass": "^1.38.0",
"stringify": "^5.1.0",
"tumblr.js": "https://github.com/cubeghost/tumblr.js",
"tumblr.js": "4.0.1",
"winston": "^3.2.1"
},
"devDependencies": {
Expand Down
4 changes: 0 additions & 4 deletions src/client/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ class App extends Component {
</nav>
</header>

<div className="window markdown">
<ReactMarkdown source={noticeMarkdown} escapeHtml={true} />
</div>

<div className="content">
{this.renderErrors()}

Expand Down
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ const grant = new Grant({
state: true,
},
tumblr: {
authorize_url: 'https://www.tumblr.com/oauth2/authorize',
access_url: 'https://api.tumblr.com/v2/oauth2/token',
oauth: 2,
request_url: 'https://www.tumblr.com/oauth/request_token',
authorize_url: 'https://www.tumblr.com/oauth/authorize',
access_url: 'https://www.tumblr.com/oauth/access_token',
oauth: 1,
scope: ['write'],
key: process.env.TUMBLR_API_KEY,
secret: process.env.TUMBLR_API_SECRET,
Expand Down
17 changes: 7 additions & 10 deletions src/server/tumblr.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,12 @@ class TumblrClient {
* @param {Options} [options={}] api options
*/
constructor({ token, secret, blog, options = {} }) {
this.client = this.wrapClient(new tumblr.Client({
credentials: {
consumer_key: process.env.TUMBLR_API_KEY,
consumer_secret: process.env.TUMBLR_API_SECRET,
// this is not officially supported
bearer: token,
},
returnPromises: true
}));
this.client = new tumblr.Client({
consumer_key: process.env.TUMBLR_API_KEY,
consumer_secret: process.env.TUMBLR_API_SECRET,
token: token,
token_secret: secret,
});

this.blog = blog;
this.options = _.assign({}, DEFAULT_OPTIONS, options);
Expand Down Expand Up @@ -310,7 +307,7 @@ class TumblrClient {
replace,
});

return this.client.editPost(this.blog, {
return this.client.editLegacyPost(this.blog, {
id: post.id,
tags: replacedTags.join(',')
});
Expand Down

0 comments on commit 15d8471

Please sign in to comment.