http://www.nicovideo.jp/watch/1380872606
上記の動画を例にDL方法を解説する。
パラメータの取得
| package jp.tondol.sample; | |
| import java.net.HttpURLConnection; | |
| import java.net.URL; | |
| import android.content.Context; | |
| import android.graphics.Color; | |
| import android.graphics.drawable.ColorDrawable; | |
| import android.graphics.drawable.Drawable; | |
| import android.graphics.drawable.StateListDrawable; |
| # -*- coding: utf-8 -*- | |
| require_relative 'twitterbot' | |
| Twitter.configure {|config| | |
| config.consumer_key = 'consumer key' | |
| config.consumer_secret = 'consumer secret' | |
| config.oauth_token = 'oauth token' | |
| config.oauth_token_secret = 'oauth token secret' | |
| } |
| #!/usr/bin/env ruby | |
| #-*- encoding: utf-8 -*- | |
| $VERBOSE = nil | |
| $KCODE = 'u' | |
| usage = <<END_OF_USAGE | |
| #{$0} | |
| ========================= |
| public class RoundedFrameLayout extends FrameLayout { | |
| private Path path; | |
| private static final int HONEY_COMB = 11; | |
| private static final int LAYER_TYPE_SOFTWARE = 1; | |
| public RoundedFrameLayout(Context context) { | |
| super(context); | |
| useSoftwareLayer(); | |
| } | |
| public RoundedFrameLayout(Context context, AttributeSet attrs) { | |
| super(context, attrs); |
| // ==UserScript== | |
| // @name tumblr_hook.user.js | |
| // @namespace http://tondol.com | |
| // @description dashboardのショートカットキーをカスタマイズする | |
| // @include http://www.tumblr.com/dashboard | |
| // @include http://www.tumblr.com/dashboard/* | |
| // @version 0.1 | |
| // ==/UserScript== | |
| // 参考: |
| 平面 := ax + by + cz + d = 0 | |
| 点P := (x0, y0, z0) | |
| 点Q := (x1, y1, z1) = 点Pから平面に下ろした垂線が平面と交差する点 | |
| 平面の法線ベクトル := (a, b, c) | |
| l := 点Pと平面の距離 | |
| ベクトルPQは法線ベクトルと平行だから: (x1, y1, z1) - (x0, y0, z0) = t・(a, b, c) …… [1] | |
| 点Qは平面上の点だから: ax1 + by1 + cz1 + d = (a, b, c)・(x1, y1, z1) + d = 0 …… [2] | |
| [1]より |
| // | |
| // NSCollection+TypeSafe.h | |
| // | |
| #import <Foundation/Foundation.h> | |
| #define TYPESAFE_ARRAY(classname) \ | |
| @interface NSArray (TypeSafe ## classname) \ | |
| - (classname *)get ## classname:(int)index; \ | |
| - (classname *)get ## classname:(int)index none:(classname *)none; \ |
| # -*- coding: utf-8 -*- | |
| require 'open-uri' | |
| require 'nokogiri' | |
| # 下記サイトから相場データを取得する | |
| # http://imascg.info/ | |
| url = "http://imascg.info/idol/?targetDate=ALL" | |
| accept_language = "ja,en;q=0.8" | |
| html = open(url, "accept-language" => accept_language).read |
| # -*- coding: utf-8 -*- | |
| require 'net/http' | |
| require 'twitter' | |
| client = Twitter::REST::Client.new {|config| | |
| config.consumer_key = '' | |
| config.consumer_secret = '' | |
| config.oauth_token = '' | |
| config.oauth_token_secret = '' |