summaryrefslogtreecommitdiff
path: root/providers
diff options
context:
space:
mode:
Diffstat (limited to 'providers')
-rw-r--r--providers/Facebook.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/providers/Facebook.php b/providers/Facebook.php
index b3f2015..d5233c3 100644
--- a/providers/Facebook.php
+++ b/providers/Facebook.php
@@ -20,7 +20,7 @@ class Facebook extends \Providers\HtmlFeed {
}
protected function __getUserAgent() {
- return 'curl/7.72.0';
+ return 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.51 Safari/537.36';
}
protected function _getCachePath() {
@@ -36,12 +36,16 @@ class Facebook extends \Providers\HtmlFeed {
$string = str_replace("\xc2\xa0", ' ', $origString);
$string = str_replace(' godzinie ', ' ', $string);
$string = str_replace(' o ', ', ', $string);
- $string = str_replace('godz.', 'hours ago', $string);
$string = str_replace('Wczoraj', 'Yesterday', $string);
+ $string = str_replace('Dzisiaj', '', $string);
+ $string = str_replace('godz.', 'hours ago', $string);
+ $string = str_replace('min', 'minutes ago', $string);
+ $string = str_replace('Przed chwilą', 'now', $string);
$string = str_replace(['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia'], ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], $string);
$time = strtotime($string);
if (!$time) {
- throw new Exception('Cannot parse date string: ' . $origString);
+ var_dump(bin2hex($origString));
+ throw new \Exception('Cannot parse date string: ' . $origString);
}
return $string;
}