/* * The MIT License * * Copyright (c) 2010 teramako * Copyright (c) 2010-2013 anekos * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // INFO {{{ var INFO = xml` teramako anekos MIT License

This is the Twitter client plugin with OAuth authentication.

Command

- Use completion for comfort. :twittperator -getPIN

Opens the page to authorize Twittperator and get your PIN from Twitter.

:twittperator -setPIN PINCode

Allows Twittperator to access Twitter by signifying your PIN.

:twittperator

Shows recent your timeline. (The timeline will be cashed and expired 90 seconds after Twittperator get from Twitter.)

:twittperator!

Gets recent your timeline from Twitter and shows it.

:twittperator!@

Shows mentions to you.

:twittperator!@user

Show @user's tweets.

:twittperator TweetText

Tweets TweetText.

:twittperator @user#id TweetText

Tweets a reply to @user.

:twittperator RT @user#id: refTweet

Does official retweet.

:twittperator TweetText RT @user#id: refTweet

Does classic retweet.

:twittperator!+status_id

Adds the tweet to your favorites.

:twittperator!-status_id

Delete the tweet from your favorites.

:twittperator!?SearchText

Shows the result of searching SearchText.

:twittperator!/URI

Opens URI.

:twittperator!delete StatusID

Deletes the StatusID tweet.

Authentication Setting

First of all, you have to get your PIN from Twitter and signify it to Twittperator. Type a following command: :tw -getPIN and you will get the page to authorize Twittperator to access Twitter in a new tab. If you allow and you will get the PIN (7 digit numbers), then yank it. Secondarily, authorize Twittperator with your PIN. :tw -setPIN yanked_PIN

FAQ

- What is this ?

The plugin that just tweet with Vimperator.

- My timeline is hard to see...?

We are making an effort, and welcoming patches.

- By the way, is it possible to show timeline automatically?

Use chirpstream. Write the below line into rc file. let g:twittperator_use_chirp = 1

- It's too much of the bother to show my timeline manually!!

We think implementing a wider display method and a mean of word wrapping will solve this issue. Any ideas?

- Is there a plan to work together Growl GNTP?

Write the plugin.

teramako anekos MIT License

これはOAuth認証を用いたTwitterクライアントプラグインです。

Command

- 適当に補完しましょう。 :twittperator -getPIN

PINコード取得ページを開きます。

:twittperator -setPIN PINcode

PINcodeを設定します。

:twittperator

前回取得したタイムラインを表示します。 (キャッシュが90秒以上古い場合は再取得。)

:twittperator!

強制的に取得したタイムラインを表示します。

:twittperator!@

あなたへの言及(mentions)表示します。

:twittperator!@user

@user のタイムラインを表示します。

:twittperator TweetText

TweetTextをポストします。

:twittperator @user#id TweetText

@user への返信になります。

:twittperator RT @user#id: refTweet

公式RTになるはずです。

:twittperator TweetText RT @user#id: refTweet

非公式RTになるはずです。

:twittperator!+status_id

tweetをfavoriteします。

:twittperator!-status_id

tweetをunfavoriteします。

:twittperator!?SearchText

SearchTextの検索結果を表示します。

:twittperator!/URI

URIを開きます。

:twittperator!delete StatusID

StatusIDのツイートを削除します。

Authentication Setting

最初にPINコードを取得し設定する必要があります。 :tw -getPIN を実行すると新規タブに本アプリケーションを許可するかを問うページが開かれます。 許可をすると、PINコード(数値)が表示されるのでコピーしてください。 :tw -setPIN コピーしたPINコード で初期設定完了です。

FAQ

- なんて読むんだ

知らん。トゥイットゥペレータと自分は勝手に読んでいる。

- 何のためのクライアント?

Vimperatorを使っていて、さくっと呟きたいとき用です(ぉ

- TL表示をもっと工夫しろ

ごめんなさい。改良してコミットしてくれると嬉しいです。

- つーか、TLくらい自動取得しろ

はい、がんばりました。 let g:twittperator_use_chirp = 1 として、chirpstream を利用してください。

- ぶっちゃけTL表示とか面倒だよね?

はい、がんばります・・・ でかい表示領域と行の折り返し方法が確立できれば、もっと頑張れる気がします。

- Growl GNTP との連携しないの?

プラグイン書きましょう。

`; // }}} (function() { // TwitterOauth for Greasemonkey {{{ /* * http://efcl.info/2010/0610/res1721/ * * The MIT License * * Copyright (c) 2010 azu * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ function TwitterOauth() { this.initialize.apply(this, arguments); } 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: