Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fizvlad/vkdonate-rb

Small Ruby Gem to interact with vkdonate.ru API
https://github.com/fizvlad/vkdonate-rb

api app donate donations vk vkontakte

Last synced: about 6 hours ago
JSON representation

Small Ruby Gem to interact with vkdonate.ru API

Awesome Lists containing this project

README

        

# Vkdonate

This is small non-official gem which provides interface to interact with [vkdonate.ru API](https://vkdonate.ru/help#api).

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'vkdonate'
```

And then execute:

$ bundle

Or install it yourself as:

$ gem install vkdonate

## Usage

You can check documentation [here](https://www.rubydoc.info/gems/vkdonate/).

To interact with API you are to initialize client firstly:

```ruby
client = Vkdonate::Client.new("API KEY GOES HERE")
```

After that you can call method `Client#donates` which returnes array of `Donate` objects:

```ruby
donates = client.donates(count: 10, order: :asc)
Vkdonate::Donate === donates[0] # => true
puts donates
=begin
Output:
Donation #1219946 by @157230821 for 1RUR (at 2019-09-22T01:35:47+03:00)
Donation #1219943 by @157230821 for 1RUR (at 2019-09-22T01:34:59+03:00)
Donation #1219941 by @157230821 for 1RUR (at 2019-09-22T01:33:37+03:00)
=end
```