doc: http://open.youku.com/docs/doc?id=82
553098
def search_shows_by_keyword(self, keyword, unite=0, source_site=None,
                                category=None, release_year=None,
                                area=None, orderby='view-count',
                                paid=None, hasvideotype=None,
                                page=1, count=20):
        
        url = 'https://openapi.youku.com/v2/searches/show/by_keyword.json'
        params = {
            'client_id': self.client_id,
            'keyword': keyword,
            'unite': unite,
            'source_site': source_site,
            'category': category,
            'release_year': release_year,
            'area': area,
            'orderby': orderby,
            'paid': paid,
            'hasvideotype': hasvideotype,
            'page': page,
            'count': count
        }
        params = remove_none_value(params)
        r = requests.get(url, params=params)
        check_error(r)
        return r.json()
258342
function(){
		var lines = this.fstr.split("\n");
		var firstline = lines.shift();
		delete this.fstr;
		
		/* ヘッダからパズルの種類・ファイルの種類を判定する */
		if(firstline.match(/^pzprv3/)){
			this.type = FILE_PZPR;
			if(firstline.match(/pzprv3\.(\d+)/)){ this.filever = +RegExp.$1;}
			this.pid = lines.shift();
			this.qdata = lines.join("\n");
		}
		else if(firstline.match(/^\<\?xml/)){ // jshint ignore:line
			this.type = FILE_PBOX_XML;
			lines.unshift(firstline);
			this.qdata = lines.join("\n");
			if(!!DOMParser){
				this.body = (new DOMParser()).parseFromString(this.qdata, 'text/xml');
				this.pid = this.body.querySelector('puzzle').getAttribute('type');
			}
			else{ this.pid = '';}
		}
		else if(firstline.match(/^\d+$/)){
			this.type = FILE_PBOX;
			lines.unshift(firstline);
			this.qdata = lines.join("\n");
		}
		else{
			this.pid = '';
		}
		this.pid = pzpr.variety.toPID(this.pid);
		
		return (!!this.pid);
	}
1270993
def video_category(self):
        
        url = 'https://openapi.youku.com/v2/schemas/video/category.json'
        r = requests.get(url)
        check_error(r)
        return r.json()
353170
def find_persons_by_ids(self, person_ids):
        
        url = 'https://openapi.youku.com/v2/persons/show_batch.json'
        params = {
            'client_id': self.client_id,
            'person_ids': person_ids
        }
        r = requests.get(url, params=params)
        check_error(r)
        return r.json()
1121451
function f_kurum_urun_tumu(_tahta_id, _kurum_id) {

        return result.dbQ.smembers(result.kp.kurum.ssetUrunleri(_tahta_id, _kurum_id))
            .then(function (_urun_idleri) {
                var db_urun = require("./db_urun");
                /** @type {OptionsUrun} */
                var opt = {};
                opt.bArrAnahtarKelimeler = true;
                opt.bArrIliskiliFirmalar = true;
                opt.bUreticiKurum = false;

                return db_urun.f_db_urun_id(_urun_idleri, _tahta_id, opt);
            })
            .fail(function (_err) {
                console.log("HATA ALINDI " + _err);
                return _err;
            });
    }
1008370
def find_video_details_by_ids(self, video_ids, ext=None):
        
        url = 'https://openapi.youku.com/v2/videos/show_batch.json'
        params = {
            'client_id': self.client_id,
            'video_ids': video_ids
        }
        if ext:
            params['ext'] = ext
        r = requests.get(url, params=params)
        check_error(r)
        return r.json()
