thiladhun scrapper to green

This commit is contained in:
Mohamed jinas
2024-01-06 15:37:59 +05:00
parent 69c05d9471
commit 1b56bcb510
5 changed files with 24 additions and 18 deletions

View File

@@ -9,8 +9,8 @@ class ThiladhunFeed implements Feed
public function __construct() public function __construct()
{ {
$this->client = new Client(); $this->client = new Client();
} }
/** /**
* Get all the latest news * Get all the latest news
* *
@@ -18,7 +18,7 @@ class ThiladhunFeed implements Feed
*/ */
public function get() : array public function get() : array
{ {
$crawler = $this->client->request('GET', "https://www.thiladhun.com"); $crawler = $this->client->request('GET', "https://www.thiladhun.com");
$feeds = []; $feeds = [];
@@ -31,9 +31,9 @@ class ThiladhunFeed implements Feed
"date" => $node->filter('time')->first()->attr('datetime') "date" => $node->filter('time')->first()->attr('datetime')
]; ];
}); });
return $feeds; return $feeds;
} }
} }

View File

@@ -39,8 +39,8 @@ class ThiladhunScraper
$crawler = $this->client->request('GET', $url); $crawler = $this->client->request('GET', $url);
$crawler->filter('h1')->each(function ($node) { $crawler->filter('meta[property="og:title"]')->each(function ($node) {
$this->title = $node->text(); $this->title = $node->attr('content');
}); });
@@ -58,7 +58,7 @@ class ThiladhunScraper
"slug" => basename($node->attr('href')) "slug" => basename($node->attr('href'))
]; ];
} }
}); });
$crawler->filter('a > .elementor-post-info__item--type-author')->each(function ($node) { $crawler->filter('a > .elementor-post-info__item--type-author')->each(function ($node) {

20
package-lock.json generated
View File

@@ -1,5 +1,5 @@
{ {
"name": "karudhaas", "name": "karudhaas-web-api",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
@@ -18206,7 +18206,8 @@
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.3.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.3.tgz",
"integrity": "sha512-WQs0ep98FXX2XBAfQpRbY0Ma6ADw8JR6xoIkaIiJIzClGOMqVRvPCWqndTxf28DgFopWan0EKtHtg/5W1h0Zkw==", "integrity": "sha512-WQs0ep98FXX2XBAfQpRbY0Ma6ADw8JR6xoIkaIiJIzClGOMqVRvPCWqndTxf28DgFopWan0EKtHtg/5W1h0Zkw==",
"dev": true "dev": true,
"requires": {}
}, },
"@webpack-cli/info": { "@webpack-cli/info": {
"version": "1.2.4", "version": "1.2.4",
@@ -18221,7 +18222,8 @@
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.4.0.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.4.0.tgz",
"integrity": "sha512-xgT/HqJ+uLWGX+Mzufusl3cgjAcnqYYskaB7o0vRcwOEfuu6hMzSILQpnIzFMGsTaeaX4Nnekl+6fadLbl1/Vg==", "integrity": "sha512-xgT/HqJ+uLWGX+Mzufusl3cgjAcnqYYskaB7o0vRcwOEfuu6hMzSILQpnIzFMGsTaeaX4Nnekl+6fadLbl1/Vg==",
"dev": true "dev": true,
"requires": {}
}, },
"@xtuc/ieee754": { "@xtuc/ieee754": {
"version": "1.2.0", "version": "1.2.0",
@@ -18317,7 +18319,8 @@
"version": "3.5.2", "version": "3.5.2",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
"dev": true "dev": true,
"requires": {}
}, },
"alphanum-sort": { "alphanum-sort": {
"version": "1.0.2", "version": "1.0.2",
@@ -21637,7 +21640,8 @@
"version": "5.1.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz",
"integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==",
"dev": true "dev": true,
"requires": {}
}, },
"ieee754": { "ieee754": {
"version": "1.2.1", "version": "1.2.1",
@@ -24974,7 +24978,8 @@
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz",
"integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==", "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==",
"dev": true "dev": true,
"requires": {}
}, },
"postcss-modules-local-by-default": { "postcss-modules-local-by-default": {
"version": "4.0.0", "version": "4.0.0",
@@ -28830,7 +28835,8 @@
"version": "7.4.5", "version": "7.4.5",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.5.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.5.tgz",
"integrity": "sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==", "integrity": "sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==",
"dev": true "dev": true,
"requires": {}
}, },
"xtend": { "xtend": {
"version": "4.0.2", "version": "4.0.2",

2
public/css/app.css vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
{ {
"/js/app.js": "/js/app.js?id=abf0a000d5784d7aa33c", "/js/app.js": "/js/app.js?id=abf0a000d5784d7aa33c",
"/css/app.css": "/css/app.css?id=414685d6b836d6325b7b" "/css/app.css": "/css/app.css?id=9b0e1f541ee097f6f038"
} }