C-based CLI utility for fetching and rendering plaintext Wikipedia article content via MediaWiki API.
- libcurl: Network transport.
- cJSON: JSON serialization and parsing.
- POSIX environment: Required for
popenandlessintegration.
Just run
make./build/wiki "Article Title"- Protocol: MediaWiki Action API (
action=query). - Format:
prop=extractswithexplaintext=1for clean text removal of HTML/Markdown. - Network Configuration:
- Connect Timeout: 30 seconds.
- Total Timeout: 30 seconds.
- Redirects: Follow location enabled.
- User-Agent:
wiki-extract/1.0.
- I/O Handling:
- Output is piped to
less -Rfor paging support. - Falls back to
stdoutifpopenfails.
- Output is piped to
- Memory Management: Manual buffer reallocation via
write_callbackfor dynamic API payloads.
MIT