diff options
| author | lolcat <will@lolcat.ca> | 2024-08-02 19:40:44 -0400 |
|---|---|---|
| committer | lolcat <will@lolcat.ca> | 2024-08-02 19:40:44 -0400 |
| commit | beb08f46e270d0a9c4e949f633a752e7436c103f (patch) | |
| tree | 53e9918d6717025d0be392f592987733615b3197 /scraper | |
| parent | 4e4796bb714a1672a6f9b6ea6c58a239a2606dd8 (diff) | |
fixed greppr
Diffstat (limited to 'scraper')
| -rw-r--r-- | scraper/greppr.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/scraper/greppr.php b/scraper/greppr.php index f761751..2f425a6 100644 --- a/scraper/greppr.php +++ b/scraper/greppr.php @@ -298,9 +298,8 @@ class greppr{ $description = $this->fuckhtml - ->getElementsByFuzzyAttributeValue( - "style", - "color:#777777;", + ->getElementsByClassName( + "highlightedDesc", "p" ); @@ -310,9 +309,11 @@ class greppr{ }else{ $description = - $this->fuckhtml - ->getTextContent( - $description[0] + $this->limitstrlen( + $this->fuckhtml + ->getTextContent( + $description[0] + ) ); } @@ -325,7 +326,7 @@ class greppr{ $date = strtotime( explode( - "Added:", + ":", $this->fuckhtml ->getTextContent( $date[count($date) - 1]["innerHTML"] @@ -426,4 +427,9 @@ class greppr{ return $tokens; } + + private function limitstrlen($text){ + + return explode("\n", wordwrap($text, 300, "\n"))[0]; + } } |
