No commit activity in last 3 years
No release in over 3 years
Fully working http client for https://telegra.ph/api supporting DomToNode processing
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 0.12
~> 2.0
~> 1.0
 Project Readme

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