arifszn/blog-client

用于获取流行博客平台的最新博客文章的PHP客户端

v1.1.0 2022-06-19 14:16 UTC

This package is auto-updated.

Last update: 2024-09-19 20:33:38 UTC


README


用于获取流行博客平台的最新博客文章的PHP客户端

Packagist · 报告错误 · 请求功能


只需提供您的用户名,即可从流行的博客平台获取最新博客文章,并在您的个人资料或网站上展示。

JavaScript版本: blog.js

安装

通过 composer 安装

composer require arifszn/blog-client

使用方法

  • getDevPost():dev 获取10篇最新文章。

    use Arifszn\Blog\Client;
    
    $client = new Client();
    $result = $client->getDevPost('yourusername');
  • getMediumPost():medium 获取10篇最新文章。

    use Arifszn\Blog\Client;
    
    $client = new Client();
    $result = $client->getMediumPost('yourusername');

示例响应

array:2 [▼
  0 => array:6 [▼
    "title" => "Why Enhancing Virtual Reality is Important",
    "description" => "Virtual reality is seen as a “fun” technology to some without much...",
    "thumbnail" => "https://cdn-images-1.medium.com/max/2600/0*kz30LOdXT8CyOymh",
    "link" => "https://medium.com/p/ac19dd21c728",
    "categories" => array:5 [▼
      "vr",
      "technology",
      "virtual-reality",
      "engineering",
      "artificial-intelligence"
    ],
    "publishedAt" => "2020-11-08 18:43:34"
  ],
  1 => array:6 [▼
    "title" => "How to Get Started With Data Science: a Brief Guide",
    "description" => "You’ve heard about data science and machine learning, and you want to get started. Maybe you hear...",
    "thumbnail" => "https://cdn-images-1.medium.com/max/2600/0*Ah0vLtsvxqUvRWuS",
    "link" => "https://medium.com/p/88ec244f2fee",
    "categories" => array:3 [▼
      "beginner-coding",
      "data-science-training",
      "machine-learning-course"
    ],
    "publishedAt" => "2020-26-07 22:55:26"
  ]
]

贡献

请阅读贡献指南了解如何帮助。

支持

您可以通过收藏此项目来表示支持。

Github Star

许可证

MIT