Weather stuffs

This commit is contained in:
2020-11-15 05:37:53 +05:00
parent ade4e38b81
commit 8e7d915616
7 changed files with 169 additions and 370 deletions

View File

@@ -0,0 +1,47 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Jinas\Moosun\MoosunMv;
use Illuminate\Support\Facades\Cache;
class WeatherController extends Controller
{
protected $stations = [
'Male',
'Hanimadhoo',
'Kahdhoo',
'Kaadehdhoo',
'Gan'];
public function index()
{
return view('weather.index', [
'stations' => $this->getMoosun(),
'labels' => [
'Male' => "މާލެ",
'Hanimadhoo' => "ހަނިމާދޫ",
'Kahdhoo' => "ކައްދޫ",
'Kaadehdhoo' => "ކާޑެއްދޫ",
'Gan' => "ގަން"
]
]);
}
protected function getMoosun()
{
$data = Cache::remember('weather.maldives', 3600, function () {
$data = [];
foreach ($this->stations as $station) {
$rp = new MoosunMv($station);
$data[] = $rp;
}
return $data;
});
return $data;
}
}

View File

@@ -15,6 +15,7 @@
"fruitcake/laravel-cors": "^2.0",
"goldspecdigital/laravel-eloquent-uuid": "^8.0",
"guzzlehttp/guzzle": "^7.0.1",
"jinas/moosun": "^1.1",
"laravel/framework": "^8.0",
"laravel/jetstream": "^1.2",
"laravel/sanctum": "^2.6",

