Skip to content

Commit

Permalink
Modify associated with the site redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
app2641 committed Oct 4, 2015
1 parent 421c2bd commit f32753c
Show file tree
Hide file tree
Showing 8 changed files with 2,747 additions and 2,497 deletions.
838 changes: 0 additions & 838 deletions data/fixtures/html/rakuen/6640.html

This file was deleted.

903 changes: 903 additions & 0 deletions data/fixtures/html/rakuen/880.html

Large diffs are not rendered by default.

1,697 changes: 897 additions & 800 deletions data/fixtures/html/rakuen/error.html

Large diffs are not rendered by default.

1,697 changes: 897 additions & 800 deletions data/fixtures/html/rakuen/error2.html

Large diffs are not rendered by default.

85 changes: 38 additions & 47 deletions data/fixtures/rss/rakuen.xml
Original file line number Diff line number Diff line change
@@ -1,51 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
>

<channel>
<title>FC2アダルト・xvideosまとめ&#124;楽園エロ動画</title>
<atom:link href="http://rakuero-douga.com/feed" rel="self" type="application/rss+xml" />
<link>http://rakuero-douga.com</link>
<description>FC2アダルトからxvideosなど厳選した無料で見れるエロ動画を楽園エロ動画で更新中。</description>
<lastBuildDate>Thu, 17 Jul 2014 08:00:00 +0000</lastBuildDate>
<language>ja</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>http://wordpress.org/?v=3.8</generator>

<item>
<title>おさげ頭の黒髪少女と父が繰り広げる変態相姦調教セクロスがエロすぎwww</title>
<link>http://rakuero-douga.com/archives/6640</link>
<comments>http://rakuero-douga.com/archives/6640#comments</comments>
<pubDate>Thu, 17 Jul 2014 12:00:00 +0000</pubDate>
<dc:creator><![CDATA[管理人]]></dc:creator>
<category><![CDATA[xvideos]]></category>
<category><![CDATA[エロ動画]]></category>
<category><![CDATA[美少女]]></category>
<category><![CDATA[近親相姦]]></category>
<category><![CDATA[ハメ撮り]]></category>
<category><![CDATA[フェラ]]></category>
<category><![CDATA[ローター]]></category>
<category><![CDATA[女子高生]]></category>
<category><![CDATA[調教]]></category>

