use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
+use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Util\Network;
use Friendica\Util\Strings;
-require_once 'boot.php';
-require_once 'include/dba.php';
-require_once 'include/enotify.php';
-require_once 'include/text.php';
-
require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
define('TWITTER_DEFAULT_POLL_INTERVAL', 5); // given in minutes
info($e->getMessage());
}
// reload the Addon Settings page, if we don't do it see Bug #42
- $a->internalRedirect('settings/connectors');
+ System::redirectTo('settings/connectors');
} else {
// if no PIN is supplied in the POST variables, the user has changed the setting
// to post a tweet for every new __public__ posting to the wall
}
DBA::close($r);
- require_once "include/items.php";
-
Logger::log('twitter_expire: expire_start');
$r = q("SELECT * FROM `pconfig` WHERE `cat` = 'twitter' AND `k` = 'import' AND `v` = '1' ORDER BY RAND()");
$has_picture = false;
require_once 'mod/item.php';
- require_once 'include/items.php';
require_once 'mod/share.php';
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
continue;
}
- $expanded_url = Network::finalUrl($url->expanded_url);
+ $expanded_url = $url->expanded_url;
- $oembed_data = OEmbed::fetchURL($expanded_url);
+ $final_url = Network::finalUrl($url->expanded_url);
+
+ $oembed_data = OEmbed::fetchURL($final_url);
if (empty($oembed_data) || empty($oembed_data->type)) {
continue;
} elseif ($oembed_data->type != 'link') {
$body = str_replace($url->url, '[url=' . $expanded_url . ']' . $url->display_url . '[/url]', $body);
} else {
- $img_str = Network::fetchUrl($expanded_url, true, $redirects, 4);
+ $img_str = Network::fetchUrl($final_url, true, $redirects, 4);
$tempfile = tempnam(get_temppath(), 'cache');
file_put_contents($tempfile, $img_str);
if (substr($mime, 0, 6) == 'image/') {
$type = 'photo';
- $body = str_replace($url->url, '[img]' . $expanded_url . '[/img]', $body);
+ $body = str_replace($url->url, '[img]' . $final_url . '[/img]', $body);
} else {
$type = $oembed_data->type;
$footerurl = $expanded_url;
$application_name = $a->getHostName();
}
- require_once 'include/items.php';
-
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
try {