jpcaparas / randopedia
Fetch random articles from Wikipedia
1.0.1
2023-08-20 07:23 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.7
Requires (Dev)
- phpunit/phpunit: ^10.3
README
Randopedia is a simple PHP library that fetches random articles from Wikipedia using their REST API.
Features
- Fetch multiple random articles in parallel.
- Blacklist mechanism to avoid fetching articles based on specific keywords.
- Integration with Wikipedia's REST API.
Installation
composer require jpcaparas/randopedia
Usage
use JPCaparas\Randopedia\Fetcher; $fetcher = new Fetcher(); $articles = $fetcher->fetchRandomArticles(5, ['exclude_keyword1', 'exclude_keyword2']);
Tests
Running Integration Tests
Integration tests will hit the live Wikipedia API. To run the integration tests:
vendor/bin/phpunit --testsuite Integration
Please note: Running integration tests frequently may hit rate limits.