CLIからSoundCloudを起動するgemのやつ。 ホントは動作を確認してからいろいろやらないといけないんだろうけど、なんかissuesで結構動かすまで大変そうだから単純にコードを追いかけるだけ。
参考にしたいのは
- メソッドの切り分けの単位 →自分が単純にザラザラ書いてしまうので、参考にしたい
#!/usr/bin/env ruby | |
#-*- coding: utf-8 -*- | |
require 'tweetstream' | |
require 'uri' | |
TweetStream.configure do |config| | |
config.consumer_key = 'YOUR_CONSUMER_KEY' | |
config.consumer_secret = 'YOUR_CONSUMER_SECRET' | |
config.oauth_token = 'YOUR_OAUTH_TOKEN' | |
config.oauth_token_secret = 'YOUR_OAUTH_SECRET' | |
config.auth_method = :oauth |
Lisa_Rose: | |
Lady_in_the_Water: 2.5 | |
Snakes_on_a_Plane : 3.5 | |
Just_My_Luck: 3.0 | |
Superman_Returns: 3.5 | |
You_Me_and_Dupree: 2.5 | |
The_Night_Litener: 3.0 | |
Gene_Seymour: | |
Lady_in_the_Water: 3.0 |
#!/usr/bin/env python | |
# coding: utf-8 | |
import cv | |
import numpy | |
import scipy.misc | |
image_name = 'hinomaru.jpg' | |
gray_image_name = 'gray.jpg' | |
binarized_image_name = 'binarized.jpg' | |
contours_image_name = 'contours.jpg' |
#!/usr/bin/env ruby | |
#-*- coding: utf-8 -*- | |
def bubble_sort(arr) | |
if arr.nil? | |
return | |
end | |
n = arr.length |
def select_sort(arr) | |
if arr.nil? | |
return arr | |
end | |
size = arr.length | |
(size-1).times do |i| | |
min_index = i | |
(i..size-1).each do |j| |
#!/usr/bin/env ruby | |
#-*- coding: utf-8 -*- | |
def insert_sort(arr) | |
if arr.nil? | |
return arr | |
end | |
(arr.length).times do |i| | |
j = i |
require 'open-uri' | |
require 'nokogiri' | |
uri = URI("https://gdata.youtube.com/feeds/api/standardfeeds/JP/most_recent?time=today&v=2").read | |
docs = Nokogiri::XML(uri) | |
entry = docs.search("entry") | |
entry.each do |attr| | |
puts attr.search("title") | |
puts attr.xpath("media:group").xpath("media:thumbnail").attr("url") | |
puts attr.xpath("media:group").xpath("yt:videoid").text |
require 'uri' | |
require 'net/http' | |
require 'json' | |
puts 'post data' | |
puts 'url parsed.' | |
urls = ['http://www.youtube.com/watch?v=webZ80CGezY', 'http://www.youtube.com/watch?v=wCnLeg04LEU','http://www.youtube.com/watch?v=WXUEeecBcsU','http://www.youtube.com/watch?v=75fXFouP8mo' ] | |
data = { |
#!/usr/bin/env ruby | |
#-*- coding: utf-8 -*- | |
require 'mechanize' | |
#お笑いナタリーの芸人プロフィールのページから、芸人の情報を抜き出すスクリプト | |
#期待するdataの中身 | |
=begin | |
data = |
CLIからSoundCloudを起動するgemのやつ。 ホントは動作を確認してからいろいろやらないといけないんだろうけど、なんかissuesで結構動かすまで大変そうだから単純にコードを追いかけるだけ。
参考にしたいのは