doc: http://open.youku.com/docs/doc?id=67
555965
def find_playlists_by_ids(self, playlist_ids):
        
        url = 'https://openapi.youku.com/v2/playlists/show_batch.json'
        params = {
            'client_id': self.client_id,
            'playlist_ids': playlist_ids
        }
        r = requests.get(url, params=params)
        check_error(r)
        return r.json()
800615
def playURI(self, uri):
        
        url: str = get_url("/remote/play.json")
        params = {
            "oauth": self._oauth_token,
            "csrf": self._csrf_token,
            "uri": uri,
            "context": uri,
        }
        r = self._request(url=url, params=params)
        return r.json()
776068
def update_video(self, access_token, video_id, title=None,
                     tags=None, category=None, copyright_type=None,
                     public_type=None, watch_password=None,
                     description=None, thumbnail_seq=None):
        
        url = 'https://openapi.youku.com/v2/videos/update.json'
        data = {
            'client_id': self.client_id,
            'access_token': access_token,
            'video_id': video_id,
            'title': title,
            'tags': tags,
            'category': category,
            'copyright_type': copyright_type,
            'public_type': public_type,
            'watch_password': watch_password,
            'description': description,
            'thumbnail_seq': thumbnail_seq
        }
        data = remove_none_value(data)
        r = requests.post(url, data=data)
        check_error(r)
        return r.json()['id']
15007
def search_keyword_complete(self, keyword):
        
        url = 'https://openapi.youku.com/v2/searches/keyword/complete.json'
        params = {
            'client_id': self.client_id,
            'keyword': keyword
        }
        r = requests.get(url, params=params)
        check_error(r)
        return r.json()
1081263
function(){
		var inp = this.qdata.split("/"), col = 0, row = 0;
		delete this.qdata;
		/* URLにつけるオプション */
		if(this.type!==URL_KANPEN && this.type!==URL_HEYAAPP){
			if(!!inp[0] && !isNaN(inp[0])){ inp.unshift("");}
			this.pflag = inp.shift();
		}
		
		/* サイズを表す文字列 */
		if(this.type===URL_KANPEN){
			if(this.pid==="kakuro"){
				row = +inp.shift() - 1;
				col = +inp.shift() - 1;
			}
			else if(this.pid==="sudoku"){
				row = col = +inp.shift();
			}
			else{
				row = +inp.shift();
				col = +inp.shift();
			}
		}
		else if(this.type===URL_HEYAAPP){
			var size = inp.shift().split("x");
			col = +size[0];
			row = +size[1];
		}
		else{
			col = +inp.shift() || NaN;
			row = +inp.shift() || NaN;
		}
		this.rows = row;
		this.cols = col;

		/* サイズ以降のデータを取得 */
		if(!inp[inp.length-1]){ inp.pop();}
		this.body = inp.join("/");
	}
956192
def get_token_by_code(self, code):
        ''''''
        url = 'https://openapi.youku.com/v2/oauth2/token'
        data = {'client_id': self.client_id,
                'client_secret': self.client_secret,
                'grant_type': 'authorization_code',
                'code': code,
                'redirect_uri': self.redirect_uri}
        r = requests.post(url, data=data)
        check_error(r)
        return r.json()
