proxy feshun
This commit is contained in:
@@ -14,7 +14,12 @@ class FeshunService extends Client
|
|||||||
*/
|
*/
|
||||||
public function scrape(): array
|
public function scrape(): array
|
||||||
{
|
{
|
||||||
$articles = Http::get("https://feshun.mv/wp-json/wp/v2/posts")->json();
|
$proxyOptions = [
|
||||||
|
'proxy' => config('karudhaas.proxy.host'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$articles = Http::withOptions($proxyOptions)
|
||||||
|
->get("https://feshun.mv/wp-json/wp/v2/posts")->json();
|
||||||
|
|
||||||
$articlesitems = [];
|
$articlesitems = [];
|
||||||
foreach ($articles as $article) {
|
foreach ($articles as $article) {
|
||||||
@@ -22,11 +27,13 @@ class FeshunService extends Client
|
|||||||
'source' => 'Feshun',
|
'source' => 'Feshun',
|
||||||
'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::withOptions($proxyOptions)
|
||||||
'content' => explode("<p>",str_replace("</p>","",$article["content"]["rendered"])),
|
->get("https://feshun.mv/wp-json/wp/v2/media?include=" . $article["featured_media"])->json()[0]["guid"]["rendered"],
|
||||||
|
'content' => explode("<p>", str_replace("</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::withOptions($proxyOptions)
|
||||||
|
->get("https://feshun.mv/wp-json/wp/v2/users?include=" . $article["author"])->json()[0]["name"],
|
||||||
'guid' => basename($article["link"]),
|
'guid' => basename($article["link"]),
|
||||||
'topics' => [
|
'topics' => [
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user