npm i hexo-twitter-auto-publish
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
twitterAutoPublish: consumerKey: Xegp8XDTMqVxcI2tId1juT70X consumerSecret: fq4eY5NmK2X9ZxSDSUaFqMBPWWMUCCYu35PMvzoqB0YzqLOTEs accessTokenKey: 929842798974656517-VuQxIuoLhtoeqW71LofX6M5fIw8Pf3c accessTokenSecret: R5RZtQj5tLWbSgFx39lq6cd2AcIQRjQk5kbepOobxCplA
There are three fields in the database:
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
twitterAutoPublishin 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
New statuses are sent to the twitter only after calling the command:
hexo deploy, or after calling a custom command: