Skip to content

๐Ÿ“ Tiny API helper for Telegra.ph

License

Notifications You must be signed in to change notification settings

GodBleak/telegra.ph

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 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

Create an account

import Telegraph from "telegra.ph"

const client = new Telegraph()

const account = client.createAccount()
client.token = account.access_token

const pages = await client.getPageList()
console.log(pages)

Use existing account

import Telegraph from "telegra.ph"

const client = new Telegraph(process.env.TOKEN)

const pages = await client.getPageList()
console.log(pages)

Use arbitrary HTTP Client

import Telegraph from "telegra.ph"
import { Fetch } from "telegra.ph/clients"

const client = new Telegraph(process.env.TOKEN, { client: Fetch })

const pages = await client.getPageList()
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()

About

๐Ÿ“ Tiny API helper for Telegra.ph

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.5%
  • JavaScript 0.5%