/** * @inheritdoc */ public function getPublicationDate() { return SelectorBuilder::create()->setSelectorKey('article .article-header .byline time.timestamp')->setSelectorType(SelectorBuilder::NODE_ATTR)->setSelectorAttr('datetime'); }
/** * @inheritdoc */ public function getTwitter() { return SelectorBuilder::create()->setSelectorKey('article .article-header .twitter-handle a')->setSelectorType(SelectorBuilder::NODE_TEXT); }
public function getSelectorAttr() { $selector = SelectorBuilder::create()->setSelectorType(SelectorBuilder::NODE_ATTR)->setSelectorAttr('fakeproperty'); $this->assertEquals(SelectorBuilder::NODE_ATTR, $selector->getSelectorType()); $this->assertEquals('fakeproperty', $selector->getSelectorAttr()); }
/** * @inheritdoc */ public function getCanonical() { return SelectorBuilder::create()->setSelectorKey('link[rel="canonical"]')->setSelectorType(SelectorBuilder::NODE_ATTR)->setSelectorAttr('href'); }
/** * @inheritdoc */ public function getCustomMeta($selectorKey, $selectorAttr) { return SelectorBuilder::create()->setSelectorKey(sprintf('meta[%s]', $selectorKey))->setSelectorType(SelectorBuilder::NODE_ATTR)->setSelectorAttr($selectorAttr); }