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
# https://pixabay.com/api/?username=dayudodo&key=13eb0e81095a3556e172&q=yellow+flower&image_type=photo | |
# 读取返回数据 | |
require 'json' | |
require 'ostruct' | |
serialized = File.read("pixababy_return.json") | |
data = JSON.parse(serialized) | |
# p data["totalHits"] |
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
def turnCSharpTimeToRubyTime(sourceTime) | |
reg=/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.(\d{7})/ | |
temp,year,month,day,hour,minute,second,nsec=reg.match(sourceTime).to_a | |
return [year,month,day,hour,minute,second,nsec].map{|x| x.to_i} | |
end | |
# C# time String | |
timeStr="2011-08-11T11:17:55.7707133+08:00" | |
arr=turnCSharpTimeToRubyTime(timeStr) |
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
//node程序 | |
//传递读取到的lrc文件内容content | |
function lrcParser(content){ | |
//将数据分解为数组 | |
var data = content.replace(/\r/g,'') | |
var _arrayOfLrc=data.split("\n"); | |
var _LRC={ | |
lyrics:[] | |
}; | |