And another good library

pull/849/head
Michael 2019-06-12 09:07:30 +00:00
parent 6646d0f963
commit e52e6f7be2
2 changed files with 3 additions and 2 deletions

View File

@ -70,7 +70,7 @@ function blockbot_init_1(App $a) {
'Python-urllib/', 'Liferea/', 'aiohttp/', 'WordPress.com Reader', 'hackney/', 'Python-urllib/', 'Liferea/', 'aiohttp/', 'WordPress.com Reader', 'hackney/',
'Faraday v', 'okhttp', 'UniversalFeedParser', 'PixelFedBot', 'python-requests', 'Faraday v', 'okhttp', 'UniversalFeedParser', 'PixelFedBot', 'python-requests',
'WordPress/', 'http.rb/', 'Apache-HttpClient/', 'WordPress.com;', 'Pleroma', 'WordPress/', 'http.rb/', 'Apache-HttpClient/', 'WordPress.com;', 'Pleroma',
'Dispatch/', 'Ruby', 'Uptimebot/', 'Java/']; 'Dispatch/', 'Ruby', 'Uptimebot/', 'Java/', 'libwww-perl/'];
foreach ($agents as $agent) { foreach ($agents as $agent) {
if (stristr($_SERVER['HTTP_USER_AGENT'], $agent)) { if (stristr($_SERVER['HTTP_USER_AGENT'], $agent)) {

View File

@ -575,7 +575,7 @@ function twitter_post_hook(App $a, array &$b)
return; return;
} }
Logger::log('twitter post invoked'); Logger::notice('twitter post invoked', ['id' => $b['id'], 'guid' => $b['guid']]);
PConfig::load($b['uid'], 'twitter'); PConfig::load($b['uid'], 'twitter');
@ -610,6 +610,7 @@ function twitter_post_hook(App $a, array &$b)
$b['body'] = twitter_update_mentions($b['body']); $b['body'] = twitter_update_mentions($b['body']);
$msgarr = ItemContent::getPlaintextPost($b, $max_char, true, 8); $msgarr = ItemContent::getPlaintextPost($b, $max_char, true, 8);
Logger::info('Got plaintext', $msgarr);
$msg = $msgarr["text"]; $msg = $msgarr["text"];
if (($msg == "") && isset($msgarr["title"])) { if (($msg == "") && isset($msgarr["title"])) {