View meitu_xiuxiu_api.html.erb
1 2 3 4 5 6 7 8 9 10
#本文目的:
# 实现新图片的添加、已添加图片的美化和拼图
 
#参考美图秀秀API
# http://open.web.meitu.com/products/#M2
# http://open.web.meitu.com/products/#M3
 
#最重要的这个文件
# views/site_images/_meitu_load.html.erb:
<script type="text/javascript">
View devise_omniauth_oauth2_tqq_douban_weibo.rb
1 2 3 4 5 6 7 8 9
=begin
参考教程:http://www.douban.com/note/411359006/
Gem Omniauth(https://github.com/intridea/omniauth)
Gem omniauth-oauth2 (https://github.com/intridea/omniauth-oauth2)
流程参考:https://ruby-china.org/topics/6464
Devise and OmniAuth (revised) (http://railscasts.com/episodes/235-devise-and-omniauth-revised)
=end
 
# Gem lists
View Omniauth_Strategy_Weibo.rb
1 2 3 4 5 6 7 8 9 10
#C:\Sites\tm_wed\lib\omniauth\strategies\weibo.rb
# Updated at: 2014-09-04
# Author: we@wedxt.com
 
require 'omniauth-oauth2'
 
module OmniAuth
module Strategies
class Weibo < OmniAuth::Strategies::OAuth2
View Omniauth_Strategy_TQQ.rb
1 2 3 4 5 6 7 8 9
#C:\Sites\tm_wed\lib\omniauth\strategies\tqq.rb
# Updated at: 2014-09-04
# Author: we@wedxt.com
 
require "omniauth-oauth2"
 
module OmniAuth
module Strategies
class Tqq < OmniAuth::Strategies::OAuth2
View Omniauth_Strategy_Douban.rb
1 2 3 4 5 6 7 8 9 10
#C:\Sites\tm_wed\lib\omniauth\strategies\douban.rb
# Updated at: 2014-09-04
# Author: we@wedxt.com
 
require 'omniauth-oauth2'
 
module OmniAuth
module Strategies
class Douban < OmniAuth::Strategies::OAuth2
DEFAULT_SCOPE = 'douban_basic_common,shuo_basic_r,shuo_basic_w'
View nokogiri_test.rb
1 2 3 4 5 6 7 8 9 10
require 'nokogiri'
require 'open-uri'
require 'iconv'
 
# define the html url
url="http://cd.58.com/wangzhanmeigong/"
#get the nokogiri document
doc = Nokogiri::HTML(open(url))
#new a file for save
file = File.new("c:/a.html","w")
Something went wrong with that request. Please try again.