mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-04-25 09:30:09 +00:00
Move post/curl/fetchUrl/fetchUrlFull to own class "Network\HTTPRequest"
This commit is contained in:
parent
31bd1a1ba0
commit
9640142a72
18 changed files with 50 additions and 45 deletions
|
@ -7,18 +7,19 @@
|
|||
* Author: Michael Vogel <http://pirati.ca/profile/heluecht>
|
||||
*
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Content\Text\Markdown;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Content\Text\Markdown;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Network\HTTPRequest;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Strings;
|
||||
Use Friendica\Util\DateTimeFormat;
|
||||
|
||||
/* Todo:
|
||||
* - Obtaining API tokens to be able to read non public posts as well
|
||||
|
@ -114,7 +115,7 @@ function discourse_email_getmessage(App $a, &$message)
|
|||
function discourse_fetch_post($host, $topic, $pid)
|
||||
{
|
||||
$url = $host . '/t/' . $topic . '/' . $pid . '.json';
|
||||
$curlResult = Network::curl($url);
|
||||
$curlResult = HTTPRequest::curl($url);
|
||||
if (!$curlResult->isSuccess()) {
|
||||
Logger::info('No success', ['url' => $url]);
|
||||
return false;
|
||||
|
@ -151,7 +152,7 @@ function discourse_fetch_post_from_api(&$message, $post, $host)
|
|||
{
|
||||
$hostaddr = 'https://' . $host;
|
||||
$url = $hostaddr . '/posts/' . $post . '.json';
|
||||
$curlResult = Network::curl($url);
|
||||
$curlResult = HTTPRequest::curl($url);
|
||||
if (!$curlResult->isSuccess()) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue