X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fimporttwitteratom.php;h=a29526f27e1726f57f3679dcdab034fbf4350614;hb=753019baf27281370e91084d3766e59fa80b66f1;hp=7316f21080c18bde893e4120d2f349ca5cb10760;hpb=32532c7c42971ca337e5bf55c5deb60312a63816;p=quix0rs-gnu-social.git diff --git a/scripts/importtwitteratom.php b/scripts/importtwitteratom.php index 7316f21080..a29526f27e 100644 --- a/scripts/importtwitteratom.php +++ b/scripts/importtwitteratom.php @@ -36,30 +36,6 @@ END_OF_IMPORTTWITTERATOM_HELP; require_once INSTALLDIR.'/scripts/commandline.inc'; require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php'; -function getUser() -{ - $user = null; - - if (have_option('i', 'id')) { - $id = get_option_value('i', 'id'); - $user = User::staticGet('id', $id); - if (empty($user)) { - throw new Exception("Can't find user with id '$id'."); - } - } else if (have_option('n', 'nickname')) { - $nickname = get_option_value('n', 'nickname'); - $user = User::staticGet('nickname', $nickname); - if (empty($user)) { - throw new Exception("Can't find user with nickname '$nickname'"); - } - } else { - show_help(); - exit(1); - } - - return $user; -} - function getAtomFeedDocument() { $filename = get_option_value('f', 'file'); @@ -102,7 +78,7 @@ function importActivityStream($user, $doc) for ($i = $entries->length - 1; $i >= 0; $i--) { $entry = $entries->item($i); $activity = new Activity($entry, $feed); - $object = $activity->object; + $object = $activity->objects[0]; if (!have_option('q', 'quiet')) { print $activity->content . "\n"; } @@ -113,7 +89,7 @@ function importActivityStream($user, $doc) $html = htmLawed($html, $config); - $content = html_entity_decode(strip_tags($html)); + $content = html_entity_decode(strip_tags($html), ENT_QUOTES, 'UTF-8'); $notice = Notice::saveNew($user->id, $content,