fbcrawl-colly 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/fbcolly/fbcolly.go +10 -1
- data/fbcrawl.proto +1 -0
- data/lib/fbcrawl_colly/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a3dd903339ecec17525ca24b86324664458ef884f70065f611dc5bc15caf0a6
|
4
|
+
data.tar.gz: 7d7fbfd082240d21fc66f100eb530f81579b62c715181a10b95b1c70f5ad1d98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5a3b0dcd89eb3b94adcc797785984e04a122a51f9135a37aed10aee0607dd357fe99ebd69e8f2eb0ebeaf05ff4c1f0bf21c4713d173065f4782dbeb192c365e
|
7
|
+
data.tar.gz: d01e881175776aa5039859b1b11d723c3a577a4a68f54b6bb550d0c8c90c87d89004a94b05f21846763d56687d65bc9132e602f61a94fcebb25e934dca93ab40
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fbcrawl-colly (0.
|
4
|
+
fbcrawl-colly (0.2.1)
|
5
5
|
ffi
|
6
6
|
google-protobuf
|
7
7
|
|
@@ -9,7 +9,7 @@ GEM
|
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
11
|
ffi (1.13.1)
|
12
|
-
google-protobuf (3.12.4
|
12
|
+
google-protobuf (3.12.4)
|
13
13
|
minitest (5.14.1)
|
14
14
|
rake (12.3.3)
|
15
15
|
rake-compiler (1.1.1)
|
data/fbcolly/fbcolly.go
CHANGED
@@ -300,7 +300,7 @@ func (f *Fbcolly) FetchPost(groupId int64, postId int64) (error, *fbcrawl.Facebo
|
|
300
300
|
}
|
301
301
|
|
302
302
|
post.ContentLink = getUrlFromRedirectHref(dataElement.Find("a[href*=\"https://lm.facebook.com/l.php\"]").AttrOr("href", ""))
|
303
|
-
|
303
|
+
post.ReactionCount = getReactionFromText(element.DOM.Find("div[id*=\"sentence_\"]").Text())
|
304
304
|
post.ContentImages = (funk.Map(result.PhotoAttachmentsList, func(id string) *fbcrawl.FacebookImage {
|
305
305
|
i, _ := strconv.ParseInt(id, 10, 64)
|
306
306
|
return &fbcrawl.FacebookImage{
|
@@ -374,3 +374,12 @@ func getImageIdFromHref(href string) int64 {
|
|
374
374
|
i, _ := strconv.ParseInt(u.Query().Get("fbid"), 10, 64)
|
375
375
|
return i
|
376
376
|
}
|
377
|
+
|
378
|
+
func getReactionFromText(text string) int64 {
|
379
|
+
logger.Error("reaction", text)
|
380
|
+
if len(text) > 0 {
|
381
|
+
id, _ := strconv.ParseInt(regexp.MustCompile("(\\d+)").FindStringSubmatch(text)[1], 10, 64)
|
382
|
+
return id
|
383
|
+
}
|
384
|
+
return 0
|
385
|
+
}
|
data/fbcrawl.proto
CHANGED