X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fimporttwitteratom.php;h=d121179f47a9e45e0fa1777d0d9f9c29c419b499;hb=c18020561b8a01bbb2b3fc092694a7bb0fde70f9;hp=c12e3b91a8f3a920ce9fc9c4f21e08fded44b83d;hpb=c3ceaa893fa878d531b0af05a3a8ed367177848c;p=quix0rs-gnu-social.git diff --git a/scripts/importtwitteratom.php b/scripts/importtwitteratom.php old mode 100644 new mode 100755 index c12e3b91a8..d121179f47 --- a/scripts/importtwitteratom.php +++ b/scripts/importtwitteratom.php @@ -33,33 +33,9 @@ import an Atom feed from Twitter as notices by a user END_OF_IMPORTTWITTERATOM_HELP; -require_once INSTALLDIR.'/scripts/commandline.inc'; +require_once INSTALLDIR.'/scripts/commandline.inc.php'; 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'); @@ -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,