411853
function showStreams() {
	//http://ibl.api.bbci.co.uk/ibl/v1/channels?lang=en&api_key=APIKEY
	var query = nitro.newQuery();
	query.add(ibl.commonLangEn);
	nitro.make_request(ibl.host,ibl.getChannels,ibl_key,query,{},function(obj){
		console.log(JSON.stringify(obj,null,2));
		for (var i in obj.channels) {
			var ch = obj.channels[i];
			console.log('['+ch.title+'](http://a.files.bbci.co.uk/media/live/manifesto/audio_video/simulcast/hls/uk/hls_tablet_rw/llnw/'+ch.master_brand_id+'.m3u8)');
		}
		return false;
	});
}
870212
function open(opts, callback) {
        var that = void 0;
        jQuery(document.body).append(getContent.call(this, opts.id, opts));

        this.activeModal = jQuery("#" + opts.id);
        // 파트수집
        this.$ = {
          root: this.activeModal,
          header: this.activeModal.find('[data-modal-els="header"]'),
          body: this.activeModal.find('[data-modal-els="body"]')
        };

        if (opts.iframe) {
          this.$["iframe-wrap"] = this.activeModal.find('[data-modal-els="iframe-wrap"]');
          this.$["iframe"] = this.activeModal.find('[data-modal-els="iframe"]');
          this.$["iframe-form"] = this.activeModal.find('[data-modal-els="iframe-form"]');
          this.$["iframe-loading"] = this.activeModal.find('[data-modal-els="iframe-loading"]');
        } else {
          this.$["body-frame"] = this.activeModal.find('[data-modal-els="body-frame"]');
        }

        //- position 정렬
        this.align();

        that = {
          self: this,
          id: opts.id,
          theme: opts.theme,
          width: opts.width,
          height: opts.height,
          state: "open",
          $: this.$
        };

        if (opts.iframe) {
          this.$["iframe-wrap"].css({ height: opts.height });
          this.$["iframe"].css({ height: opts.height });

          // iframe content load
          this.$["iframe-form"].attr({ method: opts.iframe.method });
          this.$["iframe-form"].attr({ target: opts.id + "-frame" });
          this.$["iframe-form"].attr({ action: opts.iframe.url });
          this.$["iframe"].on("load", function () {
            that.state = "load";
            if (opts.iframeLoadingMsg) {
              this.$["iframe-loading"].hide();
            }
            onStateChanged.call(this, opts, that);
          }.bind(this));
          if (!opts.iframeLoadingMsg) {
            this.$["iframe"].show();
          }
          this.$["iframe-form"].submit();
        }

        if (callback) callback.call(that, that);

        if (!this.watingModal) {
          onStateChanged.call(this, opts, that);
        }

        // bind key event
        if (opts.closeToEsc) {
          jQuery(window).bind("keydown.ax-modal", function (e) {
            onkeyup.call(this, e || window.event);
          }.bind(this));
        }

        jQuery(window).bind("resize.ax-modal", function (e) {
          this.align(null, e || window.event);
        }.bind(this));

        this.$.header.off(ENM["mousedown"]).off("dragstart").on(ENM["mousedown"], function (e) {
          /// 이벤트 필터링 추가 : 버튼엘리먼트로 부터 발생된 이벤트이면 moveModal 시작하지 않도록 필터링
          var isButton = U.findParentNode(e.target, function (_target) {
            if (_target.getAttribute("data-modal-header-btn")) {
              return true;
            }
          });

          if (!opts.isFullScreen && !isButton && opts.disableDrag != true) {
            self.mousePosition = getMousePosition(e);
            moveModal.on.call(self);
          }
          if (isButton) {
            btnOnClick.call(self, e || window.event, opts);
          }
        }).on("dragstart", function (e) {
          U.stopEvent(e.originalEvent);
          return false;
        });

        this.activeModal.off(ENM["mousedown"]).off("dragstart").on(ENM["mousedown"], "[data-ax5modal-resizer]", function (e) {
          if (opts.disableDrag || opts.isFullScreen) return false;
          self.mousePosition = getMousePosition(e);
          resizeModal.on.call(self, this.getAttribute("data-ax5modal-resizer"));
        }).on("dragstart", function (e) {
          U.stopEvent(e.originalEvent);
          return false;
        });
      }
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
    });
}
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);
			}
		});
		 
	}
1357801
def find_videos_by_show(self, show_id, show_videotype=None,
                            show_videostage=None, orderby='videoseq-asc',
                            page=1, count=20):
        
        url = 'https://openapi.youku.com/v2/shows/videos.json'
        params = {
            'client_id': self.client_id,
            'show_id': show_id,
            'page': page,
            'count': count,
            'show_videotype': show_videotype,
            'show_videostage': show_videostage,
            'orderby': orderby
        }
        params = remove_none_value(params)
        r = requests.get(url, params=params)
        check_error(r)
        return r.json()
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']
1311685
def find_comments_by_ids(self, comment_ids):
        
        url = 'https://openapi.youku.com/v2/comments/show_batch.json'
        params = {
            'client_id': self.client_id,
            'comment_ids': comment_ids
        }
        r = requests.get(url, params=params)
        check_error(r)
        return r.json()
553293
def find_comment_by_id(self, comment_id):
        
        url = 'https://openapi.youku.com/v2/comments/show.json'
        params = {
            'client_id': self.client_id,
            'comment_id': comment_id
        }
        r = requests.get(url, params=params)
        check_error(r)
        return r.json()
594488
def refresh_token(self, refresh_token):
        ''''''
        url = 'https://api.youku.com/oauth2/token.json'
        data = {'client_id': self.client_id,
                'grant_type': 'refresh_token',
                'refresh_token': refresh_token}
        r = requests.post(url, data=data)
        check_error(r)
        return r.json()
101312
function(){
		var pzl = this, col = pzl.cols, row = pzl.rows, out = [];

		/* URLにつけるオプション */
		if(pzl.type!==URL_KANPEN && pzl.type!==URL_HEYAAPP){
			if(pzl.type===URL_KANPENP || !!pzl.pflag){ out.push(pzl.pflag);}
		}

		/* サイズを表す文字列 */
		if(pzl.type===URL_KANPEN){
			if(pzl.pid==="kakuro"){
				out.push(row + 1);
				out.push(col + 1);
			}
			else if(pzl.pid==="sudoku"){
				out.push(col);
			}
			else{
				out.push(row);
				out.push(col);
			}
		}
		else if(pzl.type===URL_HEYAAPP){
			out.push([col, row].join("x"));
		}
		else{
			out.push(col);
			out.push(row);
		}

		/* サイズ以降のデータを設定 */
		out.push(pzl.body);

		/* 末尾が0-9,a-z,A-Z以外の時にt.coで情報が欠落しないよう/を追加 */
		var body = out.join("/");
		if(!body.charAt(body.length-1).match(/[a-zA-Z0-9]/)){ body+='/';}
		return body;
	}
441965
function getYTVideoID(url) {
      var regexp = /(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i;
      var match = url.match(regexp);
      return match && match.length === 2 ? match[1] : false;
    }