ytv nowwatching

    
      
  • /*
     * @title ytv nowwatching
     * @description Yahoo!TVのテレビ番組画面でツイート用の詳細文章をコピーできるようにします
     * @include http://tv.yahoo.co.jp/program/*
     * @license MIT License
     * @require 
     */
    
    (function(){
      var title = document.getElementsByClassName("yjM")[0].innerText,
          url = location.href,
          datetime = document.querySelector(".leftBox .pt5p em").innerText.replace(/\s+/," ").replace(/\s+$/,""),
          textarea = document.createElement("textarea");
      textarea.id = "tweet_textarea";
      textarea.innerText = "#nowwatching "+title+" "+" ["+datetime+"] "+url;
      textarea.rows = 5;
      textarea.cols = 60;
      document.getElementsByClassName("program_bg")[0].appendChild(textarea);
    
      var tweetbot_screenname = ""; /* Tweetbot for (MaciOS) を持っている人向け */
      if ( tweetbot_screenname ) {
        t_link_div = document.createElement("div");
        t_link_div.innerHTML = "<a href=\"tweetbot://"+tweetbot_screenname+"/post?text="+encodeURIComponent(textarea.innerHTML)+"\">Tweetbotで登録</a>";
        document.getElementsByClassName("program_bg")[0].appendChild(t_link_div);
      }
    
      textarea.select();
    })();
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2013/01/13 21:46:22 - 2013-01-13
  2. 2013/01/13 21:44:15 - 2013-01-13