]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/commitdiff
Added support for motherless.com.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 24 Nov 2009 02:07:14 +0000 (21:07 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 24 Nov 2009 02:07:14 +0000 (21:07 -0500)
src/websites/motherless.rb [new file with mode: 0644]
test/fixtures/motherless/C1CDA5D.html [new file with mode: 0644]
test/fixtures/motherless/C1D5960.html [new file with mode: 0644]
test/motherless_test.rb [new file with mode: 0644]
test/test_suite.rb

diff --git a/src/websites/motherless.rb b/src/websites/motherless.rb
new file mode 100644 (file)
index 0000000..a5b59b2
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Copyright Michael Orlitzky
+#
+# http://michael.orlitzky.com/
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# http://www.fsf.org/licensing/licenses/gpl.html
+#
+
+require 'src/website'
+
+class Motherless < Website
+
+  VALID_MOTHERLESS_URL_REGEX = /^(http:\/\/)?(www\.)?motherless\.com\/[[:alnum:]]+$/
+
+  def self.owns_url?(url)
+    return url =~ VALID_MOTHERLESS_URL_REGEX
+  end
+
+  def get_video_url()
+    page_data = self.get_page_data(@url)    
+    filepath = parse_video_url(page_data)
+    
+    return filepath
+  end
+
+  
+  protected;
+
+  
+  def parse_video_url(page_data)
+    # If neither of the source formats are present, just grab the
+    # video URL from the Flash variable and be done with it.
+    video_url_regex = /file=(.*?\.flv)&/i
+    matches = video_url_regex.match(page_data)
+
+    if matches.nil?
+      raise StandardError.new("Couldn't parse the video URL from flashvars.")
+    end
+
+    return matches[1]
+  end
+
+end
diff --git a/test/fixtures/motherless/C1CDA5D.html b/test/fixtures/motherless/C1CDA5D.html
new file mode 100644 (file)
index 0000000..5a02704
--- /dev/null
@@ -0,0 +1,276 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+       <head>
+               <title>MOTHERLESS.COM - Moral Free Hosting : stickam stickam gallore </title>
+               <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+               <meta name="distribution" content="Global">
+               <meta name="robots" content="index, follow">
+               <meta name="Googlebot" content="index, follow">
+               <meta name="Identifier-URL" content="http://www.motherless.com/">
+               <meta name="MSSmartTagsPreventParsing" content="TRUE">
+                               <link rel="stylesheet" href="http://motherless.com/styles/screen.css" type="text/css" />
+               <!--[if IE]>
+               <link rel="stylesheet" href="http://motherless.com/styles/screen_ie.css" type="text/css" />
+               <![endif]-->
+                               
+                                               <link rel="stylesheet" href="http://motherless.com/styles/rating.css" type="text/css" />
+                                                               <link rel="stylesheet" href="http://motherless.com/styles/view.css" type="text/css" />
+                                               <script type="text/javascript">
+                       var __site_base_url = 'http://motherless.com/';
+                                       </script>
+                                               <script type="text/javascript" src="http://motherless.com/scripts/swfobject.js"></script>
+                                                               <script type="text/javascript" src="http://motherless.com/scripts/mootools.full.js"></script>
+                                                               <script type="text/javascript" src="http://motherless.com/scripts/tabber.js"></script>
+                                                               <script type="text/javascript" src="http://motherless.com/scripts/base.js"></script>
+                                       </head>
+       <body>
+       <div id="main">
+       <table width="1030px" bgcolor="#231F20" align="center" height="140" border="0" cellspacing="0" cellpadding="0">
+<tr valign="top">
+       <td align="left" class="red_menu">&nbsp;<a href="http://motherless.com/" class="plain">Home</a> &bull; <a href="http://motherless.com/dmca" class="plain">DMCA</a> &bull; <a href="http://motherless.com/contact" class="plain">Contact Us</a></td>
+       <td align="right" class="red_menu" style="padding-right: 5px;">
+                               <a href="http://motherless.com/register" class="red_menu">Join</a>
+               &bull; <a href="http://motherless.com/auth/login?back=http://motherless.com/C1CDA5D" class="red_menu">Login</a>
+                                                               </td>
+       </tr>
+<tr>
+       <td colspan="2"><img src="http://motherless.com/images/gray_menu.gif" height="0" class="dewez" width="100%"></td>
+</tr>
+<tr valign="middle">
+       <td width="380" height="100" align="left"><a href="http://motherless.com/"><img src="http://motherless.com/images/logo8888.gif" width="300" height="100" border="0"></a></td>
+       <td width="650" align="right"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="728" height="90" id="mov" align="middle">\r
+       <param name="allowScriptAccess" value="sameDomain" />\r
+       <param name="allowFullScreen" value="false" />\r
+       <param name="movie" value="http://motherless.com/images/banners/mov.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />        <embed src="http://motherless.com/images/banners/mov.swf" quality="high" bgcolor="#ffffff" width="728" height="90" name="mov" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />\r
+</object></td></td>
+</tr>
+<tr>
+       <td colspan="2" height="40">
+       <table width="100%" height="40" border="0" cellspacing="0" cellpadding="0">
+       <tr>
+               <td width="750" align="left" background="http://motherless.com/images/menu10.gif" height="40" width="100%">
+                       <div>
+                       <a href="http://motherless.com/c/all?t=v&r=today&s=" title="Movies" class="head_link">&nbsp;&nbsp;&nbsp;Videos</a><a href="http://motherless.com/c/all?t=i&r=today&s=" title="Images" class="head_link">Images</a><a href="http://motherless.com/categories" title="Categories" class="head_link">Categories</a><a href="http://motherless.com/galleries" title="Galleries" class="head_link">Galleries</a><a href="http://motherless.com/members" title="Members" class="head_link">Members</a><a href="http://motherless.com/boards" title="Boards" class="head_link">Boards</a><a href="http://motherless.com/upload" title="Upload" class="head_link">Upload</a><a href="http://www.streamate.com/?DF=0&AFNO=1-0-606573-335874&UHNSMTY=303" target="_blank" title="On Demand" class="head_link"><span style="color: #FBFFBE">Live Chat</span></a><a href="http://www.seekbang.com/cs/direct/motherless2.php" target="_blank" title="On Demand" class="head_link"><span style="color: #FBFFBE">Sex Facebook</span></a>
+                       </div>
+               </td>
+               <td width="330" background="http://motherless.com/images/menu10.gif" height="40" width="100%">
+                       <form method="GET" action="http://motherless.com/search">
+                               <table align="right" height="40" border="0" cellspacing="0" cellpadding="0">
+                                       <tr valign="middle">
+                                               <td align="left">
+                                                       <div>
+                                                               <input type="text" name="search" value="" /> <input type="submit" value="Search" />&nbsp;&nbsp;<br />
+                                                       </div>
+                                               </td>
+                                       </tr>
+                               </table>
+                       </form>
+               </td>
+       </tr>
+       </table>
+       </td>
+</tr>
+</table>
+       <table width="1030px" bgcolor="#231F20" align="center" cellpadding="0" cellspacing="0" border="0" class="content_area">
+       <tr valign="top">
+               <td style="padding-top: 10px;">
+                                               
+<table width="100%" align="center" border="0" cellspacing="0" cellpadding="2">
+<tr valign="top">
+       <td>
+       <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
+       <tr>
+               <td style="padding-left: 15px; text-align: center;">
+               
+               <div style="height: 20px; margin-bottom: 10px; padding-top: 5px;background-image: url(http://motherless.com/images/menu10.gif);">
+                                               
+                       <a href="http://motherless.com/random/image" class="head_link" style="font-size: 14px;">Random Image</a>
+                       <a href="http://motherless.com/random/video"class="head_link" style="font-size: 14px;">Random Video</a>
+                       
+                                       </div>
+
+               <div style="clear: left;"></div>
+                                               <div name="mediaspace" id="mediaspace">This page requires JavaScript. It appears you have JavaScript turned off, or your browser does not support it.</div>
+       <script type='text/javascript'>
+               var s1 = new SWFObject('http://motherless.com/flash/player.swf','player','680','560','9');
+               s1.addParam('allowfullscreen','true');
+               s1.addParam('allowscriptaccess','always');
+               s1.addParam('flashvars','file=http://members.motherless.com/movies/C1CDA5D-204266691.flv&image=http://motherless.com/thumbs/C1CDA5D.jpg&mute=false&streamer=lighttpd&link=http://motherless.com/C1CDA5D');
+               s1.addParam("wmode","transparent");
+               s1.addVariable("channel", "10706");
+               s1.addVariable("plugins", "ltas");
+               s1.write("mediaspace");
+       </script>
+       <script language="JavaScript" src="http://www.ltassrv.com/serve/api5.4.asp?d=11415&s=13640&c=10704&v=1"></script>
+ <br><a href="http://www.seekbang.com/cs/direct/motherless.php">Facebook of Sex (18+) - Find a Lady. Email her. Fuck her Tonight!!!</a>
+                                                               <script type="text/javascript">
+       document.write('<style type="text/css">.tabber{display:none;}</style>');
+</script>
+
+<div id="media_options" class="tabber" style="text-align: left;">
+       <!-- Start Info -->
+       <div class="tabbertab">
+               <h2 class="pan_title">Info</h2>
+               <div style="margin-bottom: 5px; padding-left: 2px;">
+                       <table style="width: 100%;">
+                               <tr>
+                                       <td width="100%" style="padding-right: 10px;">
+                                               <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                                                       <tr>
+                                                               <td style="width: 50%">
+                                                                                                                                       <div class="media_meta" style="border: none;">
+                                                                                                                                                               <p class="media_title" style="border-bottom: 1px dotted #fff; margin-bottom: 2px; padding-bottom: 2px;">stickam stickam gallore </p>
+                                                                                                                                                                                                                                                       <p>From: <a href="http://motherless.com/member/mx">mx</a></p>
+                                                                                                                                                               <p>Uploaded: November 23rd, 2009</p>
+                                                                               <p>Views: 480</p>
+                                                                               <p>Favorited: 2</p>
+                                                                               <p>Categories:
+                                                                                                                                                                                       None
+                                                                                                                                                                       </p>
+                                                                               <p>Tags:
+                                                                                               None
+                                                                               </p>
+                                                                       </td>
+                                                                       <td>
+                                                                               <p style="margin-top: 10px; margin-bottom: 4px;">
+                                                                                       <label for="link" style="width: 80px; display: block; float: left;">Link: </label>
+                                                                                       <input type="text" size="25" id="link" name="link" onclick="javascript:this.focus();this.select();" readonly="readonly" value="http://motherless.com/C1CDA5D">
+                                                                               </p>
+                                                                               <p style="margin-bottom: 4px;">
+                                                                                                                                                                                       <label for="tags" style="width: 80px; display: block; float: left;">Icon: </label>
+                                                                                               <input type="text" size="25" id="tags" name="tags" onclick="javascript:this.focus();this.select();" readonly="readonly" value="&lt;a href=&quot;http://motherless.com/C1CDA5D&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://motherless.com/thumbs/C1CDA5D.gif&quot;&gt;&lt;/a&gt;" />
+                                                                                                                                                                       </p>
+                                                                               <p>
+                                                                                                                                                                               <label for="bbc" style="width: 80px; display: block; float: left;">BBCode: </label>
+                                                                                       <input type="text" size="25" id="bbc" name="bbc" onclick="javascript:this.focus();this.select();" readonly="readonly" value="[URL=http://motherless.com/C1CDA5D][IMG]http://motherless.com/thumbs/C1CDA5D.gif[/IMG][/URL]">
+                                                                               </p>
+                                                                       </div>
+                                                                                                                       </td>
+                                               </tr>
+                                       </table>
+                               </tr>
+                       </table>
+               </div>
+       </div>
+       <!-- End Info -->
+
+       <!-- Start Referrers -->
+       <div class="tabbertab">
+               <h2 class="pane_title">Top Referrers</h2>
+               <div style="margin-bottom: 5px; padding-left: 2px;">
+                                                       No referrers
+                                       </div>
+       </div>
+       <!-- End Referrers -->
+       
+       <!-- Start Rate -->
+       <div class="tabbertab">
+               <h2 class="pane_title">Favorite/Rate</h2>
+               <div style="margin-bottom: 5px; padding-left: 2px;">
+                       <div style="float: left; padding-top: 4px; padding-right: 5px;font-weight: bold;">Rate: </div> <ul class='star-rating'>
+                               <li id="current_rating" class='current-rating' style='width:0px;'>Currently 3.5/5 Stars.</li>
+                               <li><a href='#' onclick="dispatch('1', 'view', 'rate', '', '7e98796008f8e49391369d7c94cc1c07', 'C1CDA5D'); document.getElementById('current_rating').style.width = '25px'; return false;" title='1 star out of 5' class='one-star'>1</a></li>
+                               <li><a href='#' onclick="dispatch('2', 'view', 'rate', '', '7e98796008f8e49391369d7c94cc1c07', 'C1CDA5D'); document.getElementById('current_rating').style.width = '50px'; return false;" title='2 stars out of 5' class='two-stars'>2</a></li>
+                               <li><a href='#' onclick="dispatch('3', 'view', 'rate', '', '7e98796008f8e49391369d7c94cc1c07', 'C1CDA5D'); document.getElementById('current_rating').style.width = '75px'; return false;" title='3 stars out of 5' class='three-stars'>3</a></li>
+                               <li><a href='#' onclick="dispatch('4', 'view', 'rate', '', '7e98796008f8e49391369d7c94cc1c07', 'C1CDA5D'); document.getElementById('current_rating').style.width = '100px'; return false;" title='4 stars out of 5' class='four-stars'>4</a></li>
+                               <li><a href='#' onclick="dispatch('5', 'view', 'rate', '', '7e98796008f8e49391369d7c94cc1c07', 'C1CDA5D'); document.getElementById('current_rating').style.width = '125px'; return false;" title='5 stars out of 5' class='five-stars'>5</a></li>
+                       </ul>
+               </div>
+               
+                       </div>
+       <!-- End Rate -->
+       
+       <!-- Start Share -->
+       <div class="tabbertab">
+               <h3 class="pane_title">Share</h3>
+               <form method="post" action="http://motherless.com/view/share?codename=C1CDA5D&back=http://motherless.com/C1CDA5D&t=ac97a744af419b2dbe07b0af190df27a">
+                       Send to Friend (Enter email address): <input type="text" name="recipient" style="width: 200px;" /> <input type="submit" name="submit" value="Send" />
+               </form>
+               <div style="margin-top: 10px;">
+                       <a href="http://delicious.com/save?url=http%3A%2F%2Fmotherless.com%2FC1CDA5D" onclick="click('delivious')" target="_blank"><img src="http://motherless.com/images/view/tt-delicious-micro4.png" style="border: none;" target="_blank" /></a>
+                       <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fmotherless.com%2FC1CDA5D" onclick="click('stumbleupon')" target="_blank"><img src="http://motherless.com/images/view/tt-su-micro4.png" style="border: none;" target="_blank"/></a>
+                       <a href="http://twitter.com/home?status=Looking+at+http%3A%2F%2Fmotherless.com%2FC1CDA5D" onclick="click('twitter')" target="_blank"><img src="http://motherless.com/images/view/tt-twitter-micro4.png" style="border: none;" target="_blank" /></a>
+                       <a href="http://reddit.com/r/nsfw/submit?url=http%3A%2F%2Fmotherless.com%2FC1CDA5D&title=stickam stickam gallore " onclick="click('reddit')" target="_blank"><img src="http://motherless.com/images/view/tt-reddit-micro4.png" style="border: none;" target="_blank" /></a>
+               </div>
+       </div>
+       <!-- End Share -->
+       
+       <!-- Start Report -->
+       <div class="tabbertab">
+               <h3 class="pane_title">Report</h3>
+               <form method="post" action="http://motherless.com/view/report?codename=C1CDA5D&back=http://motherless.com/C1CDA5D&t=999821ac3e1270a0d86140e74255ee52">
+                       <label for="report_type_tos"><input type="radio" name="reason" id="report_type_tos" value="offensive" /> It violates the site Terms of Service</label><br />
+                       <label for="report_type_copyright"><input type="radio" name="reason" id="report_type_copyright" value="copyright" /> It violates a copyright</label><br />
+                       <input type="submit" name="submit" value="Send Report" style="margin-top: 5px;" />
+               </form>
+       </div>
+       <!-- End Report -->
+       
+       <!-- Start Galleries -->
+       <div class="tabbertab">
+               <h3 class="pane_title">Add to Gallery</h3>
+                                       You must be <a href="http://motherless.com/auth/login">logged in</a> to add this media to a gallery.
+                       </div>
+       <!-- End Galleries -->
+</div>
+<script type="text/javascript">
+       tabberAutomatic(tabberOptions);
+</script>                              </td>
+       </tr>
+       </table>
+       </td>
+</tr>
+
+</table>
+               </td>
+               
+               <td width="300px" style="padding-top: 10px; padding-left: 2px; padding-right: 4px;">
+               <table width="300" cellpadding="0" cellspacing="0" border="0">
+               <tr>
+                       <td colspan="2"><IFRAME NAME="Frame1" SRC="http://www.sixsigmatraffic.com/cs/iframe147.html" width=300 height=250 scrolling=no marginwidth=0 marginheight=0 frameborder=0 allowTransparency=true></IFRAME></td>
+               </tr>
+               <tr>
+                       <td width="135">
+                       <!-- BEGIN ero-advertising AD SPACE CODE -->
+<script type="text/javascript" language="javascript" charset="utf-8" src="http://adspaces.ero-advertising.com/adspace/15184.js"></script>
+<!-- END ero-advertising AD SPACE CODE -->
+                       </td>
+                       <td width="165"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="160" height="600" id="160x600-2" align="middle">
+       <param name="allowScriptAccess" value="sameDomain" />
+       <param name="allowFullScreen" value="false" />
+       <param name="movie" value="http://motherless.com/images/banners/160x600-2.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />  <embed src="http://motherless.com/images/banners/160x600-2.swf" quality="high" bgcolor="#ffffff" width="160" height="600" name="160x600-2" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
+</object></td>
+               </tr>
+               </table>
+               </td>
+       </tr>
+       </table>
+       <table width="1030px" bgcolor="#231F20" align="center" border="0" cellspacing="0" cellpadding="0">
+<tr>
+       <td colspan="2"><img src="http://motherless.com/images/menu11.jpg" width="100%" height="21" border="0"></td>
+</tr>
+<tr>
+       <td valign="top" align="center" style="padding-left: 90px;">
+               <a href="http://motherless.com/contact" class="plain">Contact Us</a> &bull;
+               <a href="http://motherless.com/tos" class="plain">Terms of Service</a> &bull;
+               <a href="http://motherless.com/about" class="plain">About Us</a> &bull;
+               <a href="http://motherless.com/faq" class="plain">FAQ</a>
+       </td>
+       <td align="right" style="width: 90px;"><img src="http://motherless.com/images/bottom3.gif" border="0"></td>
+</tr>
+</table>
+</div> <script type="text/javascript">
+       var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+       document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+       </script>
+       <script type="text/javascript">
+       var pageTracker = _gat._getTracker("UA-2427169-5");
+       pageTracker._trackPageview();
+       </script>
+<script type="text/javascript">
+applyToAnchors();
+</script>
+<script type="text/javascript" src="http://motherless.com/scripts/livejasmin.js"></script>
+</body>
+</html>
\ No newline at end of file
diff --git a/test/fixtures/motherless/C1D5960.html b/test/fixtures/motherless/C1D5960.html
new file mode 100644 (file)
index 0000000..36e91d9
--- /dev/null
@@ -0,0 +1,276 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+       <head>
+               <title>MOTHERLESS.COM - Moral Free Hosting : stickam stickam gallore </title>
+               <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+               <meta name="distribution" content="Global">
+               <meta name="robots" content="index, follow">
+               <meta name="Googlebot" content="index, follow">
+               <meta name="Identifier-URL" content="http://www.motherless.com/">
+               <meta name="MSSmartTagsPreventParsing" content="TRUE">
+                               <link rel="stylesheet" href="http://motherless.com/styles/screen.css" type="text/css" />
+               <!--[if IE]>
+               <link rel="stylesheet" href="http://motherless.com/styles/screen_ie.css" type="text/css" />
+               <![endif]-->
+                               
+                                               <link rel="stylesheet" href="http://motherless.com/styles/rating.css" type="text/css" />
+                                                               <link rel="stylesheet" href="http://motherless.com/styles/view.css" type="text/css" />
+                                               <script type="text/javascript">
+                       var __site_base_url = 'http://motherless.com/';
+                                       </script>
+                                               <script type="text/javascript" src="http://motherless.com/scripts/swfobject.js"></script>
+                                                               <script type="text/javascript" src="http://motherless.com/scripts/mootools.full.js"></script>
+                                                               <script type="text/javascript" src="http://motherless.com/scripts/tabber.js"></script>
+                                                               <script type="text/javascript" src="http://motherless.com/scripts/base.js"></script>
+                                       </head>
+       <body>
+       <div id="main">
+       <table width="1030px" bgcolor="#231F20" align="center" height="140" border="0" cellspacing="0" cellpadding="0">
+<tr valign="top">
+       <td align="left" class="red_menu">&nbsp;<a href="http://motherless.com/" class="plain">Home</a> &bull; <a href="http://motherless.com/dmca" class="plain">DMCA</a> &bull; <a href="http://motherless.com/contact" class="plain">Contact Us</a></td>
+       <td align="right" class="red_menu" style="padding-right: 5px;">
+                               <a href="http://motherless.com/register" class="red_menu">Join</a>
+               &bull; <a href="http://motherless.com/auth/login?back=http://motherless.com/C1D5960" class="red_menu">Login</a>
+                                                               </td>
+       </tr>
+<tr>
+       <td colspan="2"><img src="http://motherless.com/images/gray_menu.gif" height="0" class="dewez" width="100%"></td>
+</tr>
+<tr valign="middle">
+       <td width="380" height="100" align="left"><a href="http://motherless.com/"><img src="http://motherless.com/images/logo8888.gif" width="300" height="100" border="0"></a></td>
+       <td width="650" align="right"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="728" height="90" id="mov" align="middle">\r
+       <param name="allowScriptAccess" value="sameDomain" />\r
+       <param name="allowFullScreen" value="false" />\r
+       <param name="movie" value="http://motherless.com/images/banners/mov.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />        <embed src="http://motherless.com/images/banners/mov.swf" quality="high" bgcolor="#ffffff" width="728" height="90" name="mov" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />\r
+</object></td></td>
+</tr>
+<tr>
+       <td colspan="2" height="40">
+       <table width="100%" height="40" border="0" cellspacing="0" cellpadding="0">
+       <tr>
+               <td width="750" align="left" background="http://motherless.com/images/menu10.gif" height="40" width="100%">
+                       <div>
+                       <a href="http://motherless.com/c/all?t=v&r=today&s=" title="Movies" class="head_link">&nbsp;&nbsp;&nbsp;Videos</a><a href="http://motherless.com/c/all?t=i&r=today&s=" title="Images" class="head_link">Images</a><a href="http://motherless.com/categories" title="Categories" class="head_link">Categories</a><a href="http://motherless.com/galleries" title="Galleries" class="head_link">Galleries</a><a href="http://motherless.com/members" title="Members" class="head_link">Members</a><a href="http://motherless.com/boards" title="Boards" class="head_link">Boards</a><a href="http://motherless.com/upload" title="Upload" class="head_link">Upload</a><a href="http://www.streamate.com/?DF=0&AFNO=1-0-606573-335874&UHNSMTY=303" target="_blank" title="On Demand" class="head_link"><span style="color: #FBFFBE">Live Chat</span></a><a href="http://www.seekbang.com/cs/direct/motherless2.php" target="_blank" title="On Demand" class="head_link"><span style="color: #FBFFBE">Sex Facebook</span></a>
+                       </div>
+               </td>
+               <td width="330" background="http://motherless.com/images/menu10.gif" height="40" width="100%">
+                       <form method="GET" action="http://motherless.com/search">
+                               <table align="right" height="40" border="0" cellspacing="0" cellpadding="0">
+                                       <tr valign="middle">
+                                               <td align="left">
+                                                       <div>
+                                                               <input type="text" name="search" value="" /> <input type="submit" value="Search" />&nbsp;&nbsp;<br />
+                                                       </div>
+                                               </td>
+                                       </tr>
+                               </table>
+                       </form>
+               </td>
+       </tr>
+       </table>
+       </td>
+</tr>
+</table>
+       <table width="1030px" bgcolor="#231F20" align="center" cellpadding="0" cellspacing="0" border="0" class="content_area">
+       <tr valign="top">
+               <td style="padding-top: 10px;">
+                                               
+<table width="100%" align="center" border="0" cellspacing="0" cellpadding="2">
+<tr valign="top">
+       <td>
+       <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
+       <tr>
+               <td style="padding-left: 15px; text-align: center;">
+               
+               <div style="height: 20px; margin-bottom: 10px; padding-top: 5px;background-image: url(http://motherless.com/images/menu10.gif);">
+                                               
+                       <a href="http://motherless.com/random/image" class="head_link" style="font-size: 14px;">Random Image</a>
+                       <a href="http://motherless.com/random/video"class="head_link" style="font-size: 14px;">Random Video</a>
+                       
+                                       </div>
+
+               <div style="clear: left;"></div>
+                                               <div name="mediaspace" id="mediaspace">This page requires JavaScript. It appears you have JavaScript turned off, or your browser does not support it.</div>
+       <script type='text/javascript'>
+               var s1 = new SWFObject('http://motherless.com/flash/player.swf','player','680','560','9');
+               s1.addParam('allowfullscreen','true');
+               s1.addParam('allowscriptaccess','always');
+               s1.addParam('flashvars','file=http://members.motherless.com/movies/C1D5960-204299206.flv&image=http://motherless.com/thumbs/C1D5960.jpg&mute=false&streamer=lighttpd&link=http://motherless.com/C1D5960');
+               s1.addParam("wmode","transparent");
+               s1.addVariable("channel", "10706");
+               s1.addVariable("plugins", "ltas");
+               s1.write("mediaspace");
+       </script>
+       <script language="JavaScript" src="http://www.ltassrv.com/serve/api5.4.asp?d=11415&s=13640&c=10704&v=1"></script>
+ <br><a href="http://www.seekbang.com/cs/direct/motherless.php">Facebook of Sex (18+) - Find a Lady. Email her. Fuck her Tonight!!!</a>
+                                                               <script type="text/javascript">
+       document.write('<style type="text/css">.tabber{display:none;}</style>');
+</script>
+
+<div id="media_options" class="tabber" style="text-align: left;">
+       <!-- Start Info -->
+       <div class="tabbertab">
+               <h2 class="pan_title">Info</h2>
+               <div style="margin-bottom: 5px; padding-left: 2px;">
+                       <table style="width: 100%;">
+                               <tr>
+                                       <td width="100%" style="padding-right: 10px;">
+                                               <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                                                       <tr>
+                                                               <td style="width: 50%">
+                                                                                                                                       <div class="media_meta" style="border: none;">
+                                                                                                                                                               <p class="media_title" style="border-bottom: 1px dotted #fff; margin-bottom: 2px; padding-bottom: 2px;">stickam stickam gallore </p>
+                                                                                                                                                                                                                                                       <p>From: <a href="http://motherless.com/member/mx">mx</a></p>
+                                                                                                                                                               <p>Uploaded: November 23rd, 2009</p>
+                                                                               <p>Views: 361</p>
+                                                                               <p>Favorited: 1</p>
+                                                                               <p>Categories:
+                                                                                                                                                                                       None
+                                                                                                                                                                       </p>
+                                                                               <p>Tags:
+                                                                                               None
+                                                                               </p>
+                                                                       </td>
+                                                                       <td>
+                                                                               <p style="margin-top: 10px; margin-bottom: 4px;">
+                                                                                       <label for="link" style="width: 80px; display: block; float: left;">Link: </label>
+                                                                                       <input type="text" size="25" id="link" name="link" onclick="javascript:this.focus();this.select();" readonly="readonly" value="http://motherless.com/C1D5960">
+                                                                               </p>
+                                                                               <p style="margin-bottom: 4px;">
+                                                                                                                                                                                       <label for="tags" style="width: 80px; display: block; float: left;">Icon: </label>
+                                                                                               <input type="text" size="25" id="tags" name="tags" onclick="javascript:this.focus();this.select();" readonly="readonly" value="&lt;a href=&quot;http://motherless.com/C1D5960&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://motherless.com/thumbs/C1D5960.gif&quot;&gt;&lt;/a&gt;" />
+                                                                                                                                                                       </p>
+                                                                               <p>
+                                                                                                                                                                               <label for="bbc" style="width: 80px; display: block; float: left;">BBCode: </label>
+                                                                                       <input type="text" size="25" id="bbc" name="bbc" onclick="javascript:this.focus();this.select();" readonly="readonly" value="[URL=http://motherless.com/C1D5960][IMG]http://motherless.com/thumbs/C1D5960.gif[/IMG][/URL]">
+                                                                               </p>
+                                                                       </div>
+                                                                                                                       </td>
+                                               </tr>
+                                       </table>
+                               </tr>
+                       </table>
+               </div>
+       </div>
+       <!-- End Info -->
+
+       <!-- Start Referrers -->
+       <div class="tabbertab">
+               <h2 class="pane_title">Top Referrers</h2>
+               <div style="margin-bottom: 5px; padding-left: 2px;">
+                                                       No referrers
+                                       </div>
+       </div>
+       <!-- End Referrers -->
+       
+       <!-- Start Rate -->
+       <div class="tabbertab">
+               <h2 class="pane_title">Favorite/Rate</h2>
+               <div style="margin-bottom: 5px; padding-left: 2px;">
+                       <div style="float: left; padding-top: 4px; padding-right: 5px;font-weight: bold;">Rate: </div> <ul class='star-rating'>
+                               <li id="current_rating" class='current-rating' style='width:0px;'>Currently 3.5/5 Stars.</li>
+                               <li><a href='#' onclick="dispatch('1', 'view', 'rate', '', 'cc34c5610c0bc89864c9171db484e59d', 'C1D5960'); document.getElementById('current_rating').style.width = '25px'; return false;" title='1 star out of 5' class='one-star'>1</a></li>
+                               <li><a href='#' onclick="dispatch('2', 'view', 'rate', '', 'cc34c5610c0bc89864c9171db484e59d', 'C1D5960'); document.getElementById('current_rating').style.width = '50px'; return false;" title='2 stars out of 5' class='two-stars'>2</a></li>
+                               <li><a href='#' onclick="dispatch('3', 'view', 'rate', '', 'cc34c5610c0bc89864c9171db484e59d', 'C1D5960'); document.getElementById('current_rating').style.width = '75px'; return false;" title='3 stars out of 5' class='three-stars'>3</a></li>
+                               <li><a href='#' onclick="dispatch('4', 'view', 'rate', '', 'cc34c5610c0bc89864c9171db484e59d', 'C1D5960'); document.getElementById('current_rating').style.width = '100px'; return false;" title='4 stars out of 5' class='four-stars'>4</a></li>
+                               <li><a href='#' onclick="dispatch('5', 'view', 'rate', '', 'cc34c5610c0bc89864c9171db484e59d', 'C1D5960'); document.getElementById('current_rating').style.width = '125px'; return false;" title='5 stars out of 5' class='five-stars'>5</a></li>
+                       </ul>
+               </div>
+               
+                       </div>
+       <!-- End Rate -->
+       
+       <!-- Start Share -->
+       <div class="tabbertab">
+               <h3 class="pane_title">Share</h3>
+               <form method="post" action="http://motherless.com/view/share?codename=C1D5960&back=http://motherless.com/C1D5960&t=0105e5919e97a9bc49c1ecf1e7ef85c7">
+                       Send to Friend (Enter email address): <input type="text" name="recipient" style="width: 200px;" /> <input type="submit" name="submit" value="Send" />
+               </form>
+               <div style="margin-top: 10px;">
+                       <a href="http://delicious.com/save?url=http%3A%2F%2Fmotherless.com%2FC1D5960" onclick="click('delivious')" target="_blank"><img src="http://motherless.com/images/view/tt-delicious-micro4.png" style="border: none;" target="_blank" /></a>
+                       <a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fmotherless.com%2FC1D5960" onclick="click('stumbleupon')" target="_blank"><img src="http://motherless.com/images/view/tt-su-micro4.png" style="border: none;" target="_blank"/></a>
+                       <a href="http://twitter.com/home?status=Looking+at+http%3A%2F%2Fmotherless.com%2FC1D5960" onclick="click('twitter')" target="_blank"><img src="http://motherless.com/images/view/tt-twitter-micro4.png" style="border: none;" target="_blank" /></a>
+                       <a href="http://reddit.com/r/nsfw/submit?url=http%3A%2F%2Fmotherless.com%2FC1D5960&title=stickam stickam gallore " onclick="click('reddit')" target="_blank"><img src="http://motherless.com/images/view/tt-reddit-micro4.png" style="border: none;" target="_blank" /></a>
+               </div>
+       </div>
+       <!-- End Share -->
+       
+       <!-- Start Report -->
+       <div class="tabbertab">
+               <h3 class="pane_title">Report</h3>
+               <form method="post" action="http://motherless.com/view/report?codename=C1D5960&back=http://motherless.com/C1D5960&t=eebc6aeae59aa3c5f50d016c6d24d111">
+                       <label for="report_type_tos"><input type="radio" name="reason" id="report_type_tos" value="offensive" /> It violates the site Terms of Service</label><br />
+                       <label for="report_type_copyright"><input type="radio" name="reason" id="report_type_copyright" value="copyright" /> It violates a copyright</label><br />
+                       <input type="submit" name="submit" value="Send Report" style="margin-top: 5px;" />
+               </form>
+       </div>
+       <!-- End Report -->
+       
+       <!-- Start Galleries -->
+       <div class="tabbertab">
+               <h3 class="pane_title">Add to Gallery</h3>
+                                       You must be <a href="http://motherless.com/auth/login">logged in</a> to add this media to a gallery.
+                       </div>
+       <!-- End Galleries -->
+</div>
+<script type="text/javascript">
+       tabberAutomatic(tabberOptions);
+</script>                              </td>
+       </tr>
+       </table>
+       </td>
+</tr>
+
+</table>
+               </td>
+               
+               <td width="300px" style="padding-top: 10px; padding-left: 2px; padding-right: 4px;">
+               <table width="300" cellpadding="0" cellspacing="0" border="0">
+               <tr>
+                       <td colspan="2"><IFRAME NAME="Frame1" SRC="http://www.sixsigmatraffic.com/cs/iframe147.html" width=300 height=250 scrolling=no marginwidth=0 marginheight=0 frameborder=0 allowTransparency=true></IFRAME></td>
+               </tr>
+               <tr>
+                       <td width="135">
+                       <!-- BEGIN ero-advertising AD SPACE CODE -->
+<script type="text/javascript" language="javascript" charset="utf-8" src="http://adspaces.ero-advertising.com/adspace/15184.js"></script>
+<!-- END ero-advertising AD SPACE CODE -->
+                       </td>
+                       <td width="165"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="160" height="600" id="160x600-2" align="middle">
+       <param name="allowScriptAccess" value="sameDomain" />
+       <param name="allowFullScreen" value="false" />
+       <param name="movie" value="http://motherless.com/images/banners/160x600-2.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />  <embed src="http://motherless.com/images/banners/160x600-2.swf" quality="high" bgcolor="#ffffff" width="160" height="600" name="160x600-2" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
+</object></td>
+               </tr>
+               </table>
+               </td>
+       </tr>
+       </table>
+       <table width="1030px" bgcolor="#231F20" align="center" border="0" cellspacing="0" cellpadding="0">
+<tr>
+       <td colspan="2"><img src="http://motherless.com/images/menu11.jpg" width="100%" height="21" border="0"></td>
+</tr>
+<tr>
+       <td valign="top" align="center" style="padding-left: 90px;">
+               <a href="http://motherless.com/contact" class="plain">Contact Us</a> &bull;
+               <a href="http://motherless.com/tos" class="plain">Terms of Service</a> &bull;
+               <a href="http://motherless.com/about" class="plain">About Us</a> &bull;
+               <a href="http://motherless.com/faq" class="plain">FAQ</a>
+       </td>
+       <td align="right" style="width: 90px;"><img src="http://motherless.com/images/bottom3.gif" border="0"></td>
+</tr>
+</table>
+</div> <script type="text/javascript">
+       var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+       document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+       </script>
+       <script type="text/javascript">
+       var pageTracker = _gat._getTracker("UA-2427169-5");
+       pageTracker._trackPageview();
+       </script>
+<script type="text/javascript">
+applyToAnchors();
+</script>
+<script type="text/javascript" src="http://motherless.com/scripts/livejasmin.js"></script>
+</body>
+</html>
\ No newline at end of file
diff --git a/test/motherless_test.rb b/test/motherless_test.rb
new file mode 100644 (file)
index 0000000..3b89ef0
--- /dev/null
@@ -0,0 +1,76 @@
+#
+# Copyright Michael Orlitzky
+#
+# http://michael.orlitzky.com/
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# http://www.fsf.org/licensing/licenses/gpl.html
+#
+
+require 'test/unit'
+require 'src/websites/motherless'
+
+class MotherlessTest < Test::Unit::TestCase
+
+  def test_owns_motherless_urls    
+    assert(Motherless.owns_url?('http://motherless.com/C1D5A7A'))
+    assert(Motherless.owns_url?('http://www.motherless.com/C1D5960'))
+  end
+
+  
+  def test_doesnt_own_redtube_urls
+    assert(!Motherless.owns_url?('http://www.redtube.com/6807'))
+    assert(!Motherless.owns_url?('www.redtube.com/6807'))
+    assert(!Motherless.owns_url?('http://redtube.com/6807'))
+    assert(!Motherless.owns_url?('redtube.com/6807'))
+  end
+
+
+  def test_doesnt_own_howcast_urls
+    assert(!Motherless.owns_url?('http://www.howcast.com/videos/6807-2twr'))
+    assert(!Motherless.owns_url?('www.howcast.com/videos/6807-2dgfdg'))
+    assert(!Motherless.owns_url?('http://howcast.com/videos/6807-cse'))
+    assert(!Motherless.owns_url?('howcast.com/videos/6807-asdgasd'))
+  end
+
+  
+  def test_doesnt_own_misc_urls
+    assert(!Motherless.owns_url?('http://www.bliptv.com/123456'))
+  end
+
+
+  def test_parse_video_url
+    ml = Motherless.new(nil)
+
+    page_data = nil
+
+    # First Fixture
+    
+    File.open('test/fixtures/motherless/C1D5960.html') do |f|
+      page_data = f.read
+    end
+
+    test_result = ml.send('parse_video_url', page_data)
+    assert_equal('http://members.motherless.com/movies/C1D5960-204299206.flv', test_result)
+
+    
+    # Second Fixture
+    
+    File.open('test/fixtures/motherless/C1CDA5D.html') do |f|
+      page_data = f.read
+    end
+
+    test_result = ml.send('parse_video_url', page_data)
+    assert_equal('http://members.motherless.com/movies/C1CDA5D-204266691.flv', test_result)    
+  end
+
+end
index d5d42c4fbc600a7ad162dcb17b2f547f9b679cc4..2c60e68bcf955dea34faf1da5a35942ca21be175 100644 (file)
@@ -22,6 +22,7 @@ require 'test/fuckedtube_test'
 require 'test/howcast_test'
 require 'test/infoq_test'
 require 'test/megaporn_test'
+require 'test/motherless_test'
 require 'test/redtube_test'
 require 'test/tnaflix_test'
 require 'test/uri_utilities_test'