\WebsiteParser
The website parser uses curl and xpath to fetch and parse the a given website. For further information of xpath @link http://www.w3schools.com/xpath/ and @link http://php.net/manual/de/class.domxpath.php read the docs.
- Author: Christian Blank <c.blank@notthatbad.net>
Synopsis
class WebsiteParser
extends Object
{
- // members
- private static integer $count_of_images = 10;
- // methods
- public static DOMXPath load_xpath()
- public static array get_open_graph_data()
- public static array get_meta_data()
- public static string find_content_image()
- private static array get_api_providers()
- public static ParseResult parse()
Hierarchy
Extends
- Object
Members
private
- $count_of_images
Methods
private
- get_api_providers() — Factory method for all IApiProvider implementations.
public
- find_content_image() — Searches in the xpath and gets the images from the body. After that, the method sorts the images after their size and returns the path of the biggest image in the set.
- get_meta_data() — Parses the meta data that isn't associated with open graph.
- get_open_graph_data() — Searches in the xpath object for open graph tags and put them in an array. Before you can use this method you must call loadXPath($url) first to create a xpath object.
- load_xpath() — This method creates a xpath object from a given url and stores them in curXpathObj.
- parse()