Skip to content

Commit 458d946

Browse files
authored
Added the app MySpeed
1 parent 48e2ab3 commit 458d946

5 files changed

Lines changed: 79 additions & 0 deletions

File tree

MySpeed/MySpeed.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
namespace App\SupportedApps\MySpeed;
4+
5+
class MySpeed extends \App\SupportedApps implements \App\EnhancedApps
6+
{
7+
8+
public $config;
9+
10+
//protected $login_first = true; // Uncomment if api requests need to be authed first
11+
//protected $method = 'POST'; // Uncomment if requests to the API should be set by POST
12+
13+
public function __construct()
14+
{
15+
//$this->jar = new \GuzzleHttp\Cookie\CookieJar; // Uncomment if cookies need to be set
16+
}
17+
18+
public function test()
19+
{
20+
$test = parent::appTest($this->url('status'));
21+
echo $test->status;
22+
}
23+
24+
public function livestats()
25+
{
26+
$status = 'inactive';
27+
$res = parent::execute($this->url('status'));
28+
$details = json_decode($res->getBody());
29+
30+
$data = [];
31+
return parent::getLiveStats($status, $data);
32+
33+
}
34+
35+
public function url($endpoint)
36+
{
37+
$api_url = parent::normaliseurl($this->config->url).$endpoint;
38+
return $api_url;
39+
}
40+
}

MySpeed/app.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"appid": "ac2f9c8aee6a960204b0fb387d33185679217db2",
3+
"name": "MySpeed",
4+
"website": "https://myspeed.dev",
5+
"license": "MIT License",
6+
"description": "MySpeed is a speed test analysis software that records your internet speed for up to 30 days.",
7+
"enhanced": true,
8+
"tile_background": "dark",
9+
"icon": "myspeed.png"
10+
}

MySpeed/config.blade.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<h2>{{ __('app.apps.config') }} ({{ __('app.optional') }}) @include('items.enable')</h2>
2+
<div class="items">
3+
<div class="input">
4+
<label>{{ strtoupper(__('app.url')) }}</label>
5+
{!! Form::text('config[override_url]', null, array('placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control')) !!}
6+
</div>
7+
<div class="input">
8+
<label>{{ __('app.apps.username') }}</label>
9+
{!! Form::text('config[username]', null, array('placeholder' => __('app.apps.username'), 'data-config' => 'username', 'class' => 'form-control config-item')) !!}
10+
</div>
11+
<div class="input">
12+
<label>{{ __('app.apps.password') }}</label>
13+
{!! Form::input('password', 'config[password]', '', ['placeholder' => __('app.apps.password'), 'data-config' => 'password', 'class' => 'form-control config-item']) !!}
14+
</div>
15+
<div class="input">
16+
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
17+
</div>
18+
</div>
19+

MySpeed/livestats.blade.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<ul class="livestats">
2+
<li>
3+
<span class="title">Queue</span>
4+
<strong>{!! $queue_size !!}</strong>
5+
</li>
6+
<li>
7+
<span class="title">Speed</span>
8+
<strong>{!! $current_speed !!}</strong>
9+
</li>
10+
</ul>

MySpeed/myspeed.png

34.3 KB
Loading

0 commit comments

Comments
 (0)