onebox 1.9.28.3 → 1.9.28.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0d93d95906ee868d8e29d6e6746b8812cc8ac97acc714c2be18c7f5e7e6af0c
4
- data.tar.gz: 49870d35dbe9d9e0ef9d90cd639242408021e0a6a229de56baef7b3abbbc24c6
3
+ metadata.gz: 2f0921bd8d91072c930eccee436ef05e362fbe20b0d4ec8d39cecb74580723c9
4
+ data.tar.gz: 58ff915a7d3a7dcbf2a7a0bcaf66366ad6210ba17b84695695be9a067c54be92
5
5
  SHA512:
6
- metadata.gz: 9a2f5037e4d8311ba9c49b8b285dc94bed93619392786d9d6e272d7d0aee16f00f0ecc173edd6974dff8f22b771130e5913027c2d285949869998e1d3fa5d4cb
7
- data.tar.gz: 0e6a74f1bd15bc4ff301e5c7c97525143df68c3910cc95657bfeef703bb3d98bd053e7af46f6b2c0cf68505448b7868ba80332d693483995dfebaba52d5dc2c8
6
+ metadata.gz: 5eb93e33a7c8c4919d47d03975545d08be18038d83e6b763ab5e7fabb1fe9b9a1ddc35a688656234e37231dff9b131900e87d00d0363e5e6f3454d9dad2988ed
7
+ data.tar.gz: 7097f982b53eb11d057f601af63e928941f086534a03ec7d92eb7794bf2981a9138d6891add442f52345b91a70f611397a86e4647a7302a12991d8560c5c96ba
@@ -10,10 +10,14 @@ module Onebox
10
10
  matches_regexp(/^https?:\/\/(mobile\.|www\.)?twitter\.com\/.+?\/status(es)?\/\d+(\/(video|photo)\/\d?+)?+(\/?\?.*)?\/?$/)
11
11
  always_https
12
12
 
13
+ def http_params
14
+ { 'User-Agent' => 'DiscourseBot/1.0' }
15
+ end
16
+
13
17
  private
14
18
 
15
19
  def get_twitter_data
16
- response = Onebox::Helpers.fetch_response(url) rescue nil
20
+ response = Onebox::Helpers.fetch_response(url, nil, nil, http_params) rescue nil
17
21
  html = Nokogiri::HTML(response)
18
22
  twitter_data = {}
19
23
  html.css('meta').each do |m|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onebox
4
- VERSION = "1.9.28.3"
4
+ VERSION = "1.9.28.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onebox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.28.3
4
+ version: 1.9.28.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joanna Zeta
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-05-27 00:00:00.000000000 Z
13
+ date: 2020-06-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable