update
This commit is contained in:
@@ -43,7 +43,6 @@ class ScrapeFeshunCommand extends Command
|
|||||||
$source = Source::where('slug', 'feshun')->first();
|
$source = Source::where('slug', 'feshun')->first();
|
||||||
|
|
||||||
$articles = (new FeshunService)->scrape();
|
$articles = (new FeshunService)->scrape();
|
||||||
|
|
||||||
foreach ($articles as $article) {
|
foreach ($articles as $article) {
|
||||||
|
|
||||||
// Attach the relationship between source and article and return the curren article instance
|
// Attach the relationship between source and article and return the curren article instance
|
||||||
|
@@ -23,7 +23,7 @@ class FeshunService extends Client
|
|||||||
'title' => $article["title"]["rendered"],
|
'title' => $article["title"]["rendered"],
|
||||||
'og_title' => $article["title"]["rendered"],
|
'og_title' => $article["title"]["rendered"],
|
||||||
'image' => Http::get("https://feshun.mv/wp-json/wp/v2/media?include=".$article["featured_media"])->json()[0]["guid"]["rendered"],
|
'image' => Http::get("https://feshun.mv/wp-json/wp/v2/media?include=".$article["featured_media"])->json()[0]["guid"]["rendered"],
|
||||||
'content' => explode("<p>",preg_replace("/[a-zA-Z]/", "", $article["content"]["rendered"])),
|
'content' => explode("<p>",$article["content"]["rendered"]),
|
||||||
'date' => Carbon::parse($article["date"])->format("Y-m-d H:i:s"),
|
'date' => Carbon::parse($article["date"])->format("Y-m-d H:i:s"),
|
||||||
'url' => $article["link"],
|
'url' => $article["link"],
|
||||||
'author' => Http::get("https://feshun.mv/wp-json/wp/v2/users?include=".$article["author"])->json()[0]["name"],
|
'author' => Http::get("https://feshun.mv/wp-json/wp/v2/users?include=".$article["author"])->json()[0]["name"],
|
||||||
|
Reference in New Issue
Block a user