class Eurus::Weibo
Your code goes hereā¦
Public Class Methods
new(appkey="", subid="")
click to toggle source
# File lib/eurus-weibo-commercial.rb, line 10 def initialize(appkey="", subid="") @appkey = appkey @subid = subid end
Public Instance Methods
info()
click to toggle source
# File lib/eurus-weibo-commercial.rb, line 15 def info ap "appkey: #{@appkey}" ap "subid: #{@subid}" end
update_subscribe(opt="", stuff="")
click to toggle source
# File lib/eurus-weibo-commercial.rb, line 20 def update_subscribe(opt="", stuff="") # precheck if appkey and subid exist if @appkey == "" or @subid == "" raise "appkey or subid missing" else url = URI "https://c.api.weibo.com/subscribe/update_subscribe.json" res = Net::HTTP.post_form(url, source: @appkey, subid: @subid, "#{opt}": "#{stuff}") res_obj = JSON.parse res.body return res_obj end end