PHP Classes

ListWiki: Scrape and parse Wikipedia page content

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (9 months ago) RSS 2.0 feedNot enough user ratingsTotal: 338 All time: 7,088 This week: 41Up
Version License PHP version Categories
listwiki 1.9GNU General Publi...5.0PHP 5, Web services
Description 

Author

This class can scrape and parse Wikipedia page content.

It can retrieve a given Wikipedia page and parse it to extract different parts of the content.

The class returns the Wikipedia page content topics and sub-topics as an array or a JSON encode string.

Picture of Shenbaga Prasanna
  Performance   Level  
Name: Shenbaga Prasanna <contact>
Classes: 3 packages by
Country: India India
Age: 30
All time rank: 2618157 in India India
Week rank: 206 Up12 in India India Up

Details

ListWiki ======== A PHP Class to get the textual contents of a wikipedia page as a Array or JSON. You can create an object to the class by passing the wikipedia URL as parameter to the constructor. It will support parameterized constructor only. for instance, $obj = new ListWiki("http://en.wikipedia.org/wiki/PHP"); there are only two functions you can use. $json = $obj->getJSON(); //Gets the content as JSON of the wiki page $arr = $obj->getArray(); //Gets the content as PHP Array Limitations: * There might be some encoding problems which you have to take care of. I could not fix it properly, any forks will be welcomed. * The content at the beginning will be with the key as 'Introduction' on the array and JSON returned.

  Files folder image Files (3)  
File Role Description
Accessible without login Plain text file LICENSE Lic. Auxiliary data
Plain text file listwiki.php Class Class source
Accessible without login Plain text file README.md Doc. Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:338
This week:0
All time:7,088
This week:41Up