forked from wallabag/wallabag
Rewrote Pocket Import
For the moment, we won't do a queue system, just a plain synchronous import. We also use ContentProxy to grab content for each article from Pocket. Error from Pocket are now logged using the logger. The ImportInterface need to be simple and not related to oAuth (not all import will use that method).
This commit is contained in:
@ -26,16 +26,6 @@ class Utils
|
||||
return str_replace(array('+', '/'), '', $token);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $words
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public static function convertWordsToMinutes($words)
|
||||
{
|
||||
return floor($words / 200);
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given text, we calculate reading time for an article
|
||||
* based on 200 words per minute.
|
||||
@ -46,6 +36,6 @@ class Utils
|
||||
*/
|
||||
public static function getReadingTime($text)
|
||||
{
|
||||
return self::convertWordsToMinutes(str_word_count(strip_tags($text)));
|
||||
return floor(str_word_count(strip_tags($text)) / 200);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user