fbcrawl-colly 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22ec88aaf52a44344fc32ab22f6914f264b49ea10912c527c030ffd97ac12d36
4
- data.tar.gz: d007e4326b15c64e725009548c8e9dac00e263da888d736876b6093a4fba5108
3
+ metadata.gz: 5a3dd903339ecec17525ca24b86324664458ef884f70065f611dc5bc15caf0a6
4
+ data.tar.gz: 7d7fbfd082240d21fc66f100eb530f81579b62c715181a10b95b1c70f5ad1d98
5
5
  SHA512:
6
- metadata.gz: 448bbb6b045d3b4baa3c0eae23bad85f0daf93159f514ff77e0f9383350b1c52aa3ab5360646099e56ccc19eea0bc8300ba42e67a26262e1e1f3141be61515c0
7
- data.tar.gz: 5d326d26fb0354ea78236849be7328ce49f919435c7c373130f19439c2447f9026ce31f88bc64d5cc72581fadc618a0891cd777f885e438f01217295b58309e5
6
+ metadata.gz: c5a3b0dcd89eb3b94adcc797785984e04a122a51f9135a37aed10aee0607dd357fe99ebd69e8f2eb0ebeaf05ff4c1f0bf21c4713d173065f4782dbeb192c365e
7
+ data.tar.gz: d01e881175776aa5039859b1b11d723c3a577a4a68f54b6bb550d0c8c90c87d89004a94b05f21846763d56687d65bc9132e602f61a94fcebb25e934dca93ab40
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fbcrawl-colly (0.1.1)
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-universal-darwin)
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)
@@ -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
+ }
@@ -24,6 +24,7 @@ message FacebookPost {
24
24
  repeated FacebookImage content_images = 7;
25
25
  repeated FacebookComment comments = 5;
26
26
  int64 created_at = 9;
27
+ int64 reaction_count = 10;
27
28
  }
28
29
 
29
30
  message FacebookImage {
@@ -1,3 +1,3 @@
1
1
  module FbcrawlColly
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbcrawl-colly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duy Le