aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Tools.class.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-09 08:25:16 +0200
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-09 08:25:16 +0200
commitd91787589bfd7541a99032cc23243165dc1572c4 (patch)
treead7246e41e5acbb87eafafbbdd3c95f0ea7a0c18 /inc/poche/Tools.class.php
parent3d8bded89e880aa28a1b17422c5bb3d9def28026 (diff)
downloadwallabag-d91787589bfd7541a99032cc23243165dc1572c4.tar.gz
wallabag-d91787589bfd7541a99032cc23243165dc1572c4.tar.zst
wallabag-d91787589bfd7541a99032cc23243165dc1572c4.zip
fix #113 - reading time
Diffstat (limited to 'inc/poche/Tools.class.php')
-rw-r--r--inc/poche/Tools.class.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php
index 4a72bae3..0eb0d9ea 100644
--- a/inc/poche/Tools.class.php
+++ b/inc/poche/Tools.class.php
@@ -224,4 +224,13 @@ class Tools
224 224
225 return FALSE; 225 return FALSE;
226 } 226 }
227
228 public static function getReadingTime($text) {
229 $word = str_word_count(strip_tags($text));
230 $minutes = floor($word / 200);
231 $seconds = floor($word % 200 / (200 / 60));
232 $time = array('minutes' => $minutes, 'seconds' => $seconds);
233
234 return $minutes;
235 }
227} \ No newline at end of file 236} \ No newline at end of file