forki 0.2.18 → 0.2.19

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: 828be4f10ea4ff3496585984d78878a1492bfb13691e6772e754e31a8e0654e9
4
- data.tar.gz: 35b0d1cba36a195e95e4d649a3808455cd2f51917a619c536b55b3413395b719
3
+ metadata.gz: d9de2b16665e9356cb059158f456a1bb07a46bd8f68e1ac44c668161ee887174
4
+ data.tar.gz: c2ca1d21fe125467d4616285b928587063f571e6238c938a36c8ff3c6208c294
5
5
  SHA512:
6
- metadata.gz: e34ae0dd4d57660c075bf1c6d8a690ca8a65adb771739556ba2c8031918ee32e2829ce7aa419ff5533640f602a92b2f7f1dc00d852768ff30cfdab42a48f9732
7
- data.tar.gz: 8de5a58ece6ae090ebd1a638cbbe4cff3168a0f439476dfb7490d53b982e1cf4e12bf97d5a1f453134867a64f1442c95c4569ad2bde4be49f88fdde68da0b6b1
6
+ metadata.gz: 4f4a6bd3f538e04a6b589893212818e1b1667c8c609d56bdd23a28a030022b68789561aca464af68f50bd9da996052cc51bedafefbc3a7a4cb162b17c3387be6
7
+ data.tar.gz: 5abcbf0d6883bb29469f9d9d2a29c39c6c19871e049eb6aaeb42a5ffa7d214e65cc2c9ea280cf8efe92c74e53833764716078ff42405dc881987fcffcba656f8
@@ -189,6 +189,18 @@ module Forki
189
189
  url = parsed_url.to_s
190
190
  end
191
191
 
192
+ # If the url is a shared embed, the main url should be extracted
193
+ if url.start_with?("https://www.facebook.com/plugins/post.php")
194
+ query = URI(url).query
195
+ raise Forki::InvalidUrlError.new("Invalid Facebook post embed url") if query.nil?
196
+ decoded_query = URI.decode_www_form(query)
197
+ elemental_url = decoded_query.find { |u| u[0] == "href" if u.is_a?(Array) }
198
+ raise Forki::InvalidUrlError.new("Invalid Facebook post embed url") if elemental_url.nil?
199
+ href = elemental_url[1] if elemental_url.is_a?(Array)
200
+ raise Forki::InvalidUrlError.new("Invalid Facebook post embed url") if href.nil?
201
+ url = href
202
+ end
203
+
192
204
  visit "https://www.facebook.com"
193
205
  login
194
206
 
data/lib/forki/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Forki
4
- VERSION = "0.2.18"
4
+ VERSION = "0.2.19"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.18
4
+ version: 0.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-04 00:00:00.000000000 Z
11
+ date: 2024-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara