use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
-use Friendica\Network\HTTPRequest;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
function discourse_fetch_post($host, $topic, $pid)
{
$url = $host . '/t/' . $topic . '/' . $pid . '.json';
- $curlResult = HTTPRequest::curl($url);
+ $curlResult = DI::httpRequest()->curl($url);
if (!$curlResult->isSuccess()) {
Logger::info('No success', ['url' => $url]);
return false;
{
$hostaddr = 'https://' . $host;
$url = $hostaddr . '/posts/' . $post . '.json';
- $curlResult = HTTPRequest::curl($url);
+ $curlResult = DI::httpRequest()->curl($url);
if (!$curlResult->isSuccess()) {
return false;
}
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
-use Friendica\Network\HTTPRequest;
use Friendica\Util\ConfigFileLoader;
use Friendica\Util\Strings;
$j = DI::cache()->get($cachekey);
if (is_null($j)) {
- $curlResult = HTTPRequest::curl($nomserver . $args);
+ $curlResult = DI::httpRequest()->curl($nomserver . $args);
if ($curlResult->isSuccess()) {
$j = json_decode($curlResult->getBody(), true);
DI::cache()->set($cachekey, $j, Duration::MONTH);
use Friendica\Model\Group;
use Friendica\Model\Item;
use Friendica\Model\User;
-use Friendica\Network\HTTPRequest;
use Friendica\Protocol\Activity;
use Friendica\Protocol\ActivityNamespace;
use Friendica\Util\ConfigFileLoader;
function pumpio_reachable($url)
{
- return HTTPRequest::curl($url, false, ['timeout' => 10])->isSuccess();
+ return DI::httpRequest()->curl($url, false, ['timeout' => 10])->isSuccess();
}
/*