Skip to content

ifokeev/telegraph_api_ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

telegraph_api_ruby

A Ruby interface to Telegra.ph API.

Installation

Add following line to your Gemfile:

gem 'telegraph_api_ruby'

And then execute:

$ bundle

Or install it system-wide:

$ gem install telegraph_api_ruby

Usage

require 'telegraph_api_ruby'

telegraph_access_token = 'YOUR_ACCESS_TOKEN'

html = %(
  <b>Hello World</b>
)

content = TelegraphApi::DomToNode.call(html)

data = {
  access_token: telegraph_access_token,
  title: 'Test page',
  content: JSON.dump(content),
  return_content: true
}

result = TelegraphApi::Client.create_page(data)
result.url

See tests also.

Methods

See Available methods and Types.

You are able to call any method described on telegra.ph/api page right forward:

TelegraphApi::Client.getAccountInfo(access_token: 'TOKEN')

Because this gem uses method_missing for unlisted in Available methods list.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b feature/my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/my-new-feature)
  5. Create new Pull Request

About

A fully working telegra.ph/api ruby http client with DOM to node support and tests

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy