onebox 1.8.54 → 1.8.55
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onebox/engine/twitter_status_onebox.rb +21 -1
- data/lib/onebox/version.rb +1 -1
- data/templates/twitterstatus.mustache +6 -0
- 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: c8a00f9099e20ceead5cc15b266194ec21b9146d9c1921ca76017f7653c038a1
|
4
|
+
data.tar.gz: ea3d01bcb2411573bdaf1a48ba109e31cb4c85874bc882d3039df7c596fb420a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f8213dc2113c7c1db11577407da8f94d32311865a78a8ce28defa69d2a7e5caf3db4ddd6acad6f739b3d150c61aa2d55b782cc4b8dace11e3552c37b1f6a6da
|
7
|
+
data.tar.gz: aafdcb06bc1f396350b1a76e921da84e115d1417922d71589dcb4f515001efc81c15170cb7fab4494620a3a411ad7cf6238c810326de2443b4c470d80e2a5b7f
|
@@ -90,12 +90,32 @@ module Onebox
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
+
def likes
|
94
|
+
if twitter_api_credentials_present?
|
95
|
+
count = access(:favorite_count).to_i
|
96
|
+
return count > 0 ? client.prettify_number(count) : nil
|
97
|
+
else
|
98
|
+
raw.at_css(".request-favorited-popup").attr('data-compact-localized-count') rescue nil
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def retweets
|
103
|
+
if twitter_api_credentials_present?
|
104
|
+
count = access(:retweet_count).to_i
|
105
|
+
return count > 0 ? client.prettify_number(count) : nil
|
106
|
+
else
|
107
|
+
raw.at_css(".request-retweeted-popup").attr('data-compact-localized-count') rescue nil
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
93
111
|
def data
|
94
112
|
{ link: link,
|
95
113
|
tweet: tweet,
|
96
114
|
timestamp: timestamp,
|
97
115
|
title: title,
|
98
|
-
avatar: avatar
|
116
|
+
avatar: avatar,
|
117
|
+
likes: likes,
|
118
|
+
retweets: retweets }
|
99
119
|
end
|
100
120
|
end
|
101
121
|
end
|
data/lib/onebox/version.rb
CHANGED
@@ -9,4 +9,10 @@
|
|
9
9
|
|
10
10
|
<div class='date'>
|
11
11
|
<a href="{{link}}" target="_blank">{{timestamp}}</a>
|
12
|
+
{{#likes}}
|
13
|
+
<span class="like"><i class="fa fa-heart"></i> {{likes}}</span>
|
14
|
+
{{/likes}}
|
15
|
+
{{#retweets}}
|
16
|
+
<span class="retweet"><i class="fa fa-retweet"></i> {{retweets}}</span>
|
17
|
+
{{/retweets}}
|
12
18
|
</div>
|
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.8.
|
4
|
+
version: 1.8.55
|
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: 2018-07-
|
13
|
+
date: 2018-07-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|