From c8ab80046950d97dabf196d5eaac0c2d1753358a Mon Sep 17 00:00:00 2001 From: anekos Date: Sat, 31 Jul 2010 10:05:51 +0000 Subject: 変数を外に出しすぎないようにする git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38081 d0d07461-0603-4401-acd4-de1884942a52 --- twittperator.js | 2798 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 1400 insertions(+), 1398 deletions(-) diff --git a/twittperator.js b/twittperator.js index 8392b93..f21c34c 100755 --- a/twittperator.js +++ b/twittperator.js @@ -27,1490 +27,1492 @@ * @see http://twitter.com/oauth_clients/details/197565 */ -// TwitterOauth for Greasemonkey -function TwitterOauth() { - this.initialize.apply(this, arguments); -} - -// OAuth {{{ -TwitterOauth.prototype = (function() { - - // {{{2 oauth.js - /* - OAuth.js - SHA-1.js - TwitterOauth for Greasemonkey - */ - - /* - * Copyright 2008 Netflix, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - /* Here's some JavaScript software for implementing OAuth. - - This isn't as useful as you might hope. OAuth is based around - allowing tools and websites to talk to each other. However, - JavaScript running in web browsers is hampered by security - restrictions that prevent code running on one website from - accessing data stored or served on another. - - Before you start hacking, make sure you understand the limitations - posed by cross-domain XMLHttpRequest. - - On the bright side, some platforms use JavaScript as their - language, but enable the programmer to access other web sites. - Examples include Google Gadgets, and Microsoft Vista Sidebar. - For those platforms, this library should come in handy. - */ - - // The HMAC-SHA1 signature method calls b64_hmac_sha1, defined by - // http://pajhome.org.uk/crypt/md5/sha1.js - - /* An OAuth message is represented as an object like this: - {method: "GET", action: "http://server.com/path", parameters: ...} - - The parameters may be either a map {name: value, name2: value2} - or an Array of name-value pairs [[name, value], [name2, value2]]. - The latter representation is more powerful: it supports parameters - in a specific sequence, or several parameters with the same name; - for example [["a", 1], ["b", 2], ["a", 3]]. - - Parameter names and values are NOT percent-encoded in an object. - They must be encoded before transmission and decoded after reception. - For example, this message object: - {method: "GET", action: "http://server/path", parameters: {p: "x y"}} - ... can be transmitted as an HTTP request that begins: - GET /path?p=x%20y HTTP/1.0 - (This isn't a valid OAuth request, since it lacks a signature etc.) - Note that the object "x y" is transmitted as x%20y. To encode - parameters, you can call OAuth.addToURL, OAuth.formEncode or - OAuth.getAuthorization. - - This message object model harmonizes with the browser object model for - input elements of an form, whose value property isn't percent encoded. - The browser encodes each value before transmitting it. For example, - see consumer.setInputs in example/consumer.js. - */ - - /* This script needs to know what time it is. By default, it uses the local - clock (new Date), which is apt to be inaccurate in browsers. To do - better, you can load this script from a URL whose query string contains - an oauth_timestamp parameter, whose value is a current Unix timestamp. - For example, when generating the enclosing document using PHP: - -