telegra.ph
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

📝 telegra.ph

NPM Version Build Status

Tiny API helper for Telegra.ph.

Telegra.ph API docs

API

Installation

$ npm install telegra.ph --save

Example

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))
 

API documentation

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()

Readme

Keywords

Package Sidebar

Install

npm i telegra.ph

Weekly Downloads

21

Version

1.0.1

License

MIT

Unpacked Size

8.57 kB

Total Files

6

Last publish

Collaborators

  • dotcypress