Class: ShareChecker::Providers::Vkontakte

Inherits:
ShareChecker::Provider show all
Defined in:
lib/share_checker/providers/vkontakte.rb

Instance Attribute Summary

Attributes inherited from ShareChecker::Provider

#name

Instance Method Summary collapse

Methods inherited from ShareChecker::Provider

#check, get, #initialize, #method_missing, #parse_json, #parse_xml

Constructor Details

This class inherits a constructor from ShareChecker::Provider

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ShareChecker::Provider

Instance Method Details

#parse(response) ⇒ Object

Response sample

href="136685987,30523343,144263601,9428152,67880464,9770301,5702433,...">count”:1054,“users”:}



9
10
11
12
# File 'lib/share_checker/providers/vkontakte.rb', line 9

def parse(response)
  doc = parse_json(response)
  doc && doc["response"] ? doc["response"]["count"].to_i : 0
end

#urlObject



14
15
16
# File 'lib/share_checker/providers/vkontakte.rb', line 14

def url
  "https://api.vkontakte.ru/method/likes.getList?type=sitepage&owner_id=#{app_id}&page_url="
end