GithubHelp home page GithubHelp logo

tweetmedia's Introduction

TweetMedia

ゲーム内から Twitter へ画像やメッセージを投稿する Unity 用プラグインです。
Twitter インテグレーションは他にもいくつかありますが、TweetMedia は画像と動画 (アニメ gif、mp4) の投稿まで対応しているのが特徴です。 ゲーム内からメッセージとスクリーンショットを投稿することを目的としたもので、現状それ以外の機能はありません。
Vista 以降の Windows (32bit & 64bit) で動作します。ソースコードレベルでは CURL と C++11 が使える環境であればコンパイルできて動作するはずですが、未確認です。

FrameCapturer がこれを用いてゲーム画面のキャプチャから Twitter への投稿までを実装しています。具体的な使い方の例になると思われます。

使い方

  1. このパッケージ をインポート
  2. uGUI オブジェクト TweetMedia.prefab をシーン内に配置
  3. TweetMedia の consumer_key, consumer_secret を設定

3 について、consumer key / secret は Twitter にアプリを登録することで発行されます。 アプリ登録の手順は簡単で、このサイト へ行き、"Create New App" をクリックして必要な項目を記入するだけです。
consumer_key, consumer_secret は基本的に公開しない情報です。パッケージについているサンプルシーンも consumer_key, consumer_secret は未設定になっているのでご注意ください。

ゲームをプレイする側は、ゲームに Twitter にアクセスする許可を与える必要があります。
TweetMedia.prefab を使っている場合、"Open authorize URL" ボタンを押すとブラウザが開き、認証画面に移動します。
ブラウザの認証画面の "Authorize app" を押し、その後出てくる数字の羅列 (PIN) をゲーム内の InputField ("enter PIN") にコピー&ペーストして Send ボタンを押すことで認証が完了します。
一度認証すればあとはその情報を保存することでこの手順は不要になります。(デフォルトで保存するようになっています)
TweetMedia.prefab は見た目も機能も必要最小限しか備えていないため、独自に改良することをおすすめいたします。
auth

注意点

2015/06/10 現在、アニメ gif は 5 MB、mp4 は 15 MB までの容量制限があり、他にも解像度 (1280px 以内) や長さ (30 秒以内) など色々細かい制限があるようです。 (詳細はこちら)
これらの制限に引っかかった場合にサーバーから返ってくるメッセージは "The validation of media ids failed." で、具体的に何に引っかかったのかまではわかりません。 このため、ゲーム側でファイルの妥当性をチェックするか、ユーザー側への説明が必要になると思われます。
Twitter の仕様は頻繁に変わるため、TweetMedia 側でのチェックはあえてやっていません。

謝辞

License

Copyright (C) 2015 Unity Technologies Japan, G.K.

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.

tweetmedia's People

Contributors

i-saint avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.