413
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "582f9c024d991c89f7988dc8259d4cab",
"content-hash": "1e4a51ee267cb01fe4000f168a6ab209",
"packages": [
{
"name": "asm89/stack-cors",
@@ -1415,80 +1415,6 @@
],
"time": "2020-09-30T07:37:11+00:00"
},
{
"name": "intervention/image",
"version": "2.5.1",
"source": {
"type": "git",
"url": "https://github.com/Intervention/image.git",
"reference": "abbf18d5ab8367f96b3205ca3c89fb2fa598c69e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Intervention/image/zipball/abbf18d5ab8367f96b3205ca3c89fb2fa598c69e",
"reference": "abbf18d5ab8367f96b3205ca3c89fb2fa598c69e",
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
"guzzlehttp/psr7": "~1.1",
"php": ">=5.4.0"
},
"require-dev": {
"mockery/mockery": "~0.9.2",
"phpunit/phpunit": "^4.8 || ^5.7"
},
"suggest": {
"ext-gd": "to use GD library based image processing.",
"ext-imagick": "to use Imagick based image processing.",
"intervention/imagecache": "Caching extension for the Intervention Image library"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
},
"laravel": {
"providers": [
"Intervention\\Image\\ImageServiceProvider"
],
"aliases": {
"Image": "Intervention\\Image\\Facades\\Image"
}
}
},
"autoload": {
"psr-4": {
"Intervention\\Image\\": "src/Intervention/Image"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Oliver Vogel",
"email": "oliver@olivervogel.com",
"homepage": "http://olivervogel.com/"
}
],
"description": "Image handling and manipulation library with support for Laravel integration",
"homepage": "http://image.intervention.io/",
"keywords": [
"gd",
"image",
"imagick",
"laravel",
"thumbnail",
"watermark"
],
"support": {
"issues": "https://github.com/Intervention/image/issues",
"source": "https://github.com/Intervention/image/tree/master"
},
"time": "2019-11-02T09:15:47+00:00"
},
{
"name": "jaybizzle/crawler-detect",
"version": "v1.2.100",
@@ -1607,6 +1533,50 @@
],
"time": "2020-06-13T08:05:20+00:00"
},
{
"name": "jinas/moosun",
"version": "v1.1",
"source": {
"type": "git",
"url": "https://github.com/boring-dragon/MoosunMv.git",
"reference": "8a930d1650d9aaa23b3536b4e40082ba976a9189"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/boring-dragon/MoosunMv/zipball/8a930d1650d9aaa23b3536b4e40082ba976a9189",
"reference": "8a930d1650d9aaa23b3536b4e40082ba976a9189",
"shasum": ""
},
"require": {
"fabpot/goutte": "^4.0@dev",
"guzzlehttp/guzzle": "^6.0|^7.0.1"
},
"require-dev": {
"phpunit/phpunit": "^9.0@dev"
},
"type": "library",
"autoload": {
"psr-4": {
"Jinas\\Moosun\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mohamed Jinas",
"email": "j@live.mv"
}
],
"description": "Simple Interface to interact with maldives meteriology",
"support": {
"issues": "https://github.com/boring-dragon/MoosunMv/issues",
"source": "https://github.com/boring-dragon/MoosunMv/tree/v1.1"
},
"time": "2020-11-05T08:47:41+00:00"
},
{
"name": "laravel/fortify",
"version": "v1.6.1",
@@ -2169,71 +2139,6 @@
],
"time": "2020-08-23T07:39:11+00:00"
},
{
"name": "league/glide",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/glide.git",
"reference": "8759b8edfe953c8e6aceb45b3647fb7ae5349a0c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/glide/zipball/8759b8edfe953c8e6aceb45b3647fb7ae5349a0c",
"reference": "8759b8edfe953c8e6aceb45b3647fb7ae5349a0c",
"shasum": ""
},
"require": {
"intervention/image": "^2.4",
"league/flysystem": "^1.0",
"php": "^7.2",
"psr/http-message": "^1.0"
},
"require-dev": {
"mockery/mockery": "^1.2",
"phpunit/php-token-stream": "^3.1",
"phpunit/phpunit": "^8.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": {
"psr-4": {
"League\\Glide\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Reinink",
"email": "jonathan@reinink.ca",
"homepage": "http://reinink.ca"
}
],
"description": "Wonderfully easy on-demand image manipulation library with an HTTP based API.",
"homepage": "http://glide.thephpleague.com",
"keywords": [
"ImageMagick",
"editing",
"gd",
"image",
"imagick",
"league",
"manipulation",
"processing"
],
"support": {
"issues": "https://github.com/thephpleague/glide/issues",
"source": "https://github.com/thephpleague/glide/tree/1.6.0"
},
"time": "2020-07-07T12:23:45+00:00"
},
{
"name": "league/mime-type-detection",
"version": "1.5.0",
@@ -3747,184 +3652,6 @@
],
"time": "2020-09-09T15:24:03+00:00"
},
{
"name": "spatie/browsershot",
"version": "3.40.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/browsershot.git",
"reference": "0aa3a683448efe9c7f2d34fee80dec62bafd6c90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/browsershot/zipball/0aa3a683448efe9c7f2d34fee80dec62bafd6c90",
"reference": "0aa3a683448efe9c7f2d34fee80dec62bafd6c90",
"shasum": ""
},
"require": {
"php": "^7.1",
"spatie/image": "^1.5.3",
"spatie/temporary-directory": "^1.1",
"symfony/process": "^4.2|^5.0"
},
"require-dev": {
"phpunit/phpunit": "^6.1|^7.5",
"spatie/phpunit-snapshot-assertions": "^1.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Spatie\\Browsershot\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"homepage": "https://github.com/freekmurze",
"role": "Developer"
}
],
"description": "Convert a webpage to an image or pdf using headless Chrome",
"homepage": "https://github.com/spatie/browsershot",
"keywords": [
"chrome",
"convert",
"headless",
"image",
"pdf",
"puppeteer",
"screenshot",
"webpage"
],
"support": {
"issues": "https://github.com/spatie/browsershot/issues",
"source": "https://github.com/spatie/browsershot/tree/3.40.0"
},
"funding": [
{
"url": "https://github.com/spatie",
"type": "github"
}
],
"time": "2020-10-07T20:56:21+00:00"
},
{
"name": "spatie/image",
"version": "1.7.6",
"source": {
"type": "git",
"url": "https://github.com/spatie/image.git",
"reference": "74535b5fd67ace75840c00c408666660843e755e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/image/zipball/74535b5fd67ace75840c00c408666660843e755e",
"reference": "74535b5fd67ace75840c00c408666660843e755e",
"shasum": ""
},
"require": {
"ext-exif": "*",
"ext-mbstring": "*",
"league/glide": "^1.4",
"php": "^7.0",
"spatie/image-optimizer": "^1.0",
"spatie/temporary-directory": "^1.0.0",
"symfony/process": "^3.0|^4.0|^5.0"
},
"require-dev": {
"larapack/dd": "^1.1",
"phpunit/phpunit": "^6.0|^7.0",
"symfony/var-dumper": "^3.2|^5.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Spatie\\Image\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"homepage": "https://spatie.be",
"role": "Developer"
}
],
"description": "Manipulate images with an expressive API",
"homepage": "https://github.com/spatie/image",
"keywords": [
"image",
"spatie"
],
"support": {
"issues": "https://github.com/spatie/image/issues",
"source": "https://github.com/spatie/image/tree/master"
},
"time": "2020-01-26T18:56:44+00:00"
},
{
"name": "spatie/image-optimizer",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/spatie/image-optimizer.git",
"reference": "9c1d470e34b28b715d25edb539dd6c899461527c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/image-optimizer/zipball/9c1d470e34b28b715d25edb539dd6c899461527c",
"reference": "9c1d470e34b28b715d25edb539dd6c899461527c",
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
"php": "^7.2",
"psr/log": "^1.0",
"symfony/process": "^4.2|^5.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0",
"symfony/var-dumper": "^4.2|^5.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Spatie\\ImageOptimizer\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"homepage": "https://spatie.be",
"role": "Developer"
}
],
"description": "Easily optimize images using PHP",
"homepage": "https://github.com/spatie/image-optimizer",
"keywords": [
"image-optimizer",
"spatie"
],
"support": {
"issues": "https://github.com/spatie/image-optimizer/issues",
"source": "https://github.com/spatie/image-optimizer/tree/master"
},
"time": "2019-11-25T12:29:24+00:00"
},
{
"name": "spatie/laravel-analytics",
"version": "3.10.1",
@@ -3992,56 +3719,6 @@
],
"time": "2020-09-09T08:25:08+00:00"
},
{
"name": "spatie/temporary-directory",
"version": "1.2.4",
"source": {
"type": "git",
"url": "https://github.com/spatie/temporary-directory.git",
"reference": "8efe8e61e0ca943d84341f10e51ef3a9606af932"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/temporary-directory/zipball/8efe8e61e0ca943d84341f10e51ef3a9606af932",
"reference": "8efe8e61e0ca943d84341f10e51ef3a9606af932",
"shasum": ""
},
"require": {
"php": "^7.2"
},
"require-dev": {
"phpunit/phpunit": "^8.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Spatie\\TemporaryDirectory\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alex Vanderbist",
"email": "alex@spatie.be",
"homepage": "https://spatie.be",
"role": "Developer"
}
],
"description": "Easily create, use and destroy temporary directories",
"homepage": "https://github.com/spatie/temporary-directory",
"keywords": [
"spatie",
"temporary-directory"
],
"support": {
"issues": "https://github.com/spatie/temporary-directory/issues",
"source": "https://github.com/spatie/temporary-directory/tree/master"
},
"time": "2020-09-07T20:41:15+00:00"
},
{
"name": "swiftmailer/swiftmailer",
"version": "v6.2.3",

2
public/css/app.css vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"/js/app.js": "/js/app.js?id=1e0b8ed513e0a41555f0",
"/css/app.css": "/css/app.css?id=4804cfa2127a122f9af1",
"/css/app.css": "/css/app.css?id=6a8f59ba6aaf4f4264d5",
"/js/manifest.js": "/js/manifest.js?id=3c768977c2574a34506e",
"/js/vendor.js": "/js/vendor.js?id=aa27c0f3cc35e93603fe"
}

