Skip to content

A set of wrappers that call the APIs of Hexo and Qualtet.

License

Notifications You must be signed in to change notification settings

yoshinorin/qualtet-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qualtet-CLI

The cli for Qualtet. A set of wrappers that call the APIs of Hexo and Qualtet.

Setup

Clone this repository at the same hierarchy as the Hexo folder.

Commands

  • assertImages: node ./qualtet-cli/cmd/assertImages.js <daysAgo>
  • delete: node ./qualtet-cli/cmd/delete.js <apiUrl> <serviceName> <authorName> <contentId>
  • deleteTag: node ./qualtet-cli/cmd/deleteTag.js <apiUrl> <serviceName> <authorName> <tagId>
  • invalidateCaches: node ./qualtet-cli/cmd/invalidateCaches.js <apiUrl> <serviceName> <authorName>
  • postSeriesFromFile: node ./qualtet-cli/cmd/postSeriesFromFile.js <apiUrl> <serviceName> <authorName> <JSON filePath>
  • publish: node ./qualtet-cli/cmd/publish.js <apiUrl> <serviceName> <authorName> <daysAgo>
  • setCredential: node ./qualtet-cli/cmd/setCredential.js

assertImages

Validate an image has EXIF(includes GPS) info or not.

$ node ./qualtet-cli/cmd/assertImages.js <daysAgo (default: 10000)>

INFO  check updated in 10000 days ago articles assets.
INFO  Validating config
INFO  Start processing
ERROR C:\Users\<userName>\source\_posts\example\gps.jpg: has GPS info
{
  file: 'C:\Users\<userName>\source\_posts\example\gps.jpg',
  gps: [
    undefined,
    undefined,
    undefined,
    { id: 2, value: [Array], description: 39.9987 },
    { id: 1, value: [Array], description: 'North latitude' },
    { id: 4, value: [Array], description: 138.6517 },
    { id: 3, value: [Array], description: 'East longitude' },
    { id: 18, value: [Array], description: 'WGS-84' }
  ]
}
WARN  C:\Users\<userName>\source\_posts\example2\hoge.jpg: has EXIF

delete

Delete content (post or page) by its id.

$ node ./qualtet-cli/cmd/delete.js <apiUrl> <serviceName> <authorName> <contentId>

deleteTag

Delete tag by its id.

$ node ./qualtet-cli/cmd/deleteTag.js <apiUrl> <serviceName> <authorName> <tagId>

invalidateCaches

Invalidate Cache.

$ node ./qualtet-cli/cmd/invalidateCaches.js <apiUrl> <serviceName> <authorName>
INFO  caches: invalidated

postSeriesFromFile

Create or Update series from JSON file.

$ node ./qualtet-cli/cmd/postSeriesFromFile.js <apiUrl> <serviceName> <authorName> <JSON filePath>`

// example JSON
{
  "name": "example",
  "title": "example title",
  "description": "example description"
}

publish

Publish articles (posts or pages) that have been updated up to n days ago.

$ node ./qualtet-cli/cmd/publish.js <apiUrl> <serviceName> <authorName> <daysAgo>
INFO  caches: invalidated
INFO  Validating config
INFO  Start processing
INFO  created - 1: 01gz702w32kxdhe8417fxcybcm - /example
INFO  created - 2: 01gs876d3rmembfhnt9qskwz9a - /articles/example2/
INFO  created - 3: 01gs876n2adwaznhv6m0yz8drw - /articles/example3/
...

setCredential

Set credential to your keytar.

$ node ./qualtet-cli/cmd/setCredential.js
Please input serviceName, authorName, and author's password: <serviceName> <authorName> <password>

LICENSE

MIT

About

A set of wrappers that call the APIs of Hexo and Qualtet.

Resources

License

Stars

Watchers

Forks