This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#本文目的: | |
# 实现新图片的添加、已添加图片的美化和拼图 | |
#参考美图秀秀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"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#C:\Sites\tm_wed\lib\omniauth\strategies\weibo.rb | |
# Updated at: 2014-09-04 | |
# Author: [email protected] | |
require 'omniauth-oauth2' | |
module OmniAuth | |
module Strategies | |
class Weibo < OmniAuth::Strategies::OAuth2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#C:\Sites\tm_wed\lib\omniauth\strategies\tqq.rb | |
# Updated at: 2014-09-04 | |
# Author: [email protected] | |
require "omniauth-oauth2" | |
module OmniAuth | |
module Strategies | |
class Tqq < OmniAuth::Strategies::OAuth2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#C:\Sites\tm_wed\lib\omniauth\strategies\douban.rb | |
# Updated at: 2014-09-04 | |
# Author: [email protected] | |
require 'omniauth-oauth2' | |
module OmniAuth | |
module Strategies | |
class Douban < OmniAuth::Strategies::OAuth2 | |
DEFAULT_SCOPE = 'douban_basic_common,shuo_basic_r,shuo_basic_w' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5.times do | |
p 'hello' | |
end |