termit 3.6.0 → 3.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/termit/data_fetcher_base.rb +14 -7
- data/lib/termit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4867c761affc0af62bbfa348421bf272ccddd8ff
|
4
|
+
data.tar.gz: b14c468f4a27289c9c1de5f6ddd12b8eec0c1b99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e7f0efea7f8110afb315e2cdf5dcf183fd6b745924bf91708cf6d260aff284ef899c0db45dd986d0b53c8dd61e085cf08befee5bcdcd47ec30c2fd225bc3287
|
7
|
+
data.tar.gz: 7683b205af801e5b9ce8f1d912a9435afebdc414cb8e156ccf11c73961222806366878fac892e9cc1bc09bee297b5bafd790548edf9ccc103cf9000cd3ce9e6d
|
@@ -25,13 +25,20 @@ module Termit
|
|
25
25
|
private
|
26
26
|
|
27
27
|
def self.auth_cookies
|
28
|
-
@@_auth_cookies ||=
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
28
|
+
@@_auth_cookies ||= begin
|
29
|
+
res = RestClient::Request.execute(
|
30
|
+
method: :get,
|
31
|
+
url: 'https://www.bing.com/translator',
|
32
|
+
headers: {
|
33
|
+
'User-Agent' => DUMMY_AGENT
|
34
|
+
}
|
35
|
+
)
|
36
|
+
shy_cookie = res.headers.fetch(:set_cookie)[0].split(';')[0]
|
37
|
+
key, value = shy_cookie.split('=')
|
38
|
+
res.cookies.tap do |cookies_param|
|
39
|
+
cookies_param[key] = value
|
40
|
+
end
|
41
|
+
end
|
35
42
|
end
|
36
43
|
end
|
37
44
|
end
|
data/lib/termit/version.rb
CHANGED