Mercurial > rsstweet
annotate app/lib/clients.rb @ 234:7a773720d81f legit-client
Totally legit client
author | nanaya <me@nanaya.net> |
---|---|
date | Fri, 14 Jul 2023 22:42:20 +0900 |
parents | 17461f7682a2 |
children |
rev | line source |
---|---|
219 | 1 class Clients |
2 def self.client_options(id) | |
3 { | |
4 :timeouts => { | |
5 :connect => 5, | |
6 :read => 5, | |
7 :write => 5, | |
8 }, | |
9 }.merge $cfg[:twitter][id] | |
10 end | |
11 | |
12 def self.instance | |
13 @@instance ||= self.new | |
14 end | |
15 | |
16 def initialize | |
17 @clients = {} | |
18 end | |
19 | |
20 def get(id) | |
21 @clients[id] ||= Twitter::REST::Client.new(self.class.client_options id) | |
22 end | |
23 end |