Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('_JEXEC') or die('Restricted access');
- use Joomla\CMS\Http\HttpFactory;
- use Joomla\Registry\Registry;
- class ModFooHelper
- {
- public function __construct()
- {
- $this->baseurl = 'https://www.eventbriteapi.com/v3/users/me/events?token=mytoken';
- }
- public static function getEvents()
- {
- $httpOptions = [
- 'userAgent' => "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17\r\n"
- ];
- $options = new Registry($httpOptions);
- $http = HttpFactory::getHttp($options);
- $httpResult = $http->get($this->baseurl);
- $results = json_decode($httpResult->body);
- return $results;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement