• This repository has been archived on 06/Mar/2018
  • Stars
    star
    366
  • Rank 115,733 (Top 3 %)
  • Language
    Ruby
  • Created almost 11 years ago
  • Updated almost 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🎬 Source code of IMAX.im

IMAX.im

功能

  • 依附于 Douban API 创建电影信息库;
  • 上传资源的时候自动解析 Ed2k, Torrent 的信息;
  • 国内在线视频网站播放地址解析;
  • Retina Display 支持;
  • Apple TV API for @盒子大师

系统需求

  • Linux
  • Ruby 1.9.3 (2.0.0 CSS 有个 Bug 一直没查出来)
  • Solr
  • MongoDb
  • Redis
  • Memcached
  • Douban API

搜索引擎

使用 Solr 实现搜索功能。

Scanffold 命令创建后台

rails g scaffold_controller admin/movies title:string year:integer alias_list:string director_list:string actor_list:string category_list:string country_list:string language_list:string tag_list:string pub_date:date time_length:integer imdb:string rank:integer raters_count:integer cover:string website:string desc:string summary:string

安装简单说明

环境

  • Ubuntu Server 12.04
  • Ruby 1.9.3
  • MongoDB 2.4.0+
  • Memcached 新版本
  • Solr (用特定脚本安装,以便有中文分词)

Ruby 安装

建议新建一个 ruby 的 sudoer 用户,以后一切服务器在这个下面跑

安装必要库

sudo apt-get update
sudo apt-get install -y wget vim build-essential openssl libreadline6 libreadline6-dev libsqlite3-dev libmysqlclient-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf automake libtool imagemagick libmagickwand-dev libpcre3-dev language-pack-zh-hans nodejs

安装 Ruby

cd ~/
mkdir downloads
cd downloads
wget http://cache.ruby-lang.org/pub/ruby/ruby-1.9.3-p484.tar.gz
tar zxf ruby-1.9.3-p484.tar.gz
cd ruby-1.9.3-p484
./configure 
make && sudo make install

试试 ruby -v 看看是否成功, gem -v 看看 RubyGems 是否安装成功。

gem install bundler rails

安装 MongoDb

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/10gen.list
sudo apt-get update
sudo apt-get install mongodb-10gen
ps aux | grep mongodb

安装 Memcached

sudo apt-get install memcached
ps aux | grep memcached

安装 Solr

cd ~/
mkdir tmp
cd tmp
wget https://github.com/sunspot/sunspot/archive/v2.0.0.zip
unzip v2.0.0.zip 
mv sunspot-2.0.0 sunspot
wget http://mmseg4j.googlecode.com/files/mmseg4j-1.8.3.zip
unzip mmseg4j-1.8.3.zip -d mmseg4j
cd ..
cp tmp/sunspot/sunspot_solr/solr sunspot_solr_mmseg4j -r
cp tmp/mmseg4j/data sunspot_solr_mmseg4j/solr/dict -r
mkdir -p tmp/WEB-INF/lib
cp tmp/mmseg4j/mmseg4j-all-1.8.3.jar tmp/WEB-INF/lib
sed 's,class="solr.StandardTokenizerFactory",class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="max-word" dicPath="dict",g' -i sunspot_solr_mmseg4j/solr/conf/schema.xml
jar uf sunspot_solr_mmseg4j/webapps/solr.war -C tmp WEB-INF/lib/mmseg4j-all-1.8.3.jar
rm -rf tmp
echo "******************"
echo "** install done **"
echo "******************"
echo "cd sunspot_solr_mmseg4j and run 'java -jar start.jar' to start jetty"
echo "visit http://localhost:8983/solr/ to verify result" 

以后就用 java -jar start.jar 来启动 Solr 服务,源代码里面已经配置好了连接本机的 Solr

安装网站源代码

cd ~/
cd www/movieso
bundle install
RAILS_ENV=production bundle exec rake assets:precompile

修改 config/setting.yml 在里面加上 Douban API key

MongoDB, Memcached, Solr 什么的配置已经是在本地上面的,都是默认端口,没有密码的,如果数据,Solr, Memcached 什么的都有了,rails s 就应该能跑起来了。

重建 Solr 索引

cd www/movieso
rake sunspot:solr:reindex

More Repositories

1

rails-settings-cached

Global settings for your Rails application.
Ruby
1,005
star
2

flora-kit

💐 基于 shadowsocks-go 做的完善实现,自动网络分流,完全兼容 Surge 的配置文件。
Go
898
star
3

autocorrect

A linter and formatter to help you to improve copywriting, correct spaces, words, and punctuations between CJK (Chinese, Japanese, Korean).
Rust
887
star
4

redis-search

Deprecated! High performance real-time prefix search, indexes store in Redis for Rails application
Ruby
712
star
5

rucaptcha

Captcha Gem for Rails, which generates captcha image by Rust.
Ruby
686
star
6

quora

Quora.com like project with Ruby on Rails (不再维护)
JavaScript
684
star
7

init.d

⚙️ Batch scripts for Rails production environment install on Ubuntu Server.
678
star
8

bluedoc

An open-source document management tool for enterprise self host.
Ruby
626
star
9

social-share-button

Helper for add social share feature in your Rails app. Twitter, Facebook, Weibo, Douban ...
CoffeeScript
581
star
10

PokemonGoMove

Pokemon GO iOS GPS Emulator - NO Jailbreak needed, lets you play the game on your Mac :)
Python
412
star
11

mediom

Forum web application, an example for from Rails to Go (Revel)
Go
355
star
12

jquery.qeditor

This is a simple WYSIWYG editor with jQuery.
CoffeeScript
259
star
13

carrierwave-aliyun

阿里云 OSS Ruby 上传组件,基于 Carrierwave
Ruby
195
star
14

auto-correct

Automatically add whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (alphabetical letters, numerical digits and symbols).
Ruby
142
star
15

activestorage-aliyun

Wraps the Aliyun OSS as an Active Storage service.
Ruby
131
star
16

sails

Create a Thrift Server use like Rails
Ruby
71
star
17

turbolinks-prefetch

Turbolinks extends for prefetch links to speeds up your website.
JavaScript
70
star
18

personlab

我博客的源代码,这个代码较老,不推荐拿来学习
Ruby
69
star
19

vimmate

Custom vim like Textmate for Ruby on Rails development
Vim Script
69
star
20

gpui-component

A UI components write in GPUI.
Rust
67
star
21

mongoid_auto_increment_id

Override id field to MySQL like auto increment for Mongoid.
Ruby
65
star
22

hello-go

入门 Go 编写应用
Go
57
star
23

pasite

Share your sources code on the web, see the http://pasite.org
Ruby
55
star
24

zed-theme-macos-classic

A macOS native style theme for Zed, let it same like native app in macOS.
JavaScript
49
star
25

sql-builder

A simple SQL builder for generate SQL for non-ActiveRecord supports databases
Ruby
36
star
26

rails-activestorage-example

Rails use Active Storage the right way
Ruby
30
star
27

redmine-theme-innerboard

Innerboard theme for Redmine
26
star
28

cocoaout

Auto build and release tool for Cocoa projects.
Ruby
25
star
29

enumize

Extend ActiveRecord::Enum for add more helpful methods.
Ruby
24
star
30

jquery.lazyimg

Image lazy load plugin for jQuery, fork from jquery.unveil to improve performance with huge DOMs.
CoffeeScript
23
star
31

gitlab-mail-receiver

The way of allow your GitLab support Email receive and parse the email content, and find Issue/MergeRequest to create reply.
Ruby
23
star
32

redis-search-example

An example for use redis-search gem
JavaScript
23
star
33

ip-location

通过淘宝 IP 库查询 IP 所在地域位置 http://ip.taobao.com
Ruby
18
star
34

mongoid_taggable_on

Taggable on custom fields for Mongoid
Ruby
16
star
35

vscode-macos-classic.theme

macOS Classic theme for Visual Studio Code
Makefile
15
star
36

backup-aliyun

Aliyun OSS storage with Backup
Ruby
12
star
37

jdialog

a jQuery popup window plugin
JavaScript
12
star
38

html-pipeline.cr

HTML processing filters and utilities for Crystal.
Crystal
11
star
39

vue-rails-example

Use Vue.js in Rails 6 example
Ruby
9
star
40

actiontext-lite

Lite version of ActionText
Ruby
7
star
41

autocorrect-action

GitHub action for use AutoCorrect as lint
Shell
6
star
42

zed-extension-action

GitHub Action for automatically bump Zed Extensions version after a release.
JavaScript
6
star
43

docker-rails

Deploy Rails via Docker example
Ruby
5
star
44

booklib

php + Codeigniter Library management tool
PHP
4
star
45

vscode-blackboard-plus.theme

Visual Studio Code - Blackboard Plus Theme
4
star
46

zed-csv

CSV support for Zed
Rust
4
star
47

remarkdown

This is extends of Markdown lib from Crystal Stdlib for Support Markdown GFM.
Crystal
4
star
48

huacnlee.github.io

Ruby
3
star
49

vscode-autocorrect

AutoCorrect for VS Code
TypeScript
3
star
50

sidekiq-activerecord-shard

Sidekiq middleware to supports ActiveRecord 7 shard
Ruby
3
star
51

autocorrect-idea-plugin

AutoCorrect Plugin for IntelliJ IDEA
Kotlin
2
star
52

auto-booking-park

Shell
2
star
53

jselectdate

jQuery date choice control with dropdown list
JavaScript
2
star
54

capistrano-upload-configs

Capistrano plugin for Upload local config files to remote, and create soft link.
Ruby
2
star
55

zed-autocorrect

AutoCorrect for Zed
Rust
2
star
56

micro-web-simple

Go
1
star
57

jimagelink

模拟yupoo的缩略图上的小图标效果的jQuery插件
JavaScript
1
star
58

jcaches

client side cache with Javascript
JavaScript
1
star
59

yjs-server

JavaScript
1
star
60

Light-Classic.tmTheme

Improve of TextMate Light Theme from Mac Classic
1
star