<guid isPermaLink="false">http://rakuero-douga.com/?p=6640</guid>
<description><![CDATA[]]></description>
<content:encoded><![CDATA[<div class="kiji-l"><img class="img01" src="http://rakuero-douga.com/wp-content/uploads/2014/07/20ab46020e29eac11be2080c373bb780.jpg" alt="エロ動画" width="200" height="150" /></div>
<p><span id="more-6640"></span>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">
<channel>
<title>FC2アダルト・XVIDEOSまとめ|楽園エロ動画</title>
<atom:link href="http://rakuero-douga.com/feed" rel="self" type="application/rss+xml"/>
<link>http://rakuero-douga.com</link>
<description>FC2アダルトからxvideosなど厳選した無料で見れるエロ動画を楽園エロ動画で更新中。</description>
<lastBuildDate>Sun, 04 Oct 2015 11:02:00 +0000</lastBuildDate>
<language>ja</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>http://wordpress.org/?v=4.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/>
<atom:link rel="hub" href="http://pubsubhubbub.superfeedr.com"/>
<item>
<title>素人巨乳OLにチンコしゃぶらせバックから着衣のままでチンコ挿入してみた結果www</title>
<link>http://rakuero-douga.com/archives/880</link>
<comments>http://rakuero-douga.com/archives/880#comments</comments>
<pubDate>Sun, 04 Oct 2015 11:02:00 +0000</pubDate>
<dc:creator><![CDATA[管理人]]></dc:creator>
<category><![CDATA[エッチ動画総合]]></category>
<category><![CDATA[OL]]></category>
<category><![CDATA[アクメ]]></category>
<category><![CDATA[バック]]></category>
<category><![CDATA[フェラ]]></category>
<category><![CDATA[]]></category>
<category><![CDATA[巨乳]]></category>
<category><![CDATA[素人]]></category>
<category><![CDATA[色白]]></category>
<guid isPermaLink="false">http://rakuero-douga.com/?p=880</guid>
<description><![CDATA[]]></description>
<content:encoded><![CDATA[<div class="kiji-l"><img class="img01" src="http://img100-093.xvideos.com/videos/thumbslll/51/46/eb/5146ebb56f70f233bbaab57fe82fc00e/5146ebb56f70f233bbaab57fe82fc00e.6.jpg" alt="エロ動画" width="200" height="150" /></div>
<p><span id="more-880"></span>
<div class="clear"></div>
<div class="kiji-r"> <iframe src="http://flashservice.xvideos.com/embedframe/5895407" frameborder=0 width=510 height=400 scrolling=no></iframe></div>
<div class="txtarea"></div>
<div class="kiji-r"> <iframe src="http://flashservice.xvideos.com/embedframe/9475093" frameborder=0 width=510 height=400 scrolling=no></iframe></div>
]]></content:encoded>
<wfw:commentRss>http://rakuero-douga.com/archives/6640/feed</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>

</channel>
<wfw:commentRss>http://rakuero-douga.com/archives/880/feed</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
</channel>
</rss>

12 changes: 6 additions & 6 deletions src/Midnight/Crawler/Plugin/Rakuen.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public function getEntryDate ($entry)
**/
public function getEntryTitle ($html)
{
$query = 'div#container div#main div.post div#content div#postheading h1';
$query = 'div.article h1.entry-title';
$title_el = $html->find($query, 0);
if (is_null($title_el)) throw new CrawlerException('タイトルを取得出来ませんでした');

return $title_el->plaintext;
return trim($title_el->plaintext);
}


Expand All @@ -74,13 +74,13 @@ public function getEntryTitle ($html)
**/
public function getEyeCatchUrl ($html)
{
$query = 'div#container div#main div.post div#content div.kiji-l img.img01';
$query = 'div#the-content div.kiji-l img.img01';
$img_el = $html->find($query, 0);

if (is_null($img_el)) throw new CrawlerException('アイキャッチを取得出来ませんでした');
if (!$img_el->hasAttribute('data-lazy-src')) throw new CrawlerException('src属性が見つかりませんでした');
if (!$img_el->hasAttribute('src')) throw new CrawlerException('src属性が見つかりませんでした');

return $img_el->getAttribute('data-lazy-src');
return $img_el->getAttribute('src');
}


Expand All @@ -92,7 +92,7 @@ public function getEyeCatchUrl ($html)
**/
public function getMoviesUrl ($html)
{
$query = 'div#container div#main div.post div#content div.kiji-r iframe';
$query = 'div#the-content div.kiji-r iframe';
$movies_els = $html->find($query);
$movie_data = array();
$manager = new UriManager();
Expand Down
2 changes: 1 addition & 1 deletion src/Midnight/Crawler/Plugin/TestData/RakuenTestData.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class RakuenTestData extends AbstractTestData
* @var array
**/
protected $html_paths = array(
'rakuen/6640.html',
'rakuen/880.html',
'rakuen/error.html',
'rakuen/error2.html'
);
Expand Down
10 changes: 5 additions & 5 deletions tests/Midnight/Crawler/Plugin/RakuenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function エントリのURLを取得する ()
$url = $this->plugin->getEntryUrl($entries->item(0));
$this->assertTrue(is_string($url));
$this->assertEquals('http://rakuero-douga.com/archives/6640', $url);
$this->assertEquals('http://rakuero-douga.com/archives/880', $url);
}


Expand All @@ -110,7 +110,7 @@ public function エントリの日付を取得する ()

$date = $this->plugin->getEntryDate($entries->item(0));
$this->assertTrue(is_string($date));
$this->assertEquals('2014-07-17', $date);
$this->assertEquals('2015-10-04', $date);
}


Expand Down Expand Up @@ -155,7 +155,7 @@ public function エントリのタイトルを取得する ()
$html = $this->plugin->fetchHtml($this->test_data->getHtmlPaths()[0]);
$title = $this->plugin->getEntryTitle($html);

$this->assertEquals('おさげ頭の黒髪少女と父が繰り広げる変態相姦調教セクロスがエロすぎwww', $title);
$this->assertEquals('素人巨乳OLにチンコしゃぶらせバックから着衣のままでチンコ挿入してみた結果www', $title);
}


Expand Down Expand Up @@ -204,7 +204,7 @@ public function アイキャッチ画像のURLを取得する ()
$html = $this->plugin->fetchHtml($this->test_data->getHtmlPaths()[0]);
$img_url = $this->plugin->getEyeCatchUrl($html);

$this->assertEquals('http://rakuero-douga.com/wp-content/uploads/2014/07/20ab46020e29eac11be2080c373bb780.jpg', $img_url);
$this->assertEquals('http://img100-093.xvideos.com/videos/thumbslll/51/46/eb/5146ebb56f70f233bbaab57fe82fc00e/5146ebb56f70f233bbaab57fe82fc00e.6.jpg', $img_url);
}


Expand All @@ -220,6 +220,6 @@ public function 動画へのリンクを取得する ()
$movies_url = $this->plugin->getMoviesUrl($html);

$this->assertTrue(is_array($movies_url));
$this->assertEquals('http://jp.xvideos.com/video5895407/', $movies_url[0]);
$this->assertEquals('http://jp.xvideos.com/video9475093/', $movies_url[0]);
}
}

0 comments on commit f32753c

Please sign in to comment.