wip
This commit is contained in:
@@ -1,59 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use Jinas\Moosun\MoosunMv;
|
|
||||||
use Jinas\Moosun\ImgScraper;
|
|
||||||
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' => "ގަން"
|
|
||||||
],
|
|
||||||
'satellite_image' => $this->getSatelliteImage()
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getSatelliteImage()
|
|
||||||
{
|
|
||||||
return Cache::remember('weather.maldives.satellite', 3600, function () {
|
|
||||||
$image = new ImgScraper;
|
|
||||||
|
|
||||||
return $image->satellite_image;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -21,7 +21,9 @@ class AdhadhuFeed implements Feed
|
|||||||
*/
|
*/
|
||||||
public function get(): array
|
public function get(): array
|
||||||
{
|
{
|
||||||
$crawler = $this->client->request('GET', "https://adhadhu.com/category/News");
|
$crawler = $this->client->request('GET', "https://adhadhu.com/category/News", [
|
||||||
|
"proxy" => config('karudhaas.proxy.host')
|
||||||
|
]);
|
||||||
|
|
||||||
$feeds = [];
|
$feeds = [];
|
||||||
|
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
"fruitcake/laravel-cors": "^2.0",
|
"fruitcake/laravel-cors": "^2.0",
|
||||||
"goldspecdigital/laravel-eloquent-uuid": "^8.0",
|
"goldspecdigital/laravel-eloquent-uuid": "^8.0",
|
||||||
"guzzlehttp/guzzle": "^7.0.1",
|
"guzzlehttp/guzzle": "^7.0.1",
|
||||||
"jinas/moosun": "^1.1",
|
|
||||||
"laravel/framework": "^8.0",
|
"laravel/framework": "^8.0",
|
||||||
"laravel/jetstream": "^1.2",
|
"laravel/jetstream": "^1.2",
|
||||||
"laravel/sanctum": "^2.6",
|
"laravel/sanctum": "^2.6",
|
||||||
|
48
composer.lock
generated
48
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "3e5dd0a5a9987085a71fc660d1940ded",
|
"content-hash": "397d861160a8b5c62ed5576a8d9957f6",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "asm89/stack-cors",
|
"name": "asm89/stack-cors",
|
||||||
@@ -1777,50 +1777,6 @@
|
|||||||
],
|
],
|
||||||
"time": "2020-06-13T08:05:20+00:00"
|
"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",
|
"name": "laravel/fortify",
|
||||||
"version": "v1.7.13",
|
"version": "v1.7.13",
|
||||||
@@ -10041,5 +9997,5 @@
|
|||||||
"php": "^7.4|^8.0"
|
"php": "^7.4|^8.0"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
"plugin-api-version": "2.6.0"
|
"plugin-api-version": "2.3.0"
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
|
'proxy' => [
|
||||||
|
'host' => env('PROXY_HOST'),
|
||||||
|
],
|
||||||
|
|
||||||
"topic_filters" => [
|
"topic_filters" => [
|
||||||
|
|
||||||
"covid19" => [
|
"covid19" => [
|
||||||
@@ -30,7 +34,7 @@ return [
|
|||||||
"en_name" => "business",
|
"en_name" => "business",
|
||||||
"description" => "ފިޔަފާރިއާ ބެހޭ އެންމެ ފަހުގެ ޙަބަރުތަށް",
|
"description" => "ފިޔަފާރިއާ ބެހޭ އެންމެ ފަހުގެ ޙަބަރުތަށް",
|
||||||
"keys" => [
|
"keys" => [
|
||||||
"tourism", "sme_loan","sme_bank","public_companies","mtcc","tourists","world_tourism_day_","mtcc_shares","google","guest_house","fish_products","tax", "business", "dhiraagu",
|
"tourism", "sme_loan", "sme_bank", "public_companies", "mtcc", "tourists", "world_tourism_day_", "mtcc_shares", "google", "guest_house", "fish_products", "tax", "business", "dhiraagu",
|
||||||
"raajjeyge_iqthisaadh", "guesthouse", "fathuruverikan", "fathuruverikamuge_dhaairaa", "Airport_development", "regional_airports", "loan-schemes", "economy", "ministry-of-finance-and-treasury",
|
"raajjeyge_iqthisaadh", "guesthouse", "fathuruverikan", "fathuruverikamuge_dhaairaa", "Airport_development", "regional_airports", "loan-schemes", "economy", "ministry-of-finance-and-treasury",
|
||||||
"ooredoo", "fisheries"
|
"ooredoo", "fisheries"
|
||||||
],
|
],
|
||||||
@@ -42,8 +46,8 @@ return [
|
|||||||
"en_name" => "world",
|
"en_name" => "world",
|
||||||
"description" => "ދުނިޔޭގެ އެކި ކަންކޮޅުތަކުގެ ޙަބަރު",
|
"description" => "ދުނިޔޭގެ އެކި ކަންކޮޅުތަކުގެ ޙަބަރު",
|
||||||
"keys" => [
|
"keys" => [
|
||||||
"qatar", "gulf", "saudi-arabia", "pakistan", "indonesia", "world", "india", "donald-trump", "united-states-of-america", "sri-lanka", "japan",
|
"qatar", "gulf", "saudi-arabia", "pakistan", "indonesia", "world", "india", "donald-trump", "united-states-of-america", "sri-lanka", "japan",
|
||||||
"america", "china", "elon-musk", "north-korea"
|
"america", "china", "elon-musk", "north-korea"
|
||||||
],
|
],
|
||||||
"color" => "indigo"
|
"color" => "indigo"
|
||||||
]
|
]
|
||||||
|
@@ -51,8 +51,6 @@ Route::get('/about', function () {
|
|||||||
=============================
|
=============================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Route::get('/weather',[WeatherController::class, 'index'])->name('weather');
|
|
||||||
|
|
||||||
|
|
||||||
Route::middleware(['auth:sanctum', 'verified'])->prefix('dashboard')->namespace('Admin')->group(function() {
|
Route::middleware(['auth:sanctum', 'verified'])->prefix('dashboard')->namespace('Admin')->group(function() {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user