4 * @file_tag_list_to_file mod/feedtest.php
8 use Friendica\Core\L10n;
9 use Friendica\Model\Contact;
10 use Friendica\Protocol\Feed;
11 use Friendica\Util\Network;
13 require_once 'boot.php';
14 require_once 'include/dba.php';
15 require_once 'include/text.php';
17 function feedtest_content(App $a)
20 info(L10n::t('You must be logged in to use this module'));
25 if (!empty($_REQUEST['url'])) {
26 $url = $_REQUEST['url'];
28 $importer = dba::selectFirst('user', [], ['uid' => local_user()]);
30 $contact_id = Contact::getIdForURL($url, local_user(), true);
32 $contact = dba::selectFirst('contact', [], ['id' => $contact_id]);
34 $ret = Network::curl($contact['poll']);
38 $import_result = Feed::import($xml, $importer, $contact, $dummy, true);
41 'input' => text_highlight($xml, 'xml'),
42 'output' => var_export($import_result, true),
46 $tpl = get_markup_template('feedtest.tpl');
47 $o = replace_macros($tpl, [
48 '$url' => ['url', L10n::t('Source URL'), defaults($_REQUEST, 'url', ''), ''],