Skip to content
Hexo plugin to auto publish posts and pages on Twitter.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
.npmignore
README.md
package-lock.json
package.json
tsconfig.json

README.md

hexo-twitter-auto-publish

Install

npm i hexo-twitter-auto-publish

Configuration

Twitter account config via shell variables

export TWITTER_CONSUMER_KEY=Xegp8XDTMqVxcI2tId1juT70X
export TWITTER_CONSUMER_SECRET=oaGaU06IGqaTfObZnYdrYmDvxiHcHck8TQ9Xk61Ze1ghjHQYkP
export TWITTER_ACCESS_TOKEN_KEY=929842798974656517-VuQxIuoLhtoeqW71LofX6M5fIw8Pf3c
export TWITTER_ACCESS_TOKEN_SECRET=R5RZtQj5tLWbSgFx39lq6cd2AcIQRjQk5kbepOobxCplA

or using _config.yml

twitterAutoPublish:
  consumerKey: Xegp8XDTMqVxcI2tId1juT70X
  consumerSecret: fq4eY5NmK2X9ZxSDSUaFqMBPWWMUCCYu35PMvzoqB0YzqLOTEs
  accessTokenKey: 929842798974656517-VuQxIuoLhtoeqW71LofX6M5fIw8Pf3c
  accessTokenSecret: R5RZtQj5tLWbSgFx39lq6cd2AcIQRjQk5kbepOobxCplA

About twitter-db.json

There are three fields in the database: published, to-publish, to-destroy.

  • published - contains posts that are already on twitter and each post has a tweetId.

  • to-publish - contains all new posts that have not yet appeared on Twitter.

  • to-destroy - contains posts that for some reason have been moved to a working version, or we changed the twitterAutoPublish in the page from true to false.

If you do not want a post to be sent to twitter, all you have to do is move it from to-publish to published.

New statuses are sent to the twitter only after calling the command: hexo deploy, or after calling a custom command: hexo twitter-publish.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.