Skip to content

telegraf/telegra.ph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ 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(shortName, name, url)

.createPage(title, content, authorName, authorUrl, returnContent)

.editAccountInfo(shortName, name, url)

.editPage(path, title, content, authorName, authorUrl, returnContent)

.getPage(path, returnContent)

.getViews(path, year, month, day, hour)

.getPageList(path, offset, limit)

.revokeAccessToken()