1076795
def channels_voice_greeting_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/channels/voice/greetings/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
1289064
protected static String uploadMedia(String url, File file, String params) throws IOException {
		URL urlGet = new URL(url);
		HttpURLConnection conn = (HttpURLConnection) urlGet.openConnection();
		conn.setDoOutput(true);
		conn.setDoInput(true);
		conn.setUseCaches(false);
		conn.setRequestMethod("POST");
		conn.setRequestProperty("connection", "Keep-Alive");
		conn.setRequestProperty("user-agent", DEFAULT_USER_AGENT);
		conn.setRequestProperty("Charsert", "UTF-8");
		// 定义数据分隔线
		String BOUNDARY = "----WebKitFormBoundaryiDGnV9zdZA1eM1yL";
		conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);

		OutputStream out = new DataOutputStream(conn.getOutputStream());
		// 定义最后数据分隔线
		StringBuilder mediaData = new StringBuilder();
		mediaData.append("--").append(BOUNDARY).append("\r\n");
		mediaData.append("Content-Disposition: form-data;name=\"media\";filename=\"" + file.getName() + "\"\r\n");
		mediaData.append("Content-Type:application/octet-stream\r\n\r\n");
		byte[] mediaDatas = mediaData.toString().getBytes();
		out.write(mediaDatas);
		DataInputStream fs = new DataInputStream(new FileInputStream(file));
		int bytes = 0;
		byte[] bufferOut = new byte[1024];
		while ((bytes = fs.read(bufferOut)) != -1) {
			out.write(bufferOut, 0, bytes);
		}
		IOUtils.closeQuietly(fs);
		// 多个文件时，二个文件之间加入这个
		out.write("\r\n".getBytes());
		if (StrKit.notBlank(params)) {
			StringBuilder paramData = new StringBuilder();
			paramData.append("--").append(BOUNDARY).append("\r\n");
			paramData.append("Content-Disposition: form-data;name=\"description\";");
			byte[] paramDatas = paramData.toString().getBytes();
			out.write(paramDatas);
			out.write(params.getBytes(Charsets.UTF_8));
		}
		byte[] end_data = ("\r\n--" + BOUNDARY + "--\r\n").getBytes();
		out.write(end_data);
		out.flush();
		IOUtils.closeQuietly(out);

		// 定义BufferedReader输入流来读取URL的响应
		InputStream in = conn.getInputStream();
		BufferedReader read = new BufferedReader(new InputStreamReader(in, Charsets.UTF_8));
		String valueString = null;
		StringBuffer bufferRes = null;
		bufferRes = new StringBuffer();
		while ((valueString = read.readLine()) != null) {
			bufferRes.append(valueString);
		}
		IOUtils.closeQuietly(in);
		// 关闭连接
		if (conn != null) {
			conn.disconnect();
		}
		return bufferRes.toString();
	}
1048424
def update_playlist(self, access_token, playlist_id, title,
                        tags=None, category=None, description=None):
        
        url = 'https://openapi.youku.com/v2/playlists/update.json'
        data = {
            'client_id': self.client_id,
            'access_token': access_token,
            'playlist_id': playlist_id,
            'title': title,
            'tags': tags,
            'category': category,
            'description': description
        }
        data = remove_none_value(data)
        r = requests.post(url, data=data)
        check_error(r)
        return r.json()['id']
825797
function curveRegisterInfoUpdate(){
    //レジスタ値の取得 複数取得は返り値がObject
    KMB.cmdReadRegister([KMMotorOneWebBLE.cmdReadRegister_COMMAND.curveType,KMMotorOneWebBLE.cmdReadRegister_COMMAND.acc,KMMotorOneWebBLE.cmdReadRegister_COMMAND.dec]).then(function(val){
        let str="";
        Object.keys(val).forEach(function(k){str+=k+":"+val[k]+" "});
        $("#curveRegisterInfo").text(str);
    }).catch(function(msg){
        console.log(msg);
    });
}
1232311
function() {
		var api_url,
			self = this;
					
		// Create Dom element
		this._el.content_item = TL.Dom.create("div", "tl-media-twitter", this._el.content);
		this._el.content_container.className = "tl-media-content-container tl-media-content-container-text";
		
		// Get Media ID
		var found = this.data.url.match(/(status|statuses)\/(\d+)/);
		if (found && found.length > 2) {
		    this.media_id = found[2];
		} else {
		    self.loadErrorDisplay(self._("twitterembed_invalidurl_err"));
		    return;
		}

		// API URL
		api_url = "https://api.twitter.com/1/statuses/oembed.json?id=" + this.media_id + "&omit_script=true&include_entities=true&callback=?";
        
        window.twttr = (function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0],
            t = window.twttr || {};
            if (d.getElementById(id)) return t;
            js = d.createElement(s);
            js.id = id;
            js.src = "https://platform.twitter.com/widgets.js";
            fjs.parentNode.insertBefore(js, fjs);

            t._e = [];
            t.ready = function(f) {
            t._e.push(f);
            };

            return t;
        }(document, "script", "twitter-wjs"));
        
        mediaID = this.media_id;
		
		// API Call
		TL.ajax({
			type: 'GET',
			url: api_url,
			dataType: 'json', //json data type
			success: function(d){
				self.createMedia(d);
			},
			error:function(xhr, type){
				var error_text = "";
				error_text += self._("twitter_load_err") + "<br/>" + self.media_id + "<br/>" + type;
				self.loadErrorDisplay(error_text);
			}
		});
		 
	}
698599
def friendship_followings(self, user_id=None, user_name=None,
                              page=1, count=20):
        
        url = 'https://openapi.youku.com/v2/users/friendship/followings.json'
        data = {
            'client_id': self.client_id,
            'page': page,
            'count': count,
            'user_id': user_id,
            'user_name': user_name
        }
        data = remove_none_value(data)
        r = requests.post(url, data=data)
        check_error(r)
        return r.json()
1037858
def search_videos_by_tag(self, tag, category=None,
                             period='today',
                             orderby='relevance',
                             page=1, count=20):
        
        url = 'https://openapi.youku.com/v2/searches/video/by_tag.json'
        params = {
            'client_id': self.client_id,
            'tag': tag,
            'period': period,
            'orderby': orderby,
            'page': page,
            'count': count
        }
        if category:
            params['category'] = category
        r = requests.get(url, params=params)
        check_error(r)
        return r.json()
458541
def find_favorite_videos_by_userid(self, user_id,
                                       orderby='favorite-time',
                                       page=1, count=20):
        
        url = 'https://openapi.youku.com/v2/videos/favorite/by_user.json'
        params = {
            'client_id': self.client_id,
            'user_id': user_id,
            'orderby': orderby,
            'page': page,
            'count': count
        }
        r = requests.get(url, params=params)
        check_error(r)
        return r.json()
1296275
def open
      unless addon_name = shift_argument
        error("Usage: heroku addons:open ADDON\nMust specify ADDON to open.")
      end
      validate_arguments!
      requires_preauth

      addon = resolve_addon!(addon_name)
      web_url = addon['web_url']

      begin
        attachment = resolve_attachment!(addon_name)
        web_url = attachment['web_url']
      rescue Heroku::API::Errors::NotFound
        # no-op
      rescue Heroku::API::Errors::RequestFailed => e
        if MultiJson.decode(e.response.body)["id"] != "multiple_matches"
          raise
        end
      end

      service = addon['addon_service']['name']
      launchy("Opening #{service} (#{addon['name']}) for #{addon['app']['name']}", web_url)
    end
181844
function pGetUrl(url, headers){
    //console.log(`\r\n发起远程请求(${Date()})：${url}\r\n`);
    if(!headers){
        headers = {};
    }
    headers['User-Agent'] = 'Request-Promise';
    return rp({
        uri: url,
        headers: headers,
        json: true // Automatically parses the JSON string in the response
    });
}
217538
function(username) {
        var result = q.defer();
        this.robot.http('https://gdata.youtube.com/feeds/api/users/' + username + '/uploads?alt=json')
            .header('Accept', 'application/json')
            .get()(function (err, res, body) {
            if (err) {
                result.reject(err);
                return;
            }

            if(res.statusCode >= 400) {
                result.reject(body);
                return;
            }

            var parsed;
            try {
                parsed = JSON.parse(body);
            } catch (e) {
                result.reject(e);
            }

            if(!parsed.feed || !parsed.feed.entry) {
                result.reject('invalid format of youtube data');
                return;
            }

            var videos = parsed.feed.entry.map(function(element) {
                return {
                    id: element.id.$t,
                    link: element.link[0].href
                }
            });

            result.resolve(videos);
        });
        return result.promise;
    }