jpcaparas / randopedia
Fetch random articles from Wikipedia
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/jpcaparas/randopedia
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.