telegra.ph
1.0.0
ตัวช่วย API จิ๋วสำหรับ Telegra.ph
เอกสาร API ของ Telegra.ph
$ npm install telegra . ph -- save
const Telegraph = require ( 'telegra.ph' )
const client = new Telegraph ( )
client . createAccount ( ) . then ( ( account ) => {
client . token = account . access_token
return client . getPageList ( )
} ) . then ( ( pages ) => console . log ( pages ) )
const Telegraph = require ( 'telegra.ph' )
const client = new Telegraph ( process . env . TOKEN )
client . getPageList ( ) . then ( ( pages ) => console . log ( pages ) )
createAccount
.createAccount(shortName, name, url)
createPage
.createPage(title, content, authorName, authorUrl, returnContent)
editAccountInfo
.editAccountInfo(shortName, name, url)
editPage
.editPage(path, title, content, authorName, authorUrl, returnContent)
getPage
.getPage(path, returnContent)
getViews
.getViews(path, year, month, day, hour)
getPageList
.getPageList(path, offset, limit)
revokeAccessToken
.revokeAccessToken()