Remove custom Douban onebox.

Remove custom Douban onebox.

Now that Douban supports OpenGraph tags, no need to carry custom onebox.

diff --git a/lib/onebox/engine.rb b/lib/onebox/engine.rb
index 87d9cb0..4260664 100644
--- a/lib/onebox/engine.rb
+++ b/lib/onebox/engine.rb
@@ -141,7 +141,6 @@ require_relative "engine/wikimedia_onebox"
 require_relative "engine/wikipedia_onebox"
 require_relative "engine/youtube_onebox"
 require_relative "engine/youku_onebox"
-require_relative "engine/douban_onebox"
 require_relative "engine/whitelisted_generic_onebox"
 require_relative "engine/pubmed_onebox"
 require_relative "engine/soundcloud_onebox"
diff --git a/lib/onebox/engine/douban_onebox.rb b/lib/onebox/engine/douban_onebox.rb
deleted file mode 100644
index ff83157..0000000
--- a/lib/onebox/engine/douban_onebox.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-module Onebox
-  module Engine
-    class DoubanOnebox
-      include Engine
-      include LayoutSupport
-      include HTML
-
-      matches_regexp(/^(https?:\/\/)?([\da-z\.-]+)(douban.com\/)(.)+\/?$/)
-
-      private
-
-      def data
-        {
-          link: link,
-          title: raw.css('title').text.gsub("\n", '').strip(),
-          image: raw.css('img[rel*="v:"]').first['src'],
-          description: raw.css('meta[name=description]').first['content'],
-        }
-      end
-
-    end
-  end
-end
diff --git a/spec/fixtures/douban.response b/spec/fixtures/douban.response
deleted file mode 100644
index c664340..0000000
--- a/spec/fixtures/douban.response
+++ /dev/null
@@ -1,4399 +0,0 @@
-
-<!DOCTYPE html>
-<html lang="zh-CN" class="ua-linux ua-webkit">
-<head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <meta name="renderer" content="webkit">
-
-    <title>
-        那个荡气回肠的长镜头 (巴黎最后的探戈 影评)
-</title>
-    
-    <meta name="baidu-site-verification" content="cZdR4xxR7RxmM4zE" />
-    <meta http-equiv="Pragma" content="no-cache">
-    <meta http-equiv="Expires" content="Sun, 6 Mar 2005 01:00:00 GMT">
-    
-    <meta name="keywords" content="巴黎最后的探戈,Ultimo tango a Parigi,影评,评论,观后感"/>
-    <meta name="description" content="那个荡气回肠的长镜头" />
-    <meta http-equiv="mobile-agent" content="format=xhtml; url=http://m.douban.com/movie/review/1503949/">
-
-    
-
-
-    <link rel="apple-touch-icon" href="/pics/movie/apple-touch-icon.png">
-    <link href="http://img3.douban.com/f/shire/b744ecd0276b46482458cb4ecaee3f256902adec/css/douban.css" rel="stylesheet" type="text/css">
-    <link href="http://img3.douban.com/f/shire/5e59c6681e44822c17b55707cb614022306358b7/css/separation/_all.css" rel="stylesheet" type="text/css">
-    <script type="text/javascript">var _head_start = new Date();</script>
-    <script type="text/javascript" src="http://img3.douban.com/f/movie/e9d9543ebc06f2964039a2e94898f84ce77fc070/js/movie/lib/jquery.js"></script>
-    <script type="text/javascript" src="http://img3.douban.com/f/shire/6072cbd9e3d56db50f819890f57164950110117c/js/douban.js"></script>
-    <script type="text/javascript" src="http://img3.douban.com/f/shire/edd963ebd2d664b02e07affb6d4db29ac3e41a73/js/separation/_all.js"></script>
-    
-    <link rel="stylesheet" href="http://img3.douban.com/f/shire/2cb8fe14fd07fe013a35161f881a77f3acf9ef14/css/core/stars.css" />
-    <link rel="stylesheet" href="http://img3.douban.com/f/movie/e5b290596e3a40a62e27fa7d4707039a074772ce/css/movie/review.css" />
-    <link rel="alternate" href="android-app://com.douban.movie/doubanmovie/review/1503949/" />
-    <script type="text/javascript" src="http://img3.douban.com/f/shire/61dea57acc38f6e00cc187be26176dc7636ee099/js/do.js" data-cfg-autoload="false"></script>
-
-    <style type="text/css"></style>
-    <script type="text/javascript"></script>
-    <link rel="stylesheet" href="http://img3.douban.com/misc/mixed_static/76dea6bb0aff2c3a.css">
-
-    <link rel="shortcut icon" href="http://img3.douban.com/favicon.ico" type="image/x-icon">
-</head>
-
-<body>
-  
-    <script type="text/javascript">var _body_start = new Date();</script>
-
-    
-
-    
-   
-
-
-
-
-
-
-
-<div id="db-global-nav" class="global-nav">
-  <div class="bd">
-    
-
-
-
-
-
-
-<div class="top-nav-info">
-    
-
-    <span class="perf-metric"><!-- _performtips_ --></span>
-    <ul>
-       
-       <li><a id="top-nav-doumail-link" href="http://www.douban.com/doumail/">豆邮</a></li>
-       <li class="nav-user-account">
-       <a target="_blank" href="http://www.douban.com/accounts/" class="bn-more"><span>电车之狼的帐号</span><span class="arrow"></span></a>
-       <div class="more-items">
-      <table cellpadding="0" cellspacing="0">
-            <tr><td><a href="http://www.douban.com/mine/">我的豆瓣</a></td></tr>
-            <tr><td><a target="_blank" href="http://www.douban.com/accounts/">我的帐号</a></td></tr>
-            <tr><td><a href="http://www.douban.com/accounts/logout?source=movie&amp;ck=vXNk">退出</a></td></tr>
-         </table>
-       </div>
-
-       </li>
-     </ul>
-</div>
-
-
-    <div class="top-nav-reminder" >
-        <a href="http://www.douban.com/notification/" class="lnk-remind">提醒
-        </a>
-    <div id="top-nav-notimenu" class="more-items">
-      <div class="bd">
-          <p>加载中...</p>
-      </div>
-    </div>
-    </div>
-    
-
-    <div class="global-nav-items">
-      <ul>
-          
-            
-            <li>
-            <a href="http://www.douban.com/" target="_blank" data-moreurl-dict="{&#34;from&#34;:&#34;top-nav-click-main&#34;,&#34;uid&#34;:&#34;47995876&#34;}">豆瓣</a>
-            </li>
-          
-            
-            <li>
-            <a href="http://book.douban.com/" target="_blank" data-moreurl-dict="{&#34;from&#34;:&#34;top-nav-click-book&#34;,&#34;uid&#34;:&#34;47995876&#34;}">读书</a>
-            </li>
-          
-            
-            <li class="on">
-            <a href="http://movie.douban.com/" data-moreurl-dict="{&#34;from&#34;:&#34;top-nav-click-movie&#34;,&#34;uid&#34;:&#34;47995876&#34;}">电影</a>
-            </li>
-          
-            
-            <li>
-            <a href="http://music.douban.com/" target="_blank" data-moreurl-dict="{&#34;from&#34;:&#34;top-nav-click-music&#34;,&#34;uid&#34;:&#34;47995876&#34;}">音乐</a>
-            </li>
-          
-            
-            <li>
-            <a href="http://www.douban.com/location/" target="_blank" data-moreurl-dict="{&#34;from&#34;:&#34;top-nav-click-location&#34;,&#34;uid&#34;:&#34;47995876&#34;}">同城</a>
-            </li>
-          
-            
-            <li>
-            <a href="http://www.douban.com/group/" target="_blank" data-moreurl-dict="{&#34;from&#34;:&#34;top-nav-click-group&#34;,&#34;uid&#34;:&#34;47995876&#34;}">小组</a>
-            </li>
-          
-            
-            <li>
-            <a href="http://read.douban.com/?dcs=top-nav&amp;dcm=douban" target="_blank" data-moreurl-dict="{&#34;from&#34;:&#34;top-nav-click-read&#34;,&#34;uid&#34;:&#34;47995876&#34;}">阅读</a>
-            </li>
-          
-            
-            <li>
-            <a href="http://douban.fm/" target="_blank" data-moreurl-dict="{&#34;from&#34;:&#34;top-nav-click-fm&#34;,&#34;uid&#34;:&#34;47995876&#34;}">豆瓣FM</a>
-            </li>
-          
-            
-            <li>
-            <a href="http://dongxi.douban.com/?dcs=top-nav&amp;dcm=douban" target="_blank" data-moreurl-dict="{&#34;from&#34;:&#34;top-nav-click-commodity&#34;,&#34;uid&#34;:&#34;47995876&#34;}">东西</a>
-            </li>
-          
-            <li>
-              <a href="#more" class="bn-more"><span>更多</span></a>
-              <div class="more-items">
-                <table cellpadding="0" cellspacing="0">
-                    
-                    <tr><td><a href="http://9.douban.com" target="_blank" data-moreurl-dict="{&#34;from&#34;:&#34;top-nav-click-9&#34;,&#34;uid&#34;:&#34;47995876&#34;}">九点</a></td></tr>
-                    
-                    <tr><td><a href="http://alphatown.com" target="_blank" data-moreurl-dict="{&#34;from&#34;:&#34;top-nav-click-town&#34;,&#34;uid&#34;:&#34;47995876&#34;}">阿尔法城</a></td></tr>
-                    

[... diff too long, it was truncated ...]

GitHub sha: 846db0ca

1 Like