birdsong 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/birdsong/monkeypatch.rb +1 -1
- data/lib/birdsong/scrapers/scraper.rb +2 -0
- data/lib/birdsong/user.rb +3 -3
- data/lib/birdsong/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebf200672c8ac8965aa8e61af1346f32724a1b5244cebda6dff9e74efbdaea50
|
4
|
+
data.tar.gz: b73a8da99d9fdf61ccb62e2ddd474e2267ca4e5057a29f642d36d8a9e4f8837c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 686cf3df6f5dfac9fbe71de0c599b5581057ef8f5e63c93dfda4c6ab58e5b775a475dda944b41f2d0fee2a97acb1e478b301969c9af3ee4c9540636bee86f851
|
7
|
+
data.tar.gz: 556899f220a43bd05e3fed8b214c77312d48f33cc4d029c8d21c9a919cf2d21f046821d9b883014fa1f966353b926bb2f9510a0dc55f850c9f293fb42c0e0a45
|
data/lib/birdsong/monkeypatch.rb
CHANGED
@@ -41,7 +41,7 @@ module SeleniumMonkeypatch
|
|
41
41
|
data[:sessionId] = @session_id if @session_id
|
42
42
|
message = @ws.send_cmd(**data)
|
43
43
|
if message.nil? == false && message["error"] && (method != "Fetch.continueRequest")
|
44
|
-
raise Birdsong::
|
44
|
+
raise Birdsong::WebDriverError, error_message(message["error"])
|
45
45
|
end
|
46
46
|
|
47
47
|
message
|
@@ -94,6 +94,7 @@ module Birdsong
|
|
94
94
|
end
|
95
95
|
rescue Selenium::WebDriver::Error::WebDriverError
|
96
96
|
# Eat them
|
97
|
+
rescue Birdsong::WebDriverError
|
97
98
|
end
|
98
99
|
|
99
100
|
# Now that the intercept is set up, we visit the page we want
|
@@ -111,6 +112,7 @@ module Birdsong
|
|
111
112
|
|
112
113
|
raise Birdsong::NoTweetFoundError if response_body.nil?
|
113
114
|
Oj.load(response_body)
|
115
|
+
rescue Birdsong::WebDriverError
|
114
116
|
end
|
115
117
|
|
116
118
|
private
|
data/lib/birdsong/user.rb
CHANGED
@@ -30,7 +30,7 @@ module Birdsong
|
|
30
30
|
def parse(user_object)
|
31
31
|
@id = user_object[:id]
|
32
32
|
@name = user_object[:name]
|
33
|
-
@username = user_object[:
|
33
|
+
@username = user_object[:username]
|
34
34
|
@created_at = DateTime.parse(user_object[:sign_up_date])
|
35
35
|
@location = user_object[:location]
|
36
36
|
|
@@ -42,8 +42,8 @@ module Birdsong
|
|
42
42
|
@url = "https://www.twitter.com/#{@username}" if @url.nil?
|
43
43
|
|
44
44
|
@followers_count = user_object[:followers_count]
|
45
|
-
@following_count = user_object[:
|
46
|
-
@tweet_count = user_object[:
|
45
|
+
@following_count = user_object[:following_count]
|
46
|
+
@tweet_count = user_object[:tweet_count]
|
47
47
|
@listed_count = user_object[:listed_count]
|
48
48
|
@verified = user_object[:verified] # this will always be `false` but we're keeping it here for compatibility
|
49
49
|
@profile_image_file_name = Birdsong.retrieve_media(@profile_image_url)
|
data/lib/birdsong/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: birdsong
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Guess
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|