View File

@@ -0,0 +1,65 @@
<x-layout>
<x-slot name="meta">
<title>Karudhaas</title>
<meta name="description" content="Discover Stories,Daily news and inspiration for maldivian readers." />
<meta name=" twitter:title" content="Karudhaas" />
<meta name="twitter:description" content="Discover Stories,Daily news and inspiration for maldivian readers." />
<meta name="twitter:site" content="https://karudhaas.net" />
<meta name="twitter:image" content="/images/ogi.jpg">
<meta property="og:locale" content="mv" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Karudhaas">
<meta property="og:description" content="Discover Stories,Daily news and inspiration for maldivian readers." />
<meta property="og:url" content="https://karudhaas.net" />
<meta property="og:site_name" content="karudhaas.net" />
<meta property="og:image" content="/images/ogi.jpg">
</x-slot>
<div>
<h1 class="text-gray-800 text-3xl text-center mt-5 mb-2 mr-3 MvAamu"
style="font-weight: 100; letter-spacing: 2.5px;">
ދިވެހި ރާއްޖޭގެ މޫސުމާއި ބެހޭ މަޢުލޫމާތުތަށް
</h1>
<div>
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-2 mb-10">
@foreach ($stations as $station)
<div class="flex flex-col items-center bg-green-100 rounded p-8 transition ease-in-out duration-150 ">
<div class="text-xl font-bold text-gray-900 uppercase text-center leading-7 MvTyper">
{{$labels[$station->stationname]}}
</div>
<div class="uppercase text-xl mt-3">{{$station->description}}</div>
</div>
@endforeach
</div>
<div class="mb-5">
<p class="text-gray-600">Via Maldives Meteorology</p>
</div>
</div>
<div class="border-solid border-b-4 border-gray-900"></div>
<div class="mt-10">
<topic-filter topics="moosun,MET-office,moosumaa_behey_idhaaraa" label="މޫސުމާއި ބެހޭ ޙަބަރުތަށް"
:per_page="8" color="border-green-500">
</topic-filter>
</div>
</div>
</x-layout>

View File

@@ -10,6 +10,7 @@ use App\Http\Controllers\TopicsController;
use App\Http\Controllers\SourcesController;
use App\Http\Controllers\MylistController;
use App\Http\Controllers\NameSpaceController;
use App\Http\Controllers\WeatherController;
use Spatie\Browsershot\Browsershot;
/*
@@ -44,6 +45,14 @@ Route::get('/about', function () {
]);
});
/*
=============================
Resource pages
=============================
*/
Route::get('/weather',[WeatherController::class, 'index'])->name('weather');
Route::middleware(['auth:sanctum', 'verified'])->prefix('dashboard')->namespace('Admin')->